Added a print statement to program source code (in C) in order to investigate a segmentation fault
occurring on local machine during execution. Print statement does not show anything in execution, although it’s placed within a scope which the program reaches (the valgrind stack trace indicated it was within one of the functions which ran before the segmentation fault). Program compiles without any issues. Seeking advice on how to resolve this so I can continue investigating the original issue.
Checked that bash was on the correct branch at compile time. The file change (the addition of the print statement) is acknowledged by my IDE (VSCode) which added the file marker M to the file. File change is noted in git status.
Tso is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
The stdout buffer used by printf
is probably not being flushed before the program crashes. Use fflush(stdout)
after the print.
2