Stream: compiler development

Topic: segfault on tutorial.roc


view this post on Zulip Richard Feldman (Aug 17 2023 at 12:27):

I've noticed this happens every so often with CI builds:

Screen-Shot-2023-08-14-at-8.49.07-PM.png

e.g. https://github.com/roc-lang/roc/actions/runs/5861941077/job/15892928701?pr=5747#step:16:93 and https://github.com/roc-lang/roc/actions/runs/5886655295/job/15964848784?pr=5764#step:16:94 are two examples of it happening

view this post on Zulip Richard Feldman (Aug 17 2023 at 12:27):

I assume this means there's a potential segfault in basic-cli somewhere

view this post on Zulip Richard Feldman (Aug 17 2023 at 12:28):

if anyone has time, it would be good to try to reproduce this locally, e.g. run that CI script in a loop with valgrind until it reproduces, and then see what valgrind says about what happened

view this post on Zulip Anton (Aug 18 2023 at 08:24):

I can look into it eventually if no one else is available.

view this post on Zulip Anton (Aug 21 2023 at 17:54):

I could not reproduce this on my machine but valgrind seems to have found something.

view this post on Zulip Anton (Aug 21 2023 at 17:57):

We should record the steps required to fix something like this, starting from the valgrind output. Because I have no idea where to go from here :p

view this post on Zulip Folkert de Vries (Aug 21 2023 at 18:15):

step 0 is --debug --linker=legacy

view this post on Zulip Anton (Aug 22 2023 at 09:53):

This looks useful:

==14022== Conditional jump or move depends on uninitialised value(s)
==14022==    at 0x1DD5A9: ??? (tutorial.ll:6045)
==14022==    by 0x1D974A: Box_unbox_7f7e162ee4345c12acb2c8dddfd129c8c9ef562ecb31841cfff13d4789ffc2 (tutorial.ll:3342)
==14022==    by 0x1DAB1D: _transformFileContentForHost_beb22fad19423347b2aa99b33212e862ded3f83df5d6238acb1a6a9ade3e (tutorial.ll:4080)
==14022==    by 0x1DABCA: roc__transformFileContentForHost_1_exposed (tutorial.ll:4102)
==14022==    by 0x1E062C: host::process_file (lib.rs:303)
==14022==    by 0x1DE83D: host::run (lib.rs:145)
==14022==    by 0x1DD870: rust_main (lib.rs:79)
==14022==    by 0x1DD605: main (in /home/username/gitrepos/roc2/roc/www/generate_tutorial/src/roc-tutorial)
==14022==  Uninitialised value was created by a stack allocation
==14022==    at 0x1DEBF0: host::process_file (lib.rs:174)
==14022==
==14022== Conditional jump or move depends on uninitialised value(s)
==14022==    at 0x1DD247: decrement_refcounted_ptr_8 (tutorial.ll:5767)
==14022==    by 0x1DD5DA: ??? (tutorial.ll:6051)
==14022==    by 0x1D974A: Box_unbox_7f7e162ee4345c12acb2c8dddfd129c8c9ef562ecb31841cfff13d4789ffc2 (tutorial.ll:3342)
==14022==    by 0x1DAB1D: _transformFileContentForHost_beb22fad19423347b2aa99b33212e862ded3f83df5d6238acb1a6a9ade3e (tutorial.ll:4080)
==14022==    by 0x1DABCA: roc__transformFileContentForHost_1_exposed (tutorial.ll:4102)
==14022==    by 0x1E062C: host::process_file (lib.rs:303)
==14022==    by 0x1DE83D: host::run (lib.rs:145)
==14022==    by 0x1DD870: rust_main (lib.rs:79)
==14022==    by 0x1DD605: main (in /home/username/gitrepos/roc2/roc/www/generate_tutorial/src/roc-tutorial)
==14022==  Uninitialised value was created by a stack allocation
==14022==    at 0x1DEBF0: host::process_file (lib.rs:174)

Last updated: Jul 06 2025 at 12:14 UTC