Re: Pan crashing in libgnuregex after -pthread switchover

From: Jason Andresen <jandrese_at_mitre.org>
Date: Thu, 18 Mar 2004 10:43:44 -0500
Peter Edwards wrote:

> My understanding is that the dynamic linker fills a link_map (see 
> sys/link_elf.h) structure with the mapped name, and gdb grovels for this 
> in the core: it should work correctly on a corefile. Sounds more like 
> libpthread and libc_r are both in-process to me.
> 
> Jason, try "i sh" from gdb to see what libraries were loaded in the 
> process when it dumped.

Ok:

(gdb) i sh
 From        To          Syms Read   Shared Object Library
0x28196940  0x2819bf9c  Yes         /usr/local/lib/libintl.so.6
0x281a0680  0x281a5a98  Yes         /usr/X11R6/lib/libgtkspell.so.0
0x281d0bc0  0x2822cad8  Yes         /usr/local/lib/libaspell.so.15
0x2827b6c0  0x28412fb8  Yes         /usr/X11R6/lib/libgtk-x11-2.0.so.200
0x284a6fc0  0x284efb28  Yes         /usr/X11R6/lib/libgdk-x11-2.0.so.200
0x28503d00  0x285050ec  Yes         /usr/X11R6/lib/libXrandr.so.2
0x28508280  0x2850d47c  Yes         /usr/X11R6/lib/libXi.so.6
0x28514c00  0x2852286c  Yes         /usr/local/lib/libatk-1.0.so.400
0x2852b9e0  0x28537e38  Yes         /usr/X11R6/lib/libgdk_pixbuf-2.0.so.200
0x2853e400  0x2854cd4c  Yes         /lib/libm.so.2
0x28559940  0x28573abc  Yes         /usr/X11R6/lib/libpangoxft-1.0.so.200
0x28579880  0x28585cec  Yes         /usr/X11R6/lib/libXft.so.2
0x28595e80  0x285d75fc  Yes         /usr/local/lib/libfreetype.so.9
0x285f1780  0x285f9a5c  Yes         /lib/libz.so.2
0x285ff1c0  0x28603dbc  Yes         /usr/X11R6/lib/libXrender.so.1
0x28607740  0x286111ec  Yes         /usr/X11R6/lib/libXext.so.6
0x2861b0c0  0x2862ea9c  Yes         /usr/X11R6/lib/libfontconfig.so.1
0x2863dc40  0x2864444c  Yes         /usr/X11R6/lib/libpangox-1.0.so.200
0x28656a40  0x286c4a5c  Yes         /usr/X11R6/lib/libX11.so.6
0x28712b00  0x2872951c  Yes         /usr/X11R6/lib/libpango-1.0.so.200
0x287423c0  0x28766abc  Yes         /usr/local/lib/libgobject-2.0.so.200
0x2876fd00  0x28770f3c  Yes         /usr/local/lib/libgmodule-2.0.so.200
0x2877e640  0x287b7ddc  Yes         /usr/local/lib/libglib-2.0.so.200
0x287dc3c0  0x287ef4ac  Yes         /usr/local/lib/libiconv.so.3
0x288e6c40  0x2898e80c  Yes         /usr/local/lib/libxml2.so.5
0x289bfa80  0x289d811c  Yes         /usr/lib/libpthread.so.1
0x289e0300  0x289e193c  Yes         /usr/local/lib/libgthread-2.0.so.200
0x289e87c0  0x289f94ac  Yes         /usr/local/lib/libgnet-2.0.so.0
0x289fd980  0x28a038fc  Yes         /usr/lib/libgnuregex.so.2
0x28a22f80  0x28abcedc  Yes         /lib/libc.so.5
0x28b1db40  0x28b802cc  Yes         /usr/lib/libstdc++.so.4
0x28ba0f80  0x28bb5bac  Yes         /usr/local/lib/libexpat.so.5
0x28bbf7c0  0x28bc077c  Yes 
/usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2
0x28bc4140  0x28bc919c  Yes         /usr/X11R6/lib/libXcursor.so.1
0x28bcba00  0x28bcc10c  Yes 
/usr/X11R6/lib/pango/1.2.0/modules/pango-basic-xft.so
0x281653c0  0x2817b794  Yes         /libexec/ld-elf.so.1

libc_r doesn't show up at all in the libraries loaded list.  It doesn't 
appear to be a problem with having both libraries loaded.

