Home > OS >  Linux embedded background process cannot produce the core file
Linux embedded background process cannot produce the core file

Time:11-13

Ladies and gentlemen, to ask, I can't produce the equipment running in the background process of the core file, but the front run the file, really don't understand, support a move you,

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 research

CodePudding user response:

Please let the generated inside the core code is added in the main file? Or in other places, new answers

CodePudding user response:

reference 4 floor weixin_45560700 response:
, please let the generated inside the core code is added in the main file? Novice or in other places, please answer

Had better be put in the main, this process in any local core off can be generated the core

CodePudding user response:

Reference:
https://acuity.blog.csdn.net/article/details/106672319
  • Related