EGSnrc icon indicating copy to clipboard operation
EGSnrc copied to clipboard

Redirecting `stderr` to a file causes `EGS_Application` based user codes to abort

Open mxxo opened this issue 2 years ago • 0 comments

Reproducer with tutor7pp:

$ tutor7pp -i test1.egsinp -p tutor_data 2> stderr.txt # redirect stderr to file
In EGS_Application::initSimulation()
$ echo $?
1
$ cat stderr.txt
EGS_RandomGenerator::createRNG: no 'RNG definition' input


******** Space left on file system is below 1 MB. Quitting now.

I see the code it's hitting is here, but don't understand why redirection works for stdout but not stderr: https://github.com/nrc-cnrc/EGSnrc/blob/a6fc389c6465c949645380976f38a013a639759c/HEN_HOUSE/egs%2B%2B/egs_application.cpp#L1077-L1088

mxxo avatar May 11 '22 20:05 mxxo