> Interestingly, from the stack trace, frame 3 shows "re_search" calling 
> into the main application, not a shared library, at the "??" bit (the 
> instruction pointer is in the wrong range for a shared library): It 
> sounds like the application is implementing a function that should 
> probably be resolved from a shared library, and the linker is binding 
> the application version instead of the standard one: that might be an 
> issue.
> 
> (I don't think the regex library ever uses callbacks, which would be the 
> only other reason I can think it'd happen)
> 
> The sysutils/pstack has a good chance of finding the name of the "??" 
> function if you want to run that on the corefile: it takes the dynamic 
> exported functions into account as well as the debug information when 
> finding function names.

The pstack output is a complete mess:

(core file "pan.core"): /usr/X11R6/bin/pan
----------------- thread 0 -----------------
  0x0 ???????? (0, 2, 0, 8182e00, 81c9214, 81c9200)

----------------- thread 1 -----------------
  0x0 ???????? ()

----------------- thread 2 -----------------
  0x0 ???????? (0, 3, 0, 81c9000, 81c9414, 81c9400)

----------------- thread 3 -----------------
  0x0 ???????? (0, 4, 0, 81c9200, 81c9614, 81c9600)

----------------- thread 4 -----------------
  0x0 ???????? (0, 5, 0, 81c9400, 81c9814, 81c9800)
  0xd09ba115 ???????? (81d0000, 0, 0, 0, 0, 0)

----------------- thread 5 -----------------
  0x0 ???????? (0, 6, 0, 81c9600, 81c9a14, 81c9a00)
  0xd09ba115 ???????? (81d0400, 0, 0, 0, 0, 0)

----------------- thread 6 -----------------
  0x0 ???????? (0, 7, 0, 81c9800, 83d9814, 830a400)
  0xd09ba115 ???????? (81d0800, 0, 0, 0, 0, 0)

----------------- thread 7 -----------------
  0x0 ???????? (0, c, 0, af38200, 289da180, 0)
  0xd09ba115 ???????? (83ef000, 0, 0, 0, 0, 0)

----------------- thread 8 -----------------
  0x0 ???????? ()

----------------- thread 9 -----------------
  0x0 ???????? ()

----------------- thread 10 -----------------
  0x0 ???????? ()

----------------- thread 11 -----------------
  0x0 ???????? ()

----------------- thread 12 -----------------
  0x0 ???????? ()

----------------- thread -1 (running) -----------------
  0x289d6e9b ???????? (830a400, b, 83ef2e4, 289d1cb4, 4059b92e, 817b110)
  0x289d0ca7 ???????? (817c000, 817c034, 0, 28a05158, 0, 1)
  0x289cf7bb ???????? (817a390, 289d3714, 817a390, 0, 8181000, 0)
  0x830a400 ???????? (bfa439e8, 0, 0, bfa43a58, 1d, 0)
  0x28a00f26 re_search (bfa439e8, bfa43a58, 1d, 0, 1d, 0) + 56
  0x28a03746 regexec (8aa2220, bfa43a58, 0, 0, 0, 83190f0) + 106
  0x80ba7ca _init (92a18e0, 95aafc8, 3747d, 2879a167, 8183f3c, dd1f4) + 
5a74e
  0x80ba8a2 _init (95aaf9c, ef4e000, 3747d, 80ba6b0, 0, 80fb7fd) + 5a826
  0x80bac54 ensure_articles_scored (95aaf9c, 8bdc000, 3747d, 0, 95aaf9c, 
83e73a0) + 204
  0x806a6f4 _init (95aaf9c, 8bdc000, 3747d, 8236330, 81a8980, 830a448) + 
a678
  0x80d047c group_article_forall (95aaf9c, 806a640, 8236330, 289cca59, 
287da318, 83e73a0) + 8c
  0x806a891 _init (8236330, 83e73a0, 0, 0, 0, 0) + a815
  0x287abca1 g_thread_create_proxy (83e73a0, 0, 0, 202, 1, 289da47c) + 111
  0x289c3bfd ???????? (830a400, 287abb90, 83e73a0, 83ef010, 0, 0)
  0x28aa49b3 _ctx_start (0) + 3




-- 
   \  |_ _|__ __|_ \ __| Jason Andresen        jandrese_at_mitre.org
  |\/ |  |    |    / _|  Network and Distributed Systems Engineer
_|  _|___|  _| _|_\___| Office: 703-883-7755
Received on Thu Mar 18 2004 - 06:43:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:48 UTC