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

SIGBUS crash #412

Closed
jklockars opened this issue Apr 12, 2021 · 1 comment
Closed

SIGBUS crash #412

jklockars opened this issue Apr 12, 2021 · 1 comment

Comments

@jklockars
Copy link

While testing a memory implementation, I ran into a very strange crash. See included code, which has been cut down to a "minimal" test case. I have left some test code in there, commented out, in case it might be helpful to get to the bottom of this.

This was run on an M1 Mac Mini with the latest updates.

johan@Johans-Mac-mini Sources % time nvc -a bug.vhd -e bug -r
/usr/bin/gcc -bundle -flat_namespace -undefined dynamic_lookup -o /Users/johan/Sources/work/_WORK.BUG.elab.so /Users/johan/Sources/work/_WORK.BUG.elab.o

*** Caught signal 10 (SIGBUS) [address=0x103de4000, ip=0x19518d710] ***

-------- STACK TRACE --------
1 libsystem_platform.dylib 0x000000019518d710 _platform_memset + 176
2 _IEEE.NUMERIC_STD-body.so 0x0000000103c9e2fc IEEE.NUMERIC_STD.TO_SIGNED(I7NATURAL)23IEEE.NUMERIC_STD.SIGNED + 84
3 _WORK.BUG.elab.so 0x0000000103cc3c24 :bug$WORK.BUG(BEHAVIORAL).line_17.WR_DATA(I) + 112
4 _WORK.BUG.elab.so 0x0000000103cc3d34 🐛line_17 + 196
5 nvc 0x00000001021d5c74 rt_run + 220
6 nvc 0x00000001021d4478 rt_run_sim + 1268
7 nvc 0x0000000102159a40 process_command + 4608
8 nvc 0x000000010215975c process_command + 3868
9 nvc 0x00000001021599cc process_command + 4492
10 nvc 0x00000001021585ac main + 1028
11 libdyld.dylib 0x0000000195161f34 start + 4

nvc -a bug.vhd -e bug -r 0.05s user 0.03s system 75% cpu 0.113 total

If I lower my loop count from 3000 to 2000, things work fine.
And I can increase the loop count a 1000-fold without issue by calculating a value and putting it into a variable, skipping one level of procedure calls.

bug.txt

@nickg
Copy link
Owner

nickg commented Apr 17, 2021

Thanks for reporting this issue and providing the excellent test case. It should be fixed in the master branch now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants