0

I am working on embedded Linux with busybox version. For generating linux core dumps, I use

ulimit -c unlimited

Then I see that I am getting a huge core file (~1GB). Because my application is huge and allocates that much amount of memory.

Now, I am looking for solutions to optimize this large core file. I found out that (http://man7.org/linux/man-pages/man5/core.5.html) I can pipe core dumps to a program. I am trying to zip the core dump while it is getting generated.

i.e

 cat /proc/sys/kernel/core_pattern

| /tmp/shellscript.sh  /tmp/core.%p.gz

cat  /tmp/shellscript.sh
#!/bin/sh
/bin/gzip > "$1"

Now, I realize that 'piping core dump to a program' works only on normal desktop ubuntu system.

But our target is embedded linux system which use busybox version. I am wondering when I do exactly the same steps 'piping core dump to a program (in this case zipping) ' on busybox then it doesn't produce a core dump at all.

But if I remove the piping option on busybox, then I see a core dump. i.e

root@(none):~ cat /proc/sys/kernel/core_pattern
/tmp/core_top

Do you guys here have any inputs why piping core dump to a program doesn't work on embedded linux with busybox version ?

Thanks,

migrated from stackoverflow.com Feb 3 '17 at 9:31

This question came from our site for professional and enthusiast programmers.

  • Even without space between (| and /) it doesn't produce zipped core file on busybox. I also checked that /tmp partition is executable. I tried to zip any other file in /tmp and it works. – truesppirit Feb 17 '17 at 10:34
0
man 5 core

   *  The program must be specified using an absolute pathname (or a
      pathname relative to the root directory, /), and must immediately
      follow the '|' character.

So, there should be no space between | and /.

Also, is your /tmp partition, where the script resides, perhaps mounted with -o noexec?

  • Even without space between (| and /) it doesn't produce zipped core file on busybox. I also checked that /tmp partition is executable. I tried to zip any other file in /tmp and it works. – Truespirit Feb 17 '17 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.