In the/etc/profile include the following three lines
Ulimit -c unlimited
Echo "1" & gt; The/proc/sys/kernel/core_uses_pid
Echo "/data/app/core - % % % e - p - t" & gt; The/proc/sys/kernel/core_pattern
But is still, the background, after the collapse process does not produce the core, front running, program after the collapse of the core;
Why?
CodePudding user response:
Settled, to make the background program to generate the core, in addition to meet the above Settings, also must add the following code in the application source code:Int iRes=RLIMIT_CORE;
Struct rlimit stRlim;
/* allows the core files generated */
StRlim. Rlim_cur=stRlim. Rlim_max=RLIM_INFINITY;
If (0!=setrlimit (iRes, & amp; StRlim))
{
Printf (" Error: setrlimit failed, % s \ n ", the strerror (errno));
Return APP_RET_ERROR;
}
I thus modified test is feasible, there are better ways of also can leave a message,
CodePudding user response:
Learned, return true not generate core program after the researchCodePudding user response:
Please let the generated inside the core code is added in the main file? Or in other places, new answersCodePudding user response: