What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Is there a way to enable core dumping?

ethician

Occasional Visitor
Can someone please point me in the right direction?

Setting `ulimit -c unlimited` and /proc/sys/kernel/core_* and /proc/sys/fs/suid_dumpable doesn't do the trick.

Thanks!
 
For those interested:

Solved by modifying `target.mak` to add DEBUG=y (and GDB=y if you are interested in working with the core file afterwards) under the respective device section.

After system boots up:
echo /tmp/core > /proc/sys/kernel/core_pattern
echo 1 > /proc/sys/kernel/core_uses_pid
echo 2 > /proc/sys/fs/suid_dumpable

Will figure out how to make it persistent over reboots.
 
For those interested:

Solved by modifying `target.mak` to add DEBUG=y (and GDB=y if you are interested in working with the core file afterwards) under the respective device section.

After system boots up:
echo /tmp/core > /proc/sys/kernel/core_pattern
echo 1 > /proc/sys/kernel/core_uses_pid
echo 2 > /proc/sys/fs/suid_dumpable

Will figure out how to make it persistent over reboots.

Do it using an init-start user script.
 
I've added this to the `/jfffs/scripts/init-start`. What gives me trouble is `ulimit -c unlimited` as it seems to be shell specific. Is there a way to set this system-wide?
 
I've added this to the `/jfffs/scripts/init-start`. What gives me trouble is `ulimit -c unlimited` as it seems to be shell specific. Is there a way to set this system-wide?

I thought it was user-specific, not shell specific.

You could also try inserting it in the user profile, but not sure it will apply to services started by rc at boot time.
 
Well tell me if I test it wrong, but ssh-ing into the box, setting `ulimit -c unlimited`, disconnecting, and reconnecting again has ulimit -c back to 0. Forks do inherit parent's setting, though.
 
Well tell me if I test it wrong, but ssh-ing into the box, setting `ulimit -c unlimited`, disconnecting, and reconnecting again has ulimit -c back to 0. Forks do inherit parent's setting, though.

I never played with ulimit so I wouldn't know for sure. Just going with what I could find as documentation through an online search.

It's possible it's not persistent because the router has a rather limited Linux environment, unlike a full distro that has, for example, the /etc/security/limits file.
 
Right. I've found a solution in cases where one can insert a piece of code into the source: use setrlimit(). It also needs to be run with elevated privileges.
 
Right. I've found a solution in cases where one can insert a piece of code into the source: use setrlimit(). It also needs to be run with elevated privileges.

If the program is launched by the firmware, you could use a wrapper script to launch the process.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top