XP is just a number | |
PerlMonks |
"Segmentation fault" text not captured by perl scriptby Special_K (Monk) |
on Apr 01, 2020 at 17:21 UTC ( [id://11114914]=perlquestion: print w/replies, xml ) | Need Help?? |
Special_K has asked for the wisdom of the Perl Monks concerning the following question: I am debugging an issue with a compiled program written in c++ that is being called from a perl script. If I create a shell script that calls the compiled program directly:
And then run it, the last 2 lines written to the console are:
If I instead write the following standalone perl script:
The last line printed from the executable is:
The values of the variables are as follows: exit_value = 0, signal_num = 11, dumped_core = 0 Why in this case is the "Segmentation fault" text not captured by the perl script? The behavior is the same if I replace this line: with this:
and then print $backtick_return at the end of the program. When I first started debugging this issue I was unaware of how to properly check system() return codes. Now that I've added that check as shown above debugging future issues should be easier, but I would still like to know why the "Segmentation fault" text isn't being captured by the system command, as seeing that when I first started debugging this issue would have been helpful.
Back to
Seekers of Perl Wisdom
|
|