Hi all,
I have an application that is segfaulting on OpenWRT and I need to debug it. Out of the box, it seems like I can't get core dumps though.
I tried a few things. First was the standard:
Code:
ulimit -c unlimited
mkdir -p /tmp/crash/corefiles
chmod 775 /tmp/crash/corefiles
echo "/tmp/crash/corefiles/%e.%s.core" > /proc/sys/kernel/core_pattern
But no core file was present after a crash. I did a little more digging and found a few resources that indicated that for busybox, you need to enable FEATURE_INIT_COREDUMPS in the configuration. In order to do that, though, I had to also enable busybox -> init utilities -> init.
That's where I started getting very confused. My understanding is that OpenWRT uses procd as its init program. Making this change sounds to me like replacing procd with init. For whatever reason, I could never get it to boot with init. There was no /etc/init.d/rcS file provided, and the one I wrote (based on some examples hosted by busybox) all failed because /dev/null didn't exist and couldn't be created because the file system was read-only. I added init=/bin/sh to my kernel bootargs, and found that there was nothing in /dev except /dev/console.
So, I ended up abandoning that route. I couldn't even get the system to boot with busybox init. So, I don't know how to enable FEATURE_INIT_COREDUMPS in the busybox configuration without using init, and init doesn't seem to work at all, so I went back to procd.
My assumption is that when busybox init is enabled in OpenWRT, it is used
instead of procd. Is that correct? If so, can anyone help me troubleshoot my boot situation with init? If not, is there a way to enable core dumps with procd?
And one final question: why does the init program matter at all for generating a core dump? Shouldn't that just be a kernel thing?
Thanks!