Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Maule Mark <mark_maule@yahoo.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: debugging link_map corruption
Date: Wed, 04 Jun 2014 13:36:00 -0000	[thread overview]
Message-ID: <1401888987.45670.YahooMailNeo@web165002.mail.bf1.yahoo.com> (raw)

Tried this on libc-help, no response, so trying gdb ...

I have a heavily threaded program linked against many (~50) shared libraries which occasionally experiences memory corruption such that the link_map list gets trashed rendering the core mostly undebuggable.  I'm looking for ways to debug these sorts of problems.  My operating environment is Linux.

One idea I am experimenting with is to create an audit library which saves the publicly available link_map (the one exposed through /usr/include/link.h on Linux) list to a write-protected area upon receipt of a LA_ACT_CONSISTENT activity callback.  The thinking is that if gdb can't follow the link_map from the core, at least I would be able to manually load the .so's at their correct addresses from gdb when debugging the 'corrupt' core.  In my current implementation, the audit library has a simple 8k buffer which it uses to store the public link_map structs in.

The problem I'm having with the above, is that I can't figure out how to expose information about the address of the audit library's link_map buffer to gdb when debugging the core.  I could issue a fprintf from my audit library to save that information in a file, but it would be much better if I could just figure that out with gdb.  I assume the issue is that the audit library symbols are in a separate namespace.

Anyway, I'm looking for guidance on how to gain access to audit library symbols from gdb when examining a program core.  Additionally, if there are better ideas for how to attack the problem of corrupt link_map lists in general, I'd appreciate those as well.

Thanks
Mark Maule


             reply	other threads:[~2014-06-04 13:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 13:36 Maule Mark [this message]
2014-06-04 20:21 ` Philippe Waroquiers
2014-06-04 20:46   ` Maule Mark
2014-06-04 21:00     ` Philippe Waroquiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401888987.45670.YahooMailNeo@web165002.mail.bf1.yahoo.com \
    --to=mark_maule@yahoo.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox