This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Disabling Consistency Checks
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Eric Neblock <c_eric at sbcglobal dot net>, libc-help at sourceware dot org
- Date: Tue, 02 Dec 2014 22:26:18 -0500
- Subject: Re: Disabling Consistency Checks
- Authentication-results: sourceware.org; auth=none
- References: <547DD236 dot 5040700 at sbcglobal dot net>
On 12/02/2014 09:52 AM, Eric Neblock wrote:
> Inconsistency detected by ld.so: ../elf/dl-runtime.c: 79: _dl_fixup:
> Assertion `((reloc->r_info) & 0xffffffff) == 7' failed!
This means you corrupted memory and the relocation for the PLT
slot is not a PLT relocation.
> Now, I'm sure this has to deal with altering another program's code
> section and there are obvious reasons why we don't want that to happen;
> however, is there a way that I can disable this check? Or (perhaps even
> better), what would be the correct way of having Program A stop Program
> B when a certain line of code is executed that doesn't involve preloading.
The check is there to tell you that you did something wrong. Disabling
the check will simply cause the code to fail. You have violated the
invariant for the code.
To have program A stop program B you need to attach to it using ptrace,
and then using the executable A and debug information determine where you
need to stop and write a breakpoint there. You have to do all of this
very carefully, like gdb does it.
> I want to avoid preloading, because right now I want to stop whenever a
> C program executes a malloc; however, tomorrow I may want to stop at a
> printf so I'm trying to make things as dynamic as possible.
You can use preloading to interpose any function an inferior (the program
being debugged) might call.
Cheers,
Carlos.