Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cl: loop for hash tables #1605

Merged
merged 6 commits into from Apr 17, 2024
Merged

Add support for cl: loop for hash tables #1605

merged 6 commits into from Apr 17, 2024

Conversation

masinter
Copy link
Member

Adds to XCL-LOOP an addition for supporting iterating through a hash file.
Not a direct port, had some ANSI . CLtL2 updates (declare (ignorable --))
includes TEST-HASH-LOOP()

@masinter
Copy link
Member Author

masinter commented Apr 2, 2024

This PR now includes a fix to the problem of the LOOP macro not processing 'repeat N' clauses (bug in loop:repeat-clause). This bug was in the original from SACL.

Copy link
Contributor

@nbriggs nbriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a new full.sysout on this branch, and when I ran (TEST-HASH-LOOP) it dropped into URaid, having picked up a bad array block pointer during a GC.

    frame #6: 0x000000010bf9394e ldex`panicuraid(sig=11, info=<unavailable>, context=<unavailable>) at timer.c:795:3 [opt]
    frame #7: 0x00007ff800c72dfd libsystem_platform.dylib`_sigtramp + 29
    frame #8: 0x000000010bfb0883 ldex`reclaimarrayblock(ptr=208535552) at gcfinal.c:481:37 [opt]
    frame #9: 0x000000010bfb0afd ldex`gcreccell(cell=<unavailable>) at gcrcell.c:189:28 [opt]
    frame #10: 0x000000010bfb1d5c ldex`gcmapscan at gcmain3.c:131:7 [opt]
    frame #11: 0x000000010bfb2553 ldex`dogc01 at gcr.c:113:3 [opt]
    frame #12: 0x000000010bfb25de ldex`doreclaim at gcr.c:128:5 [opt]
    frame #13: 0x000000010bf91117 ldex`OP_subrcall(subr_no=<unavailable>, argnum=<unavailable>) at subr.c:427:7 [opt]
    frame #14: 0x000000010bf84d22 ldex`dispatch at xc.c:683:7 [opt]
    frame #15: 0x000000010bf9da89 ldex`start_lisp at main.c:749:3 [opt]
    frame #16: 0x000000010bf9d7f8 ldex`main(argc=<unavailable>, argv=0x00007ff7b3f8e788) at main.c:696:3 [opt]
    frame #17: 0x00000001110bf52e dyld`start + 462

@masinter
Copy link
Member Author

i'm baffled -- I can't reproduce the problem. The added code for the hash iterator doesn't acdtually write any storage (no PUTBASE anything) ... it's pretty much the algorithm in MAPHASH with stack based variables turned into compiled closures. ..

By any chance, are you running with maiko compiled with some kind of stack and/or freelist checking turned on?

@nbriggs
Copy link
Contributor

nbriggs commented Apr 17, 2024

I deleted the sysouts and the maiko executables and emade everything from scratch, and now it appears to be working. I didn't change any maiko configuration/code. I don't know what was going on - but if you don't see the problem, and I am no longer seeing the problem, and there's nothing about the code that is suspicious, then I think it's probably better to merge it and press on.

@masinter masinter requested a review from nbriggs April 17, 2024 22:46
Copy link
Contributor

@nbriggs nbriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Wondering how it ended up with an LCOM originally, since it has COMPILE-FILE as the compiler type, but I see the LCOM is being replaced by a DFASL.

@masinter masinter merged commit 92fd33e into master Apr 17, 2024
@masinter masinter deleted the loop-hash-support branch April 17, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants