FreeBSD Bugzilla – Attachment 199211 Details for
Bug 233204
rtld issue on aarch64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
test program
test.txt (text/plain), 1.02 KB, created by
Mikael Urankar
on 2018-11-13 18:04:45 UTC
(
hide
)
Description:
test program
Filename:
MIME Type:
Creator:
Mikael Urankar
Created:
2018-11-13 18:04:45 UTC
Size:
1.02 KB
patch
obsolete
>/* from https://sourceware.org/ml/libc-help/2011-04/msg00000.html */ > >/* test.c */ >/* Compile with "cc -o test test.c -lpthread" */ >#include <pthread.h> >#include <stdlib.h> >#include <stdio.h> >#include <dlfcn.h> > >int main(void) >{ > int i; > void *handle; > pthread_t pt; > void *(*do_something)(void *); > > handle = dlopen("./test_lib.so", RTLD_LAZY); > if (!handle) { > perror("dlopen"); > return EXIT_FAILURE; > } > > do_something = dlsym(handle, "do_something"); > if (!do_something) { > perror("dlsym"); > return EXIT_FAILURE; > } > > for (i = 0; i < 10000; i++) { > if (pthread_create(&pt, NULL, do_something, NULL)) { > perror("pthread_create"); > return EXIT_FAILURE; > } > > if (pthread_join(pt, NULL)) { > perror("pthread_join"); > return EXIT_FAILURE; > } > } > > if (dlclose(handle)) { > perror("dlclose"); > return EXIT_FAILURE; > } > > return EXIT_SUCCESS; >} > > >/* test_lib.c */ >/* Compile with "cc -o test_lib.so test_lib.c -fPIC -shared" */ >#include <stdlib.h> > >static __thread int a; > >void *do_something(void *arg) >{ > a = 666; > return NULL; >}
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 233204
: 199211