Sourceware Bugzilla – Attachment 7653 Details for
Bug 13690
pthread_mutex_unlock potentially cause invalid access
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
demonstration of spurious futex wakes from kernel
futex_spurious_wake.c (text/plain), 653 bytes, created by
Rich Felker
on 2014-06-20 19:10:05 UTC
(
hide
)
Description:
demonstration of spurious futex wakes from kernel
Filename:
MIME Type:
Creator:
Rich Felker
Created:
2014-06-20 19:10:05 UTC
Size:
653 bytes
patch
obsolete
>#define _GNU_SOURCE >#include <sched.h> >#include <sys/syscall.h> >#include <unistd.h> >#include <linux/futex.h> >#include <signal.h> > >static char stack[32768]; >static int tid; > >static int foo(void *p) >{ > syscall(SYS_getpid); > syscall(SYS_getpid); > syscall(SYS_exit, 0); >} > >int main() >{ > int pid = getpid(); > for (;;) { > int x = clone(foo, stack+sizeof stack, > CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND > |CLONE_THREAD|CLONE_SYSVSEM //|CLONE_SETTLS > |CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID > |CLONE_DETACHED, > 0, &tid, 0, &tid); > syscall(SYS_futex, &tid, FUTEX_WAIT, x, 0); > /* Should fail... */ > syscall(SYS_tgkill, pid, tid, SIGKILL); > } >}
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 13690
:
6222
| 7653