iu-parfunc / gibbon

A compiler for functional programs on serialized data
http://iu-parfunc.github.io/gibbon/
151 stars 13 forks source link

RTS: recompile uncoditionally to fix #244 #245

Closed ulysses4ever closed 5 months ago

ulysses4ever commented 5 months ago

Sorry for being slow, I was traveling and just got back yesterday.

Not at all! It's the holiday season after all! I didn't expect anyone to look into it this week.

ulysses4ever commented 5 months ago

It's kinda worrying that the CI passed with that typo (missing $ in $(NAME)). Do you have a guess how was it possible? It would be good to ensure that things like that fail in CI.

ulysses4ever commented 5 months ago

I cleaned up the history and made our comments align. Should be good to go, I think.

ckoparkar commented 5 months ago

I cleaned up the history and made our comments align. Should be good to go, I think.

Super, thanks :)

It's kinda worrying that the CI passed with that typo (missing $ in $(NAME)). Do you have a guess how was it possible? It would be good to ensure that things like that fail in CI.

If I leave it as (NAME) and run make, the correct .c file still gets compiled!? But if I re-run make, it doesn't get compiled again, despite the FORCE... I don't understand what's going on yet, will look into it.

ckoparkar commented 5 months ago

(The makefile changed broke the pointer backend somehow, looking into it in a little bit.)

ckoparkar commented 5 months ago

gib_gc_cleanup() in gib_exit() was segfaulting in pointer mode. It shouldn't run in pointer mode at all, which is what I did in the last commit. I suspect that this bug existed for a while, but was hiding because of two other bugs:

(1) Previously, main would return without running gib_exit() so this problematic code would never run (#242), and

(2) The C RTS wasn't actually being recompiled in pointer mode, so all the GC specific stuff was still being initialized (via gib_storage_initialize()) and we didn't see any segfaults even after (1) was fixed, but saw these now.

Phew.

ulysses4ever commented 5 months ago

Amazing sleuthing: I wouldn't have a clue!.. Thank you! And merging...

ulysses4ever commented 5 months ago

I just learned about the --always-make / -B flag of make that unconditionally re-makes all targets. Maybe that was another way to fix it...