Additional PR 8882 fix.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 27 Feb 2014 20:16:04 +0000 (21:16 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 27 Feb 2014 20:16:04 +0000 (21:16 +0100)
commitc91550fc5d8dae5f1140bca649690fa13e5276e9
tree97a26187a90a4c55eb3a0b71683a2e68b31ca1d7
parentf17c8bfcc87ba90d55a0fecfb8f7a9933b883457
Additional PR 8882 fix.

runtest gdb.base/corefile.exp

==23174== ERROR: AddressSanitizer: heap-use-after-free on address 0x604400008c88 at pc 0x68f0be bp 0x7fffae9d7490 sp
0x7fffae9d7480
READ of size 8 at 0x604400008c88 thread T0
    #0 0x68f0bd in svr4_read_so_list (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x68f0bd)
    #1 0x68f64e in svr4_current_sos_direct (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x68f64e)
    #2 0x68f757 in svr4_current_sos (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x68f757)
    #3 0xcebbff in update_solib_list (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0xcebbff)
0x604400008c88 is located 8 bytes inside of 1104-byte region [0x604400008c80,0x6044000090d0)
freed by thread T0 here:
    #0 0x7f52677500f9 (/lib64/libasan.so.0+0x160f9)
    #1 0xd2c68a in xfree (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0xd2c68a)
    #2 0xceb364 in free_so (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0xceb364)
    #3 0xca59f8 in do_free_so (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0xca59f8)
    #4 0x93432a in do_my_cleanups (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x93432a)
    #5 0x934406 in do_cleanups (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x934406)
    #6 0x68efa9 in svr4_read_so_list (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x68efa9)

I did not notice it during my review in:
Re: [PATCH v2] Skip vDSO when reading SO list (PR 8882)
https://sourceware.org/ml/gdb-patches/2013-09/msg00888.html

gdb/
2014-02-27  Jan Kratochvil  <jan.kratochvil@redhat.com>

Additional PR 8882 fix.
* solib-svr4.c (svr4_read_so_list): Change first to first_l_name.

Message-ID: <20140226220918.GA10431@host2.jankratochvil.net>
gdb/ChangeLog
gdb/solib-svr4.c