Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 389152 Details for
Bug 528558
sys-libs/glibc-2.20: TLS init crashes on hardened
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
where does vdso live for a three threaded process
vdso_threads.c (text/x-c), 998 bytes, created by
Anthony Basile
on 2014-11-12 01:17:19 UTC
(
hide
)
Description:
where does vdso live for a three threaded process
Filename:
MIME Type:
Creator:
Anthony Basile
Created:
2014-11-12 01:17:19 UTC
Size:
998 bytes
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <pthread.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <unistd.h> >#include <sys/syscall.h> >#include <linux/limits.h> > > >static void print_vdso_addr(pid_t p, pid_t t) { > char buf[PATH_MAX]; > char *line; > size_t s; > FILE *f; > > sprintf(buf, "/proc/%ld/task/%ld/maps", (long)p, (long)t); > > if((f = fopen(buf, "r")) == NULL) { > fprintf(stderr, "Failed to fopen %s\n", buf); > exit(EXIT_FAILURE); > } > > while(getline(&line, &s, f) != -1) { > if(strstr(line, "vdso")) > printf("%s", line); > } > > fclose(f); >} > >static void *read_vdso(void *arg) { > pid_t tid, *pid; > pid = arg; > tid = syscall(SYS_gettid); > print_vdso_addr(*pid, tid); >} > >int main() { > pid_t pid; > pthread_t t1, t2; > > pid = getpid(); > print_vdso_addr(pid, pid); > > pthread_create(&t1, NULL, read_vdso, (void *)&pid); > pthread_create(&t2, NULL, read_vdso, (void *)&pid); > pthread_join(t2, NULL); > pthread_join(t1, NULL); > > exit(EXIT_SUCCESS); >}
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 528558
:
388780
|
388884
|
388886
|
388960
| 389152 |
389536