roc-lang / examples

All kinds of Roc examples
https://www.roc-lang.org/examples
Creative Commons Zero v1.0 Universal
30 stars 17 forks source link

Go platform example segfault only on Ubuntu #164

Open Anton-4 opened 7 months ago

Anton-4 commented 7 months ago
 + valgrind ./examples/GoPlatform/main
==3920== Memcheck, a memory error detector
==3920== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3920== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==3920== Command: ./examples/GoPlatform/main
==3920== 
==3920== 
==3920== Process terminating with default action of signal 11 (SIGSEGV)
==3920==  Bad permissions for mapped region at address 0x1A4001
==3920==    at 0x1A4001: ??? (in /home/runner/work/examples/examples/examples/GoPlatform/main)
==3920==    by 0x4A6E2E7: ???
==3920==    by 0x1A3FCF: ??? (in /home/runner/work/examples/examples/examples/GoPlatform/main)
==3920== 
==3920== HEAP SUMMARY:
==3920==     in use at exit: 0 bytes in 0 blocks
==3920==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==3920== 
==3920== All heap blocks were freed -- no leaks are possible
==3920== 
==3920== For lists of detected and suppressed errors, rerun with: -s
==3920== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
./ci_scripts/all_tests.sh: line 75:  3920 Segmentation fault      (core dumped) valgrind ./examples/GoPlatform/main
Anton-4 commented 1 month ago

Some more info with valgrind 3.22:

❯ valgrind ./examples/GoPlatform/main 
==92334== Memcheck, a memory error detector
==92334== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==92334== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==92334== Command: ./examples/GoPlatform/main
==92334== 
==92334== Warning: set address range perms: large range [0x9e42000, 0x29e42000) (noaccess)
==92334== Warning: set address range perms: large range [0x29e42000, 0x49e42000) (noaccess)
==92334== Warning: ignored attempt to set SIGRT32 handler in sigaction();
==92334==          the SIGRT32 signal is used internally by Valgrind
==92334== Warning: ignored attempt to set SIGRT32 handler in sigaction();
==92334==          the SIGRT32 signal is used internally by Valgrind
==92334== Warning: client switching stacks?  SP change: 0x1ffefff618 --> 0xc00005c7d8
==92334==          to suppress, use: --max-stackframe=687211925952 or greater
==92334== Warning: client switching stacks?  SP change: 0xc00005c740 --> 0x1ffefff6c8
==92334==          to suppress, use: --max-stackframe=687211925624 or greater
==92334== Warning: client switching stacks?  SP change: 0x1ffefff6c8 --> 0xc00005c740
==92334==          to suppress, use: --max-stackframe=687211925624 or greater
==92334==          further instances of this message will not be shown.
==92334== 
==92334== Process terminating with default action of signal 11 (SIGSEGV)
==92334==  Bad permissions for mapped region at address 0x1BF078
==92334==    at 0x1BF078: ??? (in /home/username/gitrepos/examples-non-nix/examples/examples/GoPlatform/main)
==92334==    by 0x1BEA58: ??? (in /home/username/gitrepos/examples-non-nix/examples/examples/GoPlatform/main)
==92334== 
==92334== HEAP SUMMARY:
==92334==     in use at exit: 912 bytes in 5 blocks
==92334==   total heap usage: 14 allocs, 9 frees, 3,024 bytes allocated
==92334== 
==92334== LEAK SUMMARY:
==92334==    definitely lost: 0 bytes in 0 blocks
==92334==    indirectly lost: 0 bytes in 0 blocks
==92334==      possibly lost: 864 bytes in 3 blocks
==92334==    still reachable: 48 bytes in 2 blocks
==92334==         suppressed: 0 bytes in 0 blocks
==92334== Rerun with --leak-check=full to see details of leaked memory
==92334== 
==92334== For lists of detected and suppressed errors, rerun with: -s
==92334== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
Anton-4 commented 1 month ago

This also happens on Ubuntu 22.04 and 24.04