Fix SDSU ray tracer buffer overflow and modernize Python tests#64
Open
pjmaechling wants to merge 1 commit intoSCECcode:devfrom
Open
Fix SDSU ray tracer buffer overflow and modernize Python tests#64pjmaechling wants to merge 1 commit intoSCECcode:devfrom
pjmaechling wants to merge 1 commit intoSCECcode:devfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses two compatibility issues when running the BBP on modern operating systems with stricter compilers (e.g., GCC 11, Ubuntu 22.04+).
1. SDSU Ray Tracer Segmentation Fault (
ray3DJHfor.c)BBtoolbox.exebinary was crashing with a segmentation fault during the high-frequency scattering generation. Modern GCC compilers flag a string buffer overflow.mallocallocations fortimefileandvelfileon lines 205-206 were originally sized at exactly 12 and 11 bytes, which did not account for the hidden\0null terminator required bystrcpy. This caused memory corruption on strict compilers. Increased the allocation size to 80 bytes and included<stdlib.h>and<unistd.h>to resolve implicit declaration errors.2. Python Environment Test Failure (
test_python_code.py)test_python_code_testsunit test was failing with apython: not founderror and throwing unknown option errors for-tt. Modern Linux environments often alias topython3exclusively, and Python 3 natively rejects mixed tabs and spaces, rendering the-ttflag obsolete.test_execute_platform_bbp,test_python_code_comps, andtest_python_code_teststo usesys.executableinstead of hardcodedpythonorpython3strings, ensuring the tests always use the active Python environment. Removed the deprecated-ttflags.