Home > Software design >  I run `"crash_demo.run"` by `spawn-fcgi` . How to collect `core` file
I run `"crash_demo.run"` by `spawn-fcgi` . How to collect `core` file

Time:05-10

1. Question

I run "crash_demo.run" by spawn-fcgi . How to collect core file .

2. Background & Environment

I'm exolore C Web Programming .

  1. web-server : nginx
  2. CGI(FastCGI) : fastcgipp 3.0
  3. CGI Wrapper : spawn-fcgi
    • I didn't use FCGI Wrap which ngifix supplied .
    • I understand FCGI Wrap be drive by spawn-fcgi , Of course this is off topic .
  4. My c application . (be called crash_demo) .

3. Step to reproduce exception

  1. crash_demo insert code throw "test exception str, check _core_ file" , build got crash_demo.run
  2. run nginx : sudo nginx -c my_nginx_custom.config
  3. ulimit -c unlimited
  4. run crash_demo.run by spawn-fcgi : spawn-fcgi -a 127.0.0.1 -p 9000 -f /path/crash_demo.run
  5. test the normal http request , and http request can be completed normally .
  6. test the crash_demo http request , got 5xx response .
    • The directory where crash_demo.run is located does not see the core file

My guess

  1. core file not generate .
  2. core file is generated , but i don't the file path .

Does anyone know what happened?



Myself update

My question is flawed .

Thanks @sehe , my step :

  1. I read two webpage
    1. https://man7.org/linux/man-pages/man5/core.5.html
    2. https://zhuanlan.zhihu.com/p/240633280
  2. update my /proc/sys/kernel/core_pattern
    • core -> core_%e_%p_%t
  3. ulimit -c unlimited
  4. spawn-fcgi -a 127.0.0.1 -p 9000 -f /path/crash_demo.run
  5. sudo find / core_ | grep core_crash_demo
    • result /path/core_crash_demo._5080_1652169152

So , my guess on my question is failed .

The fact is , I don't generate core file , when my question.

When my generated core file successed , the core file path is crash_demo.run parent directory .

CodePudding user response:

This question is probably more for askubuntu.com or serverfault.stackexchange.com.

You likely need to configure core dump. Since we don't know the platform, I'm assuming likely a Linux. See e.g. core(5):

There are various circumstances in which a core dump file is not produced

In my experience what's required is setting a core pattern (/proc/sys/kernel/core_pattern)

  • Related