Bug 284311

Summary: utrace: SA_RESETHAND fails on 1st PTRACE_CONT(sig)
Product: [Fedora] Fedora Reporter: Young-Ho, Cha <ganadist>
Component: kernelAssignee: Roland McGrath <roland>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: medium    
Version: 7CC: cebbert, jan.kratochvil
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.6.22.7-85.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-25 22:33:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 309551    
Attachments:
Description Flags
Simplified testcase. none

Description Young-Ho, Cha 2007-09-10 06:24:28 UTC
Description of problem:
Program terminated in gdb when receive signal.


Version-Release number of selected component (if applicable):
gdb-6.6-15.fc7rh

How reproducible:
I uploaded sample program at http://ftp.mizi.com/~ganadist/pipetest.tgz and
build it first.

and run with gdb


Steps to Reproduce:
1. run gdb with sample program
2.
3.
  
Actual results:
$ gdb ./pipe
GNU gdb Red Hat Linux (6.6-15.fc7rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x80488de: file pipe.c, line 34.
(gdb) r
Starting program: /home/megamino/cvs/prizm/wipi/wipi_lgtel/src/test/pipe

Breakpoint 1, main () at pipe.c:34
34          pipe(p);
(gdb) n
35          io_init();
(gdb)
36          io_register(p[0], pipe_read_cb, &p);
(gdb)
37          char * m = "helloworld";
(gdb)
38          write(p[1], m, 11);
(gdb)

Program terminated with signal SIGIO, I/O possible.
The program no longer exists.

Expected results:
$ gdb ./pipe 
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x804893e: file pipe.c, line 34.
(gdb) r
Starting program: /home/ganadist/cvs/ganadist/unixsocket/pipe 

Breakpoint 1, main () at pipe.c:34
34          pipe(p);
(gdb) n
35          io_init();
(gdb) 
36          io_register(p[0], pipe_read_cb, &p);
(gdb) 
37          char * m = "helloworld";
(gdb) 
38          write(p[1], m, 11);
(gdb) 
fd: 6, code: 1
68656c
callback completed
41              sleep(1);

Additional info:
I tested this problem in Fedora Core 7, Gentoo (linux 2.6.23-rc4, gdb 6.6) and
Ubuntu gutsy(linux -2.6.22-11-generic gdb 6.6-debian). but It occur in Fedora
core 7 only

Comment 1 Young-Ho, Cha 2007-09-10 07:44:20 UTC
It seems an issue related with kernel ptrace compatibility.





Comment 2 Jan Kratochvil 2007-09-10 21:48:04 UTC
Problem has been verified on:
kernel-2.6.22.4-65.fc7.x86_64
kernel-2.6.23-0.170.rc5.git1.fc8.x86_64
Problem is not present in upstream:
kernel.org 2.6.22-rc4-git7.x86_64


Comment 3 Jan Kratochvil 2007-09-10 21:49:14 UTC
Created attachment 192121 [details]
Simplified testcase.

Thanks for the bugreport.

Comment 4 Roland McGrath 2007-09-12 00:20:01 UTC
I have a fix in now that should show up in the next rawhide and f7 update kernel
builds.

Comment 5 Chuck Ebbert 2007-09-14 18:58:40 UTC
In kernel 2.6.22.6-81.fc7, submitted for testing.

Comment 6 Jan Kratochvil 2007-09-17 21:50:34 UTC
FYI it is not fixed in:
kernel-2.6.23-0.171.rc5.git1.fc8.x86_64


Comment 7 Chuck Ebbert 2007-09-17 22:08:43 UTC
(In reply to comment #6)
> FYI it is not fixed in:
> kernel-2.6.23-0.171.rc5.git1.fc8.x86_64
> 

That kernel is 12 days old...