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 578300 Details for
Bug 810668
ptrace: GDB inferior calls with floats fail
[?]
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.
Better reproducer
fp2.c (text/plain), 1.66 KB, created by
Chuck Ebbert
on 2012-04-18 10:09:49 UTC
(
hide
)
Description:
Better reproducer
Filename:
MIME Type:
Creator:
Chuck Ebbert
Created:
2012-04-18 10:09:49 UTC
Size:
1.66 KB
patch
obsolete
>/* Make sure x86 ptrace(PTRACE_SETFPREGS) is working. > Tracer runs on cpu1, tracee on cpu0. >*/ >#define _GNU_SOURCE >#include <sched.h> >#include <unistd.h> >#include <assert.h> >#include <sys/wait.h> >#include <sys/procfs.h> >#include <sys/ptrace.h> > >#define LOOPS 12 >#define setaffinity(c) ({cpu_set_t _s; CPU_ZERO(&_s); CPU_SET((c), &_s); \ > sched_setaffinity(0, sizeof(cpu_set_t), &_s);}) > >int main(int argc, char **argv) >{ > pid_t child; > int i, j, status; > elf_fpregset_t fpregs; > __float80 two = 2.0; > > child = fork(); > assert(child != -1); > > if (child == 0) { > assert(!setaffinity(0)); > assert(!ptrace(PTRACE_TRACEME, 0, NULL, NULL)); > __asm__ __volatile__("fldz; fld1; fldt %0;" : : "m" (two)); /* stack: 0 1 2 <--top */ > > for (i = 0; i < LOOPS; i++) { > assert(!kill(getpid(), SIGSTOP)); > __asm__ __volatile__("fadd %st(2), %st;"); /* use FPU; do nothing */ > } > > __asm__ __volatile__("fstpt %0;" : "=m" (two)); > assert(two == 42.0); /* make sure child also sees 42 on stack top */ > > return 0; > } > >#define fpstack(n) (*(__float80 *)((char *)(&fpregs.st_space) + (n)*16)) > assert(!setaffinity(1)); /* needs two CPUs because tracer uses FPU */ > > for (j = 0; j < LOOPS+1; j++) { > waitpid(child, &status, 0); > if (WIFEXITED(status) || WIFSIGNALED(status)) > break; > > assert(!ptrace(PTRACE_GETFPREGS, child, NULL, &fpregs)); > assert(fpstack(1) == 1.0 && fpstack(2) == 0.0); > > if (j == LOOPS/2) { /* replace 2 on stack top with 42 */ > assert(fpstack(0) == two); > fpstack(0) = 42.0; > assert(!ptrace(PTRACE_SETFPREGS, child, NULL, &fpregs)); > } else if (j > LOOPS/2) > assert(fpstack(0) == 42.0); > > ptrace(PTRACE_CONT, child, NULL, NULL); > } > > assert(j == LOOPS); > 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 810668
:
575976
|
577270
|
577491
| 578300