black-parrot / black-parrot-sim

BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

Segmentation Fault in the "make -C bp_top/syn tire_kick" output #10

Closed mik1234mc closed 1 week ago

mik1234mc commented 2 years ago

I would to check that the Segmentation Fault message in the make -C bp_top/syn tire_kick output is intended or I have something wrong in my setup.

...
__________ ___________  _______________________________
\______   \\_   _____/ /   _____/\_   _____/\__    ___/
 |       _/ |    __)_  \_____  \  |    __)_   |    |   
 |    |   \ |        \ /        \ |        \  |    |  1->0 time =      20000
 |____|_  //_______  //_______  //_______  /  |____|   
 ASYNC  \/         \/         \/         \/            
NBF loader done!
Hello World!
[CORE0 FSH] PASS
All cores finished! Terminating...
- /home/michael/projects/black-parrot-sim/rtl/bp_top/test/common/bp_nonsynth_host.sv:183: Verilog $finish
Finishing test
Executing final
Segmentation fault
[CORE0 FSH] PASS
make: [/home/michael/projects/black-parrot-sim/rtl/bp_top/test/tb/bp_tethered/Makefile.verilator:117: /home/michael/projects/black-parrot-sim/rtl/bp_top/syn/results/verilator/bp_tethered.e_bp_default_cfg.none.sim.bp-tests.hello_world/tire_kick] Error 1 (ignored)
make: Leaving directory '/home/michael/projects/black-parrot-sim/rtl/bp_top/syn'

Thanks for confirmation, Michael

dpetrisko commented 2 years ago

Hi Michael,

It's not intended but it is expected. There's some combination of Verilator+OS that results in this segfault upon exit. The simulation itself appears to have been successful.

Copying a conversation from our Gitter for tracking:

I did try running it under gdb and it seems like the error is during a call to fdClose in iofclose.c: (gdb) where

0 _IO_new_fclose (fp=0x0) at iofclose.c:48

1 0x000055555556715d in VerilatedContextImp::fdClose(unsigned int) ()

2 0x0000555555757f45 in Vtestbench024rootfinal_TOP(Vtestbench024root*) ()

3 0x00005555556aa0a8 in Vtestbench024rootfinal(Vtestbench024root*) ()

4 0x000055555555abcb in main ()

(gdb) looks like a 0x0 argument is passed which is then dereferenced later in the code.

black-parrot commented 2 years ago

Perhaps Michael can say what version of Verilator and what OS he is running.

On Thu, Jul 14, 2022 at 1:56 PM Dan Petrisko @.***> wrote:

Hi Michael,

It's not intended but it is expected. There's some combination of Verilator+OS that results in this segfault upon exit. The simulation itself appears to have been successful.

Copying a conversation from our Gitter for tracking:

I did try running it under gdb and it seems like the error is during a call to fdClose in iofclose.c: (gdb) where

0 _IO_new_fclose (fp=0x0) at iofclose.c:48

1 https://github.com/black-parrot/black-parrot-sim/issues/1

0x000055555556715d in VerilatedContextImp::fdClose(unsigned int) ()

2 https://github.com/black-parrot/black-parrot-sim/issues/2

0x0000555555757f45 in Vtestbench024rootfinal_TOP(Vtestbench024root*) ()

3 https://github.com/black-parrot/black-parrot-sim/issues/3

0x00005555556aa0a8 in Vtestbench024rootfinal(Vtestbench024root*) ()

4 https://github.com/black-parrot/black-parrot-sim/issues/4

0x000055555555abcb in main () (gdb) looks like a 0x0 argument is passed which is then dereferenced later in the code.

— Reply to this email directly, view it on GitHub https://github.com/black-parrot/black-parrot-sim/issues/10#issuecomment-1184889508, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKK2XQBU67UYH3V4PY6JGYLVUB5ILANCNFSM53TPOAAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mik1234mc commented 2 years ago

I have Verilator 4.216 and Debian11. I see that you have tagged a specific Verilator version in tools subdir. Should I add this binary version into system $PATH?

dpetrisko commented 2 years ago

Wouldn't hurt to give it a shot but that tag is just the latest we've tried out on CentOS, so the Debian issue is likely to exist

black-parrot commented 2 years ago

Sounds like Verilator/Debian incompatibility?

On Fri, Jul 15, 2022 at 12:35 AM Dan Petrisko @.***> wrote:

Wouldn't hurt to give it a shot but that tag is just the latest we've tried out on CentOS, so the Debian issue is likely to exist

— Reply to this email directly, view it on GitHub https://github.com/black-parrot/black-parrot-sim/issues/10#issuecomment-1185265336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKK2XQCLIM55GJW4DOX4LADVUEIEPANCNFSM53TPOAAA . You are receiving this because you commented.Message ID: @.***>

dpetrisko commented 2 years ago

Verilator is tested with Debian by itself, so it's likely a combination of that with Unix pipes

dpetrisko commented 1 week ago

I don't think this exists anymore, but anyone feel free to reopen if you run into it