multithreading - Why does my C++ program crash with exit code 11 when I remove a cout statement? -


in c++ project, encounter strange issue. crashes exit code 11 when remove log statement (cout).

this answer points source explains exit code 11 (actually eagain) following statement:

the system lacked necessary resources create thread, or system-imposed limit on total number of threads in process pthread_threads_max exceeded.

but pretty sure don't create additional threads in code (at least not explicitly). why error occur , why go away when use log statement?

for reference, post code it's of course out of context , relevant line 1 log statement.

 payloadregionmapper(string mappingtechniquename, string configpath = "")     : payload(payload), config(config(configpath)) {      cout << "construct payloadregionmapper" << endl; // if commented out, program crashes....      frames = generateframes();     setmappingtechnique(mappingtechniquename); } 

run program using debugger , backtrace once crash happens. using bt , frame command can idea behaviour of program during crashing situation.

gdb <executable>  .....<crash happened>  bt <it give stack frame >  frame <frame number>  values , memory area there.  

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -