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 148611 Details for
Bug 194570
PPC rt_sigreturn does not restore context after interrupted syscall
[?]
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.
modified test case
syscallInterrupt.c (text/x-csrc), 2.49 KB, created by
Archana K. Raghavan
on 2007-02-22 19:17:00 UTC
(
hide
)
Description:
modified test case
Filename:
MIME Type:
Creator:
Archana K. Raghavan
Created:
2007-02-22 19:17:00 UTC
Size:
2.49 KB
patch
obsolete
>#include <unistd.h> >#include <stdio.h> >#include <errno.h> >#include <string.h> >#include <signal.h> >#include <sys/types.h> >#include <stdlib.h> >#include <ucontext.h> > >void segHandler(int signo, siginfo_t* info, void* arg) >{ > printf("In segv handler, this is the context that received the SIGSEGV:\n"); > > struct ucontext* ctx = (struct ucontext*)arg; > > printf("IP: 0x%x\n", ctx->uc_mcontext.regs->nip); > > int i; > for (i=0; i < 32; i++) > { > printf("r%d: 0x%x\n", i, (((struct pt_regs*)((&ctx->uc_mcontext))->regs))->gpr[i]); > } > > exit(0); >} > > >void alarmHandler(int signo, siginfo_t* info, void* arg) >{ > printf("alarmHandler: setting regs 13-31 to 0xdeadbeef in the context\n"); > > struct ucontext* ctx = (struct ucontext*)arg; > > int i; > for (i=0; i < 32; i++) > { > if(i > 13) > { > (((struct pt_regs*)((&ctx->uc_mcontext))->regs))->gpr[i] = 0xdeadbeef; > } > } > > printf("alarmHandler: loading r13-31 with bogus values and jumping to 0 to force SIGSEGV.\n"); > > ctx->uc_mcontext.regs->nip = 0; > >#ifdef USE_SETCONTEXT > setcontext(ctx); > printf("Should not reach this point\n"); >#endif > > asm volatile("li %r14, 0x1414"); > asm volatile("li %r15, 0x1515"); > asm volatile("li %r16, 0x1616"); > asm volatile("li %r17, 0x1717"); > asm volatile("li %r18, 0x1818"); > asm volatile("li %r19, 0x1919"); > asm volatile("li %r20, 0x2020"); > asm volatile("li %r21, 0x2121"); > asm volatile("li %r22, 0x2222"); > asm volatile("li %r23, 0x2323"); > asm volatile("li %r24, 0x2424"); > asm volatile("li %r25, 0x2525"); > asm volatile("li %r26, 0x2626"); > asm volatile("li %r27, 0x2727"); > asm volatile("li %r28, 0x2828"); > asm volatile("li %r29, 0x2929"); > asm volatile("li %r30, 0x3030"); > asm volatile("li %r31, 0x3131"); >} > > >int main() >{ > /* Register a handler for SIGALRM */ > struct sigaction sa; > memset(&sa,0,sizeof(sa)); > sa.sa_sigaction = alarmHandler; > sa.sa_flags = SA_SIGINFO; > > if(sigaction(SIGALRM,&sa, 0)) > { > printf("Unable to register alarm handler.\n"); > exit(1); > } > > /* Register a handler for SIGSEGV */ > struct sigaction sa2; > memset(&sa2,0,sizeof(sa2)); > sa2.sa_sigaction = segHandler; > sa2.sa_flags = SA_SIGINFO; > if(sigaction(SIGSEGV,&sa2, 0)) > { > printf("Unable to register seg handler.\n"); > exit(1); > } > >#ifdef RAISE > printf("Calling raise(SIGALRM)\n"); > raise(SIGALRM); >#else > printf("Setting up an alarm signal to arrive in 1s.\n"); > alarm(1); > printf("Starting a read syscall that will block and get interrupted.\n"); > char buf[1000]; > read(0,buf,1000); >#endif >}
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 194570
:
130802
|
144549
|
144550
|
148610
| 148611