Announcement

Collapse
No announcement yet.

Core/Crash Dumps and Debugging? How to make it (not) work?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Core/Crash Dumps and Debugging? How to make it (not) work?

    Kubuntu 22.04

    I'm fiddling about with basic C programming to learn Linux system calls. I am using gcc to compile. I am trying to deliberately generate some core/crash dumps in order to learn how to debug with them. Problem is I can't actually generate core dumps. I've tried ulimit -c unlimited, I've enabled core dumps in apparmor, installed and configured kdump according to the docs.


    And I get absolutely NOTHING. Not even so much as an error message.

    How do I make Kubuntu generate core dumps and then find them afterwards?


    Should I use some other distro for this?

    #2
    Ubuntu these days sets up apport to handle core dumps. (see /proc/sys/kernel/core_pattern). In my 23.04 they've gone to /var/lib/apport/coredump, though I don't know what magic is required to persuade apport to actually write things there.

    Simplest might be to edit /proc/sys/kernel/core_pattern to have a single word, say "my_core". Again, I'm not sure what's required, perhaps some group membership.

    Installing systemd-coredump​ might be a more modern approach, but I haven't tried it.
    Regards, John Little

    Comment


      #3
      Maybe https://askubuntu.com/questions/9664...109747#1109747 (see 31)
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Seems like modern Debian robustly prevents core dumps. Neither Kubuntu nor Kali generate them (that I can see) no matter how many hacks I shove down their throats.

        There might be something to Jlittle's suggestion of systemd-coredump.

        I'm going to drop these two links from Suse here for later.

        https://www.suse.com/support/kb/doc/?id=000015982


        https://www.suse.com/support/kb/doc/?id=000018634

        Comment


          #5
          For future reference:

          /etc/systemd/systemd.conf

          try uncommenting:

          #DumpCore=yes

          Comment

          Working...
          X