This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Disabling Consistency Checks


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]