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

Fix crash in tiny_bvh_speedtest. #15

Merged
merged 1 commit into from
Nov 9, 2024
Merged

Conversation

eloj
Copy link
Contributor

@eloj eloj commented Nov 9, 2024

Overflow turns index negative. Enforce unsigned result.

Overflow turns index negative. Enforce unsigned result.
@eloj
Copy link
Contributor Author

eloj commented Nov 9, 2024

[...]
- CPU, coherent, basic 2-way layout, MT, packets (SSE):  2291.45ms for 7.68M rays (3.35MRays/s)
Segmentation fault (core dumped)

$ gdb -q ./tiny_bvh_speedtest core.124460 
Printing of object's derived type based on vtable info is on.
Reading symbols from ./tiny_bvh_speedtest...
[New LWP 124460]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./tiny_bvh_speedtest'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  main () at tiny_bvh_speedtest.cpp:337
337			rays[i] = rays[j];
(gdb) print i
$1 = 2
(gdb) print j
$2 = -1433861
(gdb) quit

@jbikker jbikker merged commit a2a864b into jbikker:main Nov 9, 2024
6 checks passed
@eloj eloj deleted the rand-overflow branch November 9, 2024 07:45
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

Successfully merging this pull request may close these issues.

2 participants