You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ExampleCubes::initialize function the application builds a relative path to the files (v/f)s_cubes.bin. If your working directory is the same as the application, it works fine, but crashes if you try to execute from any other directory.
How to reproduce:
mkdir build && cd build
cmake .. -DBIGG_EXAMPLES=ON
make
examples/cubes/cubes <-- Crashes with SIGSEGV, no error messages
cd examples/cubes && cubes <-- Works fine
Crash happens on cubes.cpp:78, mProgram = bigg::loadProgram( vsName, fsName );, actually inside of bigg::loadProgram.
Fixing the example so that the file loading works independently from the working directory would be nice.
But this still leaves an undesirable behavior for anyone using the bigg framework, as bigg::loadProgram simply crashes without any error output in case the parameters passed to it are invalid. As a user, I can either use exceptions or do something like this (resulting in unnecessary file open/close calls):
Though I guess I'd be satisfied if the function outputted some "failed to open file" logs to cerr before crashing out.
The text was updated successfully, but these errors were encountered:
dejaime
changed the title
Cubes example crashes (SIGSEGV) if executed from other directories
Cubes example crashes (SIGSEGV) with no errors if executed from other directories
Feb 18, 2021
In the
ExampleCubes::initialize
function the application builds a relative path to the files(v/f)s_cubes.bin
. If your working directory is the same as the application, it works fine, but crashes if you try to execute from any other directory.How to reproduce:
mkdir build && cd build
cmake .. -DBIGG_EXAMPLES=ON
make
examples/cubes/cubes
<-- Crashes with SIGSEGV, no error messagescd examples/cubes && cubes
<-- Works fineCrash happens on
cubes.cpp:78
,mProgram = bigg::loadProgram( vsName, fsName );
, actually inside ofbigg::loadProgram
.Fixing the example so that the file loading works independently from the working directory would be nice.
But this still leaves an undesirable behavior for anyone using the bigg framework, as
bigg::loadProgram
simply crashes without any error output in case the parameters passed to it are invalid. As a user, I can either use exceptions or do something like this (resulting in unnecessary file open/close calls):Though I guess I'd be satisfied if the function outputted some "failed to open file" logs to cerr before crashing out.
The text was updated successfully, but these errors were encountered: