printf - Access violation while running app via windbg -
my application access violation sometimes. runned application through windbg, , stopped in following function . tried _vscprintf instead of vsnprintf, , result same. 'm newbie windbg. appreciated.
int tsk_sprintf_2(char** str, const char* format, va_list* ap) { int len = 0; va_list ap2; ap2 = *ap; len = vsnprintf(0, 0, format, *ap); /*-> access violation in point! */ *str = (char*)calloc(1, len+1); vsnprintf(*str, len, format, ap2); va_end(ap2); return len; }
==> following result windbg
managed_stack: !dumpstack -ee os thread id: 0x5b8 (22) current frame: childebp retaddr caller, callee primary_problem_class: wrong_symbols bugcheck_str: application_fault_wrong_symbols last_control_transfer: 1026d3d8 102e14cf stack_text: warning: stack unwind information not available. following frames may wrong. 1d3cde7c 1026d3d8 1d3cdea8 0898eeeb 00000000 msvcr100d!vcwprintf_s_l+0x52ef 1d3cded0 1026d46c 00000000 00000000 0898ee88 msvcr100d!vsnprintf_l+0x158 1d3cdeec 0834d927 00000000 00000000 0898ee88 msvcr100d!vsnprintf+0x1c 1d3cdfe8 1002891e 1d3ce0d0 0898ee88 1d3ce1e4 tinysak!tsk_sprintf_2+0x57 1d3ce0f0 10028b77 09a16fe8 0898ee88 00000000 tinywrap!debug_xxx_cb+0x6e 1d3ce1ec 088b697b 09a16fe8 0898ee88 00000444 tinywrap!ddebugcallback::debug_info_cb+0x37 1d3cffb4 7c80b713 1cd10f90 1d2cfb44 7c947d9a tinynet!tnet_transport_mainthread+0x1adb 1d3cffec 00000000 088a2aff 1cd10f90 00000000 kernel32!getmodulefilenamea+0x1b4 symbol_stack_index: 0 symbol_name: msvcr100d!vcwprintf_s_l+52ef followup_name: machineowner module_name: msvcr100d image_name: msvcr100d.dll stack_command: ~22s ; kb bucket_id: wrong_symbols failure_bucket_id: wrong_symbols_c0000005_msvcr100d.dll!vcwprintf_s_l watson_stageone_url: followup: machineowner --------- route.
you're attempting print null pointer: len = vsnprintf(0, 0, format, *ap);
; of course, crash. send valid address of output buffer first parameter , valid length second.
Comments
Post a Comment