NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/51636: It's not possible to run under gdb(1) programs using the pthread_dbg library



>Number:         51636
>Category:       lib
>Synopsis:       It's not possible to run under gdb(1) programs using the pthread_dbg library
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 19 18:25:00 +0000 2016
>Originator:     Kamil Rytarowski
>Release:        NetBSD 7.99.42 amd64
>Organization:
TNF
>Environment:
NetBSD chieftec 7.99.42 NetBSD 7.99.42 (GENERIC) #0: Sat Nov 19 18:46:35 CET 2016  root@chieftec:/tmp/netbsd-tmp/sys/arch/amd64/compile/GENERIC amd64
>Description:
Currently the pthread_dbg library cannot be debugged with gdb(1). GDB is a user of this library to handle POSIX threads, it sets pthread__dbg to pid of the debugger and this value is adopted by application - so programs get impression that instance is already attached to an application.

As the result it's not possible to run under gdb(1) programs using the pthread_dbg library
>How-To-Repeat:
$ pwd
/usr/tests/lib/libpthread_dbg
$ atf-run t_dummy |atf-report                                                                                                                       
Tests root: /usr/tests/lib/libpthread_dbg

t_dummy (1/1): 3 test cases
    dummy1: [0.002789s] Passed.
    dummy2: [0.001216s] Passed.
    dummy3: [0.001201s] Passed.
[0.005399s]

Summary for 1 test programs:
    3 passed test cases.
    0 failed test cases.
    0 expected failed test cases.
    0 skipped test cases.
$ ./t_dummy dummy3             
t_dummy: WARNING: Running test cases without atf-run(1) is unsupported
t_dummy: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)
Calling td_open(3) for the first time - expecting success
Calling td_open(3) for the first time - expecting in-use
Calling td_close(3) for the first successful call
passed
$ gdb --args ./t_dummy dummy3
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./t_dummy...Reading symbols from /usr/libdata/debug//usr/tests/lib/libpthread_dbg/t_dummy.debug...done.
done.
(gdb) r
Starting program: /usr/tests/lib/libpthread_dbg/t_dummy dummy3
t_dummy: WARNING: Running test cases without atf-run(1) is unsupported
t_dummy: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)
Calling td_open(3) for the first time - expecting success
failed: /usr/src/tests/lib/libpthread_dbg/t_dummy.c:113: td_open(&dummy_callbacks, NULL, &main_ta1) == TD_ERR_OK not met
[Inferior 1 (LWP 0) exited with code 01]
(gdb)
>Fix:
N/A



Home | Main Index | Thread Index | Old Index