FreeBSD Bugzilla – Attachment 185022 Details for
Bug 219399
System panics after several hours of 14-threads-compilation orgies using poudriere on AMD Ryzen...
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
program to cause Ryzen hang/reboot on tweaked FreeBSD by executing code in high memory
crashme2.c (text/plain), 939 bytes, created by
Don Lewis
on 2017-08-04 16:19:32 UTC
(
hide
)
Description:
program to cause Ryzen hang/reboot on tweaked FreeBSD by executing code in high memory
Filename:
MIME Type:
Creator:
Don Lewis
Created:
2017-08-04 16:19:32 UTC
Size:
939 bytes
patch
obsolete
>#include <sys/param.h> >#include <sys/mman.h> >#include <errno.h> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> > >#define WHERE 0x7ffffffff000 >/* #define WHERE 0x04fffffff000 */ > >int main() >{ > void *ptr; > intptr_t ptr2; > void (*func)(); > int i, j; > > ptr = mmap((void *)WHERE, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_FIXED | MAP_EXCL, -1, 0); > if (ptr == MAP_FAILED) { > fprintf(stderr, "mmap() failed %d\n", errno); > exit(1); > } else if (ptr != (void *)WHERE) { > fprintf(stderr, "mmap() returned %p, not %p\n", (void *)func, > (void *)WHERE); > exit(1); > } > /* fill with ret instructions */ > memset(ptr, 0xC3, PAGE_SIZE); > > for (ptr2 = WHERE; ptr2 < WHERE + PAGE_SIZE; ptr2++) { > func = (void *)ptr2; > fprintf(stderr, "executing at %p ", (void *)func); > for (i = 0; i < 10; i++) { > for (j = 0; j < 10000000; j++) { > (*func)(0); > } > fprintf(stderr, "."); > } > fprintf(stderr, "\n"); > } >}
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 219399
:
182736
|
183054
|
184037
|
184051
|
184539
|
184542
|
184641
|
184707
|
184714
| 185022 |
186143