FreeBSD Bugzilla – Attachment 230792 Details for
Bug 261010
Trace/BPT trap after interrupting truss
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Example source code
truss-crash.c (text/plain), 620 bytes, created by
martin
on 2022-01-07 19:17:10 UTC
(
hide
)
Description:
Example source code
Filename:
MIME Type:
Creator:
martin
Created:
2022-01-07 19:17:10 UTC
Size:
620 bytes
patch
obsolete
>#include <pthread.h> >#include <stdio.h> >#include <unistd.h> > >#define NUMTHREADS 100 >#define NUMLOOPS 1000000 > >static long long sum = 0; > >void* func(void*x) >{ > for(int i=0; i<NUMLOOPS; i++) { > for(int j=0; j<1000000; j++) { > sum++; > } > } > return NULL; >} > >int main() >{ > pthread_t threadHandle[NUMTHREADS]; > > for(int i=0; i<NUMTHREADS; i++) { > pthread_create(&threadHandle[i], NULL, func, NULL); > } > > for(int i=0; i<NUMTHREADS; i++) { > pthread_join(threadHandle[i], NULL); > } > > printf("Sum %lld\n", sum); > 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 261010
: 230792