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 148952 Details for
Bug 230423
ptrace causing SIGSEGV in debugged process when sending SIGKILL to it.
[?]
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.
A test c program that demonstrates the bug.
ptraceTest.c (text/plain), 1.02 KB, created by
Kevin Van Brunt
on 2007-02-28 19:41:19 UTC
(
hide
)
Description:
A test c program that demonstrates the bug.
Filename:
MIME Type:
Creator:
Kevin Van Brunt
Created:
2007-02-28 19:41:19 UTC
Size:
1.02 KB
patch
obsolete
>#include <sys/ptrace.h> >#include <stdio.h> >#include <sys/wait.h> >#include <errno.h> > >int main() >{ > char* args[2] = {"/bin/ls", 0}; > pid_t pid = 0; > int waitVal = 0; > > switch (pid = fork()) > { > case -1: > perror("Error forking"); > break; > > case 0: > ptrace(PTRACE_TRACEME, 0, 0, 0); > execv(args[0], args); > break; > > default: > break; > } > > while (1) > { > // Wait for signal > pid_t signaledTid = waitpid(-1, &waitVal, WUNTRACED | __WALL); > > // Error occurred with waitpid > if (signaledTid == -1) > { > // No more children for this process. Stop debugging > if (errno == ECHILD) > { > break; > } > > else > { > continue; > } > } > > // This signal is not stopping the process > if (!WIFSTOPPED(waitVal)) > { > continue; > } > > // Figure out what signal stopped the process > int sigVal = WSTOPSIG(waitVal); > > switch (sigVal) > { > case SIGSEGV: > printf("GOT SIGSEGV\n"); > break; > } > > // Sending SIGKILL to traced program > kill(signaledTid, SIGKILL); > > ptrace(PTRACE_CONT, signaledTid, 0, sigVal); > } > > return 0; >}
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 230423
: 148952