]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-core-open-vdso-warning.patch
- updated to 7.2 with fedora patchset w/o rhel compat fixes.
[packages/gdb.git] / gdb-core-open-vdso-warning.patch
1 http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
2 Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map:  Input/output error.
3
4 Hi,
5
6 GDB currently always prints on loading a core file:
7         warning: Can't read pathname for load map: Input/output error.
8
9 The patch is not nice but it was WONTFIXed on the glibc side in:
10         http://sourceware.org/ml/libc-alpha/2009-10/msg00001.html
11
12 The same message in GDB PR 8882 and glibc PR 387 was for ld-linux.so.2 l_name
13 but that one is now ignored thanks to IGNORE_FIRST_LINK_MAP_ENTRY.
14
15 This fix is intended for Linux system vDSO l_name which is a second entry in
16 the DSO list.
17
18 Regression tested on {x86_86,x86_64-m32,i686}-fedora11-linux-gnu.
19
20
21 Thanks,
22 Jan
23
24
25 gdb/
26 2009-10-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
27
28         Do not print false warning on reading core file with vDSO on GNU/Linux.
29         * solib-svr4.c (svr4_current_sos): Suppress the warning if
30         MASTER_SO_LIST is still NULL.
31         * solib.c (update_solib_list): New variable saved_so_list_head.
32         Conditionally restart the function.
33
34 [ Context backport.  ]
35
36 Index: gdb-7.1.90.20100711/gdb/solib-svr4.c
37 ===================================================================
38 --- gdb-7.1.90.20100711.orig/gdb/solib-svr4.c   2010-07-12 23:07:35.000000000 +0200
39 +++ gdb-7.1.90.20100711/gdb/solib-svr4.c        2010-07-13 00:19:03.000000000 +0200
40 @@ -1177,8 +1177,18 @@ svr4_current_sos (void)
41           target_read_string (LM_NAME (new), &buffer,
42                               SO_NAME_MAX_PATH_SIZE - 1, &errcode);
43           if (errcode != 0)
44 -           warning (_("Can't read pathname for load map: %s."),
45 -                    safe_strerror (errcode));
46 +           {
47 +             /* During the first ever DSO list reading some strings may be
48 +                unreadable as residing in the ld.so readonly memory not being
49 +                present in a dumped core file.  Delay the error check after
50 +                the first pass of DSO list scanning when ld.so should be
51 +                already mapped in and all the DSO list l_name memory gets
52 +                readable.  */
53 +
54 +             if (master_so_list () != NULL)
55 +               warning (_("Can't read pathname for load map: %s."),
56 +                        safe_strerror (errcode));
57 +           }
58           else
59             {
60               struct build_id *build_id;
61 Index: gdb-7.1.90.20100711/gdb/solib.c
62 ===================================================================
63 --- gdb-7.1.90.20100711.orig/gdb/solib.c        2010-05-17 01:49:58.000000000 +0200
64 +++ gdb-7.1.90.20100711/gdb/solib.c     2010-07-13 00:21:01.000000000 +0200
65 @@ -705,6 +705,7 @@ update_solib_list (int from_tty, struct 
66    struct target_so_ops *ops = solib_ops (target_gdbarch);
67    struct so_list *inferior = ops->current_sos();
68    struct so_list *gdb, **gdb_link;
69 +  struct so_list *saved_so_list_head = so_list_head;
70  
71    /* We can reach here due to changing solib-search-path or the
72       sysroot, before having any inferior.  */
73 @@ -844,6 +845,12 @@ Error while mapping shared library secti
74           observer_notify_solib_loaded (i);
75         }
76  
77 +      /* If this was the very first DSO list scan and we possibly read in ld.so
78 +        recheck all the formerly unreadable DSO names strings.  */
79 +
80 +      if (saved_so_list_head == NULL && so_list_head != NULL)
81 +       return update_solib_list (from_tty, target);
82 +
83        /* If a library was not found, issue an appropriate warning
84          message.  We have to use a single call to warning in case the
85          front end does something special with warnings, e.g., pop up
This page took 0.029811 seconds and 4 git commands to generate.