Markus Kuhn writes:

> I believe that somewhere between main() is started and tgetent() is
> called, an xterm bug causes a static variable of libtermcap to be
> overwritten. How do I find whether and where this happens, if it happens
> only when I use the Red Hat precompiled shared-library version of
> libtermcap without debugging info? In other words, I don't even have the
> address of is_malloc to watch it.

Here is how I'd do it:
- Become root; you can't debug setuid/setgid executables without being
  root.
- Retrieve the patched source from RedHat CDs or their ftp server.
- gdb xterm
  (gdb) disassemble tgetent
  This should tell you the address of the is_malloced variable.
- Now set a hardware watchpoint on this address.
  (gdb) break main
  (gdb) run
  (gdb) watch *(int*) 0xAddress_of_is_malloced
  (gdb) continue

Bruno
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/

Reply via email to