Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 434404 - sys-devel/gdb-7.5 - with PaX enabled, ./common/linux-ptrace.c:117: internal-error: linux_ptrace_test_ret_to_nx: Assertion `WIFSTOPPED (status)' failed.
Summary: sys-devel/gdb-7.5 - with PaX enabled, ./common/linux-ptrace.c:117: internal-e...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 452658 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-09 08:43 UTC by Anton Kochkov
Modified: 2013-01-20 13:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kochkov 2012-09-09 08:43:22 UTC
Here is full session log:

┌─[ xvilka@XLaptop ] [ 4:08:44 ] ~ 
└>gdb gdb
GNU gdb (Gentoo 7.5 p1) 7.5
Copyright (C) 2012 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 "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/gdb...(no debugging symbols found)...done.
(gdb) run elinks
Starting program: /usr/bin/gdb elinks
./common/linux-ptrace.c:117: internal-error: linux_ptrace_test_ret_to_nx:
Assertion `WIFSTOPPED (status)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
./common/linux-ptrace.c:117: internal-error: linux_ptrace_test_ret_to_nx:
Assertion `WIFSTOPPED (status)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) N
(gdb) n
Cannot execute this command while the selected thread is running.
(gdb) q
A debugging session is active.

    Inferior 1 [process 4439] will be killed.

Quit anyway? (y or n) y

Here is uname:
Linux XLaptop 3.5.1-hardened #1 PREEMPT Sun Aug 12 16:29:19 MSK 2012 i686
Intel(R) Celeron(R) CPU 743 @ 1.30GHz GenuineIntel GNU/Linux

Here is part of dmesg (PaX) error:

[2396058.354252] PAX: execution attempt in: <anonymous mapping>,
aa1d2000-aa1d5000 aa1d2000
[2396058.354259] PAX: terminating task: /usr/bin/gdb(gdb):15808, uid/euid:
1000/1000, PC: aa1d2000, SP: bb6d5690
[2396058.354262] PAX: bytes at PC: cc 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 
[2396058.354276] PAX: bytes at SP-4: aa1d2000 00000000 00000000 00000000
00000000 ffffffff 00000000 00000000 176cba91 00004200 00003dbd 00000000
0000003f 00003dbd 
00003dbd 00000000 cc6c4300 00003dbd 00003dbd 00000000 186d46f4 
[2396058.354319] grsec: denied resource overstep by requesting 4096 for
RLIMIT_CORE against limit 0 for /usr/bin/gdb[gdb:15808] uid/euid:1000/1000 
gid/egid:1000/1000, parent /usr/bin/gdb[gdb:15802] uid/euid:1000/1000
gid/egid:1000/1000
[2400796.221781] PAX: execution attempt in: <anonymous mapping>,
a486b000-a486e000 a486b000
[2400796.221789] PAX: terminating task: /usr/bin/gdb(gdb):4442, uid/euid:
1000/1000, PC: a486b000, SP: b4bb9440
[2400796.221792] PAX: bytes at PC: cc 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 
[2400796.221807] PAX: bytes at SP-4: a486b000 00000000 00000000 00000000
00000000 ffffffff 00000000 00000000 16505a91 00004200 00001157 00000000
0000003f 00001157 
00001157 00000000 4742b000 00001157 00001157 00000000 1750e6f4 
[2400796.221846] grsec: denied resource overstep by requesting 4096 for
RLIMIT_CORE against limit 0 for /usr/bin/gdb[gdb:4442] uid/euid:1000/1000 
gid/egid:1000/1000, parent /usr/bin/gdb[gdb:4437] uid/euid:1000/1000
gid/egid:1000/1000

version 7.4 works well, without this bug.

Here is upstream bug http://sourceware.org/bugzilla/show_bug.cgi?id=14564
Comment 1 Anton Kochkov 2012-09-09 14:11:50 UTC
After applying this patch http://sourceware.org/bugzilla/attachment.cgi?id=6630&action=diff
I got this output:

┌─[ xvilka@XLaptop ] [12:09:19 ] ~/gdb-bug 
└>gdb `which elinks`
GNU gdb (Gentoo 7.5 p1) 7.5
Copyright (C) 2012 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 "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/elinks...(no debugging symbols found)...done.
(gdb) run http://google.com
Starting program: /usr/bin/elinks http://google.com
warning: linux_ptrace_test_ret_to_nx: Cannot PTRACE_KILL: No such process
warning: Cannot call inferior functions, Linux kernel PaX protection forbids
return to non-executable pages!
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0xa9249d93 in GC_is_black_listed () from /usr/lib/libgc.so.1
(gdb)
Comment 2 Anton Kochkov 2012-09-09 14:38:28 UTC
Ok, with this patch http://sourceware.org/bugzilla/attachment.cgi?id=6631&action=edit it works

┌─[ xvilka@XLaptop ] [12:09:19 ] ~/gdb-bug 
└>gdb `which elinks`
GNU gdb (Gentoo 7.5 p1) 7.5
Copyright (C) 2012 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 "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/elinks...(no debugging symbols found)...done.
(gdb) run http://google.com
Starting program: /usr/bin/elinks http://google.com
warning: Cannot call inferior functions, Linux kernel PaX protection forbids
return to non-executable pages!
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x9d11ed93 in GC_is_black_listed () from /usr/lib/libgc.so.1
(gdb)
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-09-09 16:56:50 UTC
Where did you find a 7.5_p1 ebuild?
Comment 4 Anton Kochkov 2012-09-09 17:33:07 UTC
(In reply to comment #3)
> Where did you find a 7.5_p1 ebuild?

It is gdb-7.5.ebuild
Comment 5 SpanKY gentoo-dev 2012-09-10 05:05:39 UTC
we're not going to do anything until a change has been merged upstream
Comment 6 SpanKY gentoo-dev 2013-01-17 16:07:04 UTC
*** Bug 452658 has been marked as a duplicate of this bug. ***
Comment 7 SpanKY gentoo-dev 2013-01-17 16:07:28 UTC
fix should be in 7.5.1
Comment 8 Agostino Sarubbo gentoo-dev 2013-01-20 13:48:28 UTC
(In reply to comment #7)
> fix should be in 7.5.1

is fine to stabilize it?