Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 212901 Details for
Bug 244162
utrace: Failing PTRACE_DETACH after ATTACH+CONT(SIGSTOP)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Parent/child testcase reproducing the current Rawhide GDB.
signalgdb.c (text/plain), 2.54 KB, created by
Jan Kratochvil
on 2007-10-01 21:40:22 UTC
(
hide
)
Description:
Parent/child testcase reproducing the current Rawhide GDB.
Filename:
MIME Type:
Creator:
Jan Kratochvil
Created:
2007-10-01 21:40:22 UTC
Size:
2.54 KB
patch
obsolete
>/* This testcase is part of GDB, the GNU debugger. > > Copyright 2007 Free Software Foundation, Inc. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ > >#define _GNU_SOURCE >#include <signal.h> >#include <unistd.h> >#include <string.h> >#include <stdio.h> >#include <stdlib.h> >#include <errno.h> >#include <sys/wait.h> >#include <sys/ptrace.h> >#include <assert.h> >#include <fcntl.h> > >#include <asm/unistd.h> >#include <unistd.h> >#define tkill(tid, sig) syscall (__NR_tkill, (tid), (sig)) > >static pid_t child; > >static void cleanup (void) >{ > if (child != 0) > kill (child, SIGKILL); >} > >static void handler (int signo) >{ > cleanup (); > > signal (signo, SIG_DFL); > abort (); >} > >int main (void) >{ > void (*handler_orig) (int signo); > unsigned long n; > long l; > int i; > > setbuf (stdout, NULL); > atexit (cleanup); > handler_orig = signal (SIGABRT, handler); > assert (handler_orig == SIG_DFL); > handler_orig = signal (SIGINT, handler); > assert (handler_orig == SIG_DFL); > > child = fork (); > switch (child) > { > case -1: > abort (); > case 0: > i = raise (SIGSTOP); > assert (i == 0); > > abort (); > /* NOTREACHED */ > default: > break; > } > > for (n = 0 ;; n++) > { > pid_t got_pid; > int status; > > l = ptrace (PTRACE_ATTACH, child, NULL, NULL); > assert (l == 0); > > i = tkill (child, SIGCONT); > assert (i == 0); > > got_pid = waitpid (child, &status, 0); > assert (got_pid == child); > assert (WIFSTOPPED (status)); > assert (WSTOPSIG (status) == SIGCONT); > > i = tkill (child, SIGSTOP); > assert (i == 0); > > l = ptrace (PTRACE_CONT, child, NULL, NULL); > assert (l == 0); > > got_pid = waitpid (child, &status, 0); > assert (got_pid == child); > assert (WIFSTOPPED (status)); > assert (WSTOPSIG (status) == SIGSTOP); > > l = ptrace (PTRACE_DETACH, child, NULL, (void *) (unsigned long) SIGSTOP); > assert (l == 0); > } > /* NOTREACHED */ >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 244162
:
156968
|
156970
|
156975
|
157288
|
212881
|
212891
| 212901