Skip to content
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

Complete breakdown after loading a new DLL and raising an exception in it #46

Open
remittor opened this issue Dec 4, 2020 · 0 comments

Comments

@remittor
Copy link
Contributor

remittor commented Dec 4, 2020

The documentation says it is recommended to reuse the instance and no sense to create more than one instance.
Source: https://github.com/JochenKalmbach/StackWalker#reusing-the-stackwalk-instance
But these are fundamentally incorrect recommendations!

If, after calling the StackWalker::LoadModules, load a new DLL into the process and force the code of this DLL to raise an exception, then we will not receive a stack trace.

Example that reproduces this problem: remittor-pr@2bbd898

Cases when TEST_NEW_DLL_AND_FUNC = 0

Show a the callstack from inside an exception-handler:

SymInit: symOptions: 530, UserName: 'Oleg'
OS-Version: 6.1.7601 (Service Pack 1) 0x100-0x1
0000000140000000 \StackWalker_VC2015.exe (result : 0) PDB
0000000077B80000 \ntdll.dll (result : 0) -exported-
0000000077A60000 \kernel32.dll (result : 0) -exported-
000007FEFD700000 \KERNELBASE.dll (result : 0) -exported-
000007FEFE440000 \ADVAPI32.dll (result : 0) -exported-
000007FEFEC60000 \msvcrt.dll (result : 0) -exported-
000007FEFFE00000 \sechost.dll (result : 0) -exported-
000007FEFDD60000 \RPCRT4.dll (result : 0) -exported-
000007FEFC7B0000 \VERSION.dll (result : 0) -exported-
000007FEF8A60000 \api-ms-win-core-synch-l1-2-0.DLL (result : 0) -exported-
000007FEFD4E0000 \SspiCli.dll (result : 0) -exported-
000007FEF6170000 \dbghelp.dll (result : 0) -exported-
c:\stkwlk\stackwalker-test2\main\stackwalker\stackwalker.cpp (1071): StackWalker::ShowCallstack
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (268): wmain
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (80): invoke_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (253): __scrt_common_main_seh
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (296): __scrt_common_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_wmain.cpp (17): wmainCRTStartup
=====TestExceptionWalking======
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (202): ExpTest5
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (208): ExpTest4
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (212): ExpTest3
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (216): ExpTest2
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (220): ExpTest1
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (238): TestExceptionWalking
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (272): wmain
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (80): invoke_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (253): __scrt_common_main_seh
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (296): __scrt_common_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_wmain.cpp (17): wmainCRTStartup

Exception-Handler called

Cases when TEST_NEW_DLL_AND_FUNC = 1

SymInit: symOptions: 530, UserName: 'Oleg'
OS-Version: 6.1.7601 (Service Pack 1) 0x100-0x1
0000000140000000 \StackWalker_VC2015.exe (result : 0) PDB
0000000077B80000 \ntdll.dll (result : 0) -exported-
0000000077A60000 \kernel32.dll (result : 0) -exported-
000007FEFD700000 \KERNELBASE.dll (result : 0) -exported-
000007FEFE440000 \ADVAPI32.dll (result : 0) -exported-
000007FEFEC60000 \msvcrt.dll (result : 0) -exported-
000007FEFFE00000 \sechost.dll (result : 0) -exported-
000007FEFDD60000 \RPCRT4.dll (result : 0) -exported-
000007FEFC7B0000 \VERSION.dll (result : 0) -exported-
000007FEF8A60000 \api-ms-win-core-synch-l1-2-0.DLL (result : 0) -exported-
000007FEFD4E0000 \SspiCli.dll (result : 0) -exported-
000007FEF6170000 \dbghelp.dll (result : 0) -exported-
c:\stkwlk\stackwalker-test2\main\stackwalker\stackwalker.cpp (1071): StackWalker::ShowCallstack
c:\stkwlk\stackwalker-test2\main\stackwalker\main.cpp (268): wmain
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (80): invoke_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (253): __scrt_common_main_seh
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (296): __scrt_common_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_wmain.cpp (17): wmainCRTStartup
=====TestExceptionWalking======
===== call cabinet.DllGetVersion(bad_ptr) =======
ERROR: SymGetSymFromAddr64, GetLastError: 126 (Address: 000007FEF9CD519F)
ERROR: SymGetLineFromAddr64, GetLastError: 126 (Address: 000007FEF9CD519F)
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 000007FEF9CD519F)
000007FEF9CD519F ((module-name not available)): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 126 (Address: 0000000100000001)
ERROR: SymGetLineFromAddr64, GetLastError: 126 (Address: 0000000100000001)
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 0000000100000001)
0000000100000001 ((module-name not available)): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 126 (Address: 0000000100000001)
ERROR: SymGetLineFromAddr64, GetLastError: 126 (Address: 0000000100000001)
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 0000000100000001)
0000000100000001 ((module-name not available)): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 126 (Address: 000000000012FC98)
ERROR: SymGetLineFromAddr64, GetLastError: 126 (Address: 000000000012FC98)
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 000000000012FC98)
000000000012FC98 ((module-name not available)): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 126 (Address: 000000000012FCA8)
ERROR: SymGetLineFromAddr64, GetLastError: 126 (Address: 000000000012FCA8)
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 000000000012FCA8)
000000000012FCA8 ((module-name not available)): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 126 (Address: 000000000012FC90)
ERROR: SymGetLineFromAddr64, GetLastError: 126 (Address: 000000000012FC90)
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 000000000012FC90)
000000000012FC90 ((module-name not available)): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 126 (Address: 000000000012FCA0)
ERROR: SymGetLineFromAddr64, GetLastError: 126 (Address: 000000000012FCA0)
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 000000000012FCA0)
000000000012FCA0 ((module-name not available)): (filename not available): (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 126 (Address: 000000000012FCB0)
ERROR: SymGetLineFromAddr64, GetLastError: 126 (Address: 000000000012FCB0)
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 000000000012FCB0)
000000000012FCB0 ((module-name not available)): (filename not available): (function-name not available)

Exception-Handler called
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant