-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRASH (win8 x64 any app) x64 stack is up high => dynamorio!__chkstk does wrong thing when looking at TEB.StackLimit #921
Comments
From bruen...@google.com on September 29, 2012 15:28:31 *** DONE adding to target COMPILE_FLAGS messes up rc FAILED: "C:/PROGRA cmake must know to strip out params and leave only defs from *_C_FLAGS? xref similar issue here: http://www.cmake.org/pipermail/cmake/2009-August/031672.html and here: http://www.cmake.org/pipermail/cmake/2008-June/022381.html though those are both putting flags into add_definitions() => adding to each source file except I really want target-specific source properties which this implies set_target_properties(dynamorio PROPERTIES go to custom command for running rc.exe? and in fact it's already been filed and very recently fixed: http://www.cmake.org/Bug/view.php?id=13486 I tried to sed build.ninja via a PRE_BUILD custom command but: gave up. requiring building from sources. default is /MD so: % git clone git://cmake.org/cmake.git cmake.git |
From derek.br...@gmail.com on October 02, 2012 15:42:24 This issue was closed by revision r1623 . Status: Fixed |
From bruen...@google.com on September 28, 2012 16:24:36
after fixing issue #902 I tried running win8 x64 hello.exe w/ -no_native_exec_syscalls (to work around issue #901 ) and I hit a crash at exit:
0:000> kn
*** Stack trace for last set context - .thread/.cxr resets it
Child-SP RetAddr Call Site
00 00000000
1b21d950 00000000
151f9879 dynamorio!__chkstk+0x37 [f:\dd\vctools\crt_bld\SELF_64_amd64\crt\prebuild\startup\amd64\chkstk.asm @ 117]01 00000000
1b21d968 00000000
151f9987 dynamorio!my_getenv+0x19 [c:\derek\dr\git\src\core\config.c @ 206]02 00000000
1b21d970 00000000
151f931b dynamorio!set_config_from_env+0x77 [c:\derek\dr\git\src\core\config.c @ 260]03 00000000
1b21e1c0 00000000
151f97c5 dynamorio!config_reread+0x32b [c:\derek\dr\git\src\core\config.c @ 558]04 00000000
1b21e240 00000000
1500192a dynamorio!get_parameter_ex+0x35 [c:\derek\dr\git\src\core\config.c @ 693]05 00000000
1b21e280 00000000
150919a3 dynamorio!synchronize_dynamic_options+0x4fa [c:\derek\dr\git\src\core\options.c @ 1989]06 00000000
1b21e360 00000000
15352a45 dynamorio!dynamo_process_exit+0x73 [c:\derek\dr\git\src\core\dynamo.c @ 1259]07 00000000
1b21e3d0 00000000
00000005 dynamorio!cleanup_and_terminate+0x79 [C:\derek\dr\git\build_x64_dbg_tests\core\CMakeFiles\dynamorio.dir\x86\x86.asm.obj.s @ 1283]08 00000000
1b21e3d8 00000000
15352a2b 0x509 00000000
1b21e3e0 00000000
1b1a3700 dynamorio!cleanup_and_terminate+0x5f [C:\derek\dr\git\build_x64_dbg_tests\core\CMakeFiles\dynamorio.dir\x86\x86.asm.obj.s @ 1274]0a 00000000
1b21e3e8 0000001b
c251fdf0 0x1b1a37000b 00000000
1b21e3f0 00000000
15352ad6 0x0000001bc251fdf0 0c 00000000
1b21e3f8 000000001b21f000 dynamorio!global_do_syscall_syscall [C:\derek\dr\git\build_x64_dbg_tests\core\CMakeFiles\dynamorio.dir\x86\x86.asm.obj.s @ 1486] 0d 00000000
1b21e400 00000000`00000000 0x1b21f0000:000> U my_getenv
dynamorio!my_getenv [c:\derek\dr\git\src\core\config.c @ 206]:
00000000
151f9860 4c89442418 mov qword ptr [rsp+18h], r8 00000000
151f9865 4889542410 mov qword ptr [rsp+10h],rdx00000000
151f986a 48894c2408 mov qword ptr [rsp+8],rcx 00000000
151f986f b828100000 mov eax,1028h00000000
151f9874 e8d7182200 call dynamorio!__chkstk (00000000
1541b150)00000000
151f9879 482be0 sub rsp,rax 0:000> !vprot 1b21c928 BaseAddress: 000000001b21c000 AllocationBase: 000000001b150000 AllocationProtect: 00000001 PAGE_NOACCESS RegionSize: 0000000000003000 State: 00001000 MEM_COMMIT Protect: 00000004 PAGE_READWRITE Type: 00020000 MEM_PRIVATE 0:000> Uf dynamorio!__chkstk dynamorio!__chkstk [f:\dd\vctools\crt_bld\SELF_64_amd64\crt\prebuild\startup\amd64\chkstk.asm @ 75]: 75 00000000
1541b150 4883ec10 sub rsp,10h91 00000000
1541b154 4c891424 mov qword ptr [rsp], r10 92 00000000
1541b158 4c895c2408 mov qword ptr [rsp+8], r11 94 000000001541b15d 4d33db xor r11 , r11 95 00000000
1541b160 4c8d542418 lea r10 ,[rsp+18h]96 00000000
1541b165 4c2bd0 sub r10 ,rax 97 00000000
1541b168 4d0f42d3 cmovb r10 , r11 105 000000001541b16c 654c8b1c2510000000 mov r11 ,qword ptr gs:[10h] 106 00000000
1541b175 4d3bd3 cmp r10 , r11 107 000000001541b178 7316 jae dynamorio!__chkstk+0x40 (00000000
1541b190)dynamorio!__chkstk+0x2a [f:\dd\vctools\crt_bld\SELF_64_amd64\crt\prebuild\startup\amd64\chkstk.asm @ 115]:
115 00000000`1541b17a 664181e200f0 and r10w,0F000h
dynamorio!__chkstk+0x30 [f:\dd\vctools\crt_bld\SELF_64_amd64\crt\prebuild\startup\amd64\chkstk.asm @ 116]:
116 00000000
1541b180 4d8d9b00f0ffff lea r11 ,[ r11 -1000h] 117 00000000
1541b187 41c60300 mov byte ptr [ r11 ],0118 00000000
1541b18b 4d3bd3 cmp r10 , r11 119 00000000
1541b18e 75f0 jne dynamorio!__chkstk+0x30 (00000000`1541b180)dynamorio!__chkstk+0x40 [f:\dd\vctools\crt_bld\SELF_64_amd64\crt\prebuild\startup\amd64\chkstk.asm @ 120]:
120 00000000
1541b190 4c8b1424 mov r10 ,qword ptr [rsp] 121 00000000
1541b194 4c8b5c2408 mov r11 ,qword ptr [rsp+8]122 00000000
1541b199 4883c410 add rsp,10h 123 00000000
1541b19d c3 ret0:000> r
Last set context:
rax=0000000000001028 rbx=000000001b21f000 rcx=0000000015461af8
rdx=000000001b21d9b0 rsi=0000000000000001 rdi=000000001b1a3700
rip=000000001541b187 rsp=000000001b21d950 rbp=000000001b21e408 r8 =0000000000000800 r9 =0000000000000001 r10 =000000001b21c000 r11 =0000001bc2423000 r12 =0000001bc2647f90 r13 =0000000000000000 r14 =0000000000000000 r15 =0000001bc2647f98
iopl=0 nv up ei ng nz na po cy
cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010287
dynamorio!__chkstk+0x37:
00000000
1541b187 41c60300 mov byte ptr [ r11 ],0 ds:0000001b
c2423000=00the TEB.StackLimit is higher than dstack so it thinks we're way off
0:000> !teb
TEB at 000007f79ddee000
ExceptionList: 0000000000000000
StackBase: 0000001bc2520000
StackLimit: 0000001bc2421000
dynamorio!__chkstk looks the same on VS2010 win7, but:
0:001> !teb
TEB at 000007fffffdc000
ExceptionList: 0000000000000000
StackBase: 0000000003090000
StackLimit: 000000000308c000
really we want to get rid of __chkstk altogether
so we can either use #pragma check_stack
or build with /Gs65536 (default is 4K)
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=921
The text was updated successfully, but these errors were encountered: