[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shrinking "assert (X)" and "abort ()"
From: |
Bruce Korb |
Subject: |
Re: shrinking "assert (X)" and "abort ()" |
Date: |
Fri, 06 May 2011 12:22:16 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8 |
On 05/06/11 11:03, Bruno Haible wrote:
as this is good enough if you have a debugger
Honestly, I think this would be a misfeature.
I completely agree, but without any conditions.
The problem is that most distros nowadays disable core dumps.
So you don't get a message and you don't get a core dump.
It just falls over. Ick.
I'm sure that with enough effort that I certainly don't have
time for, you could write a "message-and-then-abort" function
that could pull a message out of a hat (er, "ELF section"),
print it and then try to trigger and enable a core:
struct rlimit rlim;
getrlimit(RLIMIT_CORE, &rlim);
rlim.rlim_cur = rlim.rlim_max;
setrlimit(RLIMIT_CORE, &rlim);