3

I have a program which is aborting and I want to view a core dump. I am using addresssanitizer which is causing the abort when it hits a heap overflow. I have done the following:

sudo sysctl -w kernel.core_pattern=core.%u.%p.%t
ulimit -c unlimited
sudo vim /etc/apport/crashdb.conf

and commented out

'problem_types': ['Bug', 'Package'],

Then ran:

systemctl enable apport.service

However, when my program crashes, there is NO core file in the directory where the program ran, or in /var/crash/ or in /var/lib/systemd/coredump

I am on Ubuntu 18.04.

Alexis Wilke
  • 2,707
  • Have you tried to run your software in gdb? Because at the time it crashes, gdb should catch it and stop it immediately, then you can check the environment from there. – Alexis Wilke May 11 '20 at 05:18
  • @AlexisWilke yes I have, unfortunately because addressSanitizer aborts the process, I have no live way to view the memory before the process exits, which is why I'm looking for a core dump file. – the_endian May 11 '20 at 06:58
  • Hmmm... when I used the addressSanitizer feature, it would write its status in my console. But if it's a blunt crash, maybe it is not capable of doing so. An OOM would generate such a problem and that feature uses quite a bit of memory! – Alexis Wilke May 11 '20 at 17:40
  • 1
    @AlexisWilke it looks like I needed to set export ASAN_OPTIONS=abort_on_error=1 before running the program for ASAN to attempt to coredump. Note, this is NOT related to my question above though (that issue is still not solved). – the_endian May 11 '20 at 19:55
  • Yeah, it may detect a file size that's too large and still skip on saving the core dump. If I recall properly, it allocates 256Gb of space (not RAM, but address space) and the core dump may still have a hard coded limit which is much lower. – Alexis Wilke May 11 '20 at 21:27