LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 08-30-2019, 09:47 AM   #1
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Rep: Reputation: 19
Enabling core dumps on OpenWRT/busybox/procd


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!
 
Old 09-01-2019, 01:27 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,499

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
Enabling core dumps or maintainer keys means a kernel recompile. They are both kernel options.

Segfaults are memory faults. It's always been possible to write to memory pages that aren't there; that's what a segfault originally meant, but now it's nearly any memory error.
 
  


Reply

Tags
busybox, init, openwrt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Compact networking SBC runs OpenWrt on dual-core Cortex-A9 LXer Syndicated Linux News 0 08-03-2016 04:42 PM
LXer: Creator Ci40 SBC runs OpenWRT, Debian, Brillo on dual-core MIPS LXer Syndicated Linux News 0 11-23-2015 06:10 PM
[SOLVED] Linux ltsp client failing to boot. After ubuntu splash screen, it dumps me to busybox abhishekgit Ubuntu 5 07-28-2014 11:30 AM
Disabling core dumps in mandrake pshepperd Linux - Software 2 09-26-2003 09:16 PM
Upgraded glibc to 2.3; now rpm segfaults/dumps core nfisk Linux - Software 0 08-26-2003 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 02:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration