Intermittent Access Violation through __crtFlsGetValue

  • Thread starter Thread starter Manjinder Singh Mann
  • Start date Start date
M

Manjinder Singh Mann

Guest
I am facing the Access violation intermittently in function __crtFlsGetValue() when it calls (*pfFlsGetValue)(dwFlsIndex). The functions is part of windows provided source code file winapisupp.c. Access violation occurs after running application successfully for nearly 24 hours.


  1. I generated my set of c based static libraries with VS2013 in Windows 10 OS. Later, The application has been built with these static libraries. CRT library is statically linked with this application. The application is also build with VS2013 on windows 10 machine.

  2. Application keeps calling sprintf standard call in continuous loop after interval of 1 minute. sprintf internally calls windows provided function __crtFlsGetValue().

  3. On successful processing, (*pfFlsGetValue) function pointer ,inside __crtFlsGetValue(), successfully points to kernel32.dll!FlsGetValueStub. But intermittently after 24 hours (*pfFlsGetValue) gets pointer to some other arbitrary address and which throws access violation. Following is the stack trace captured for same :-
00007fff`fc0611cf : 00000044`7c0f9a70 00000044`7c0ffa40 00000044`7c0f9580 00000044`7c0f9400 : qacompb!__C_specific_handler+0x14e [f:\dd\vctools\crt\crtw32\misc\amd64\chandler.c @ 152]
00007fff`fc02a209 : 00000044`00000001 00007ff7`79d00000 00000000`00000000 00007ff7`7a12db28 : ntdll!RtlpExecuteHandlerForException+0xf
00007fff`fc05fe3e : cccccccc`00000005 00000000`00000000 00000000`00000000 cccccccc`cccccccc : ntdll!RtlDispatchException+0x219
00000a8b`383cf752 : 00007ff7`79d573db cccccccc`cccccccc cccccccc`cccccccc 00000218`a2290000 : ntdll!KiUserExceptionDispatch+0x2e
00007ff7`79d573db : cccccccc`cccccccc cccccccc`cccccccc 00000218`a2290000 00007fff`fc0c63ba : 0x00000a8b`383cf752
00007ff7`79d676d9 : cccccccc`00000007 cccccccc`cccccccc cccccccc`cccccccc cccccccc`cccccccc : qacompb!__crtFlsGetValue+0x3b [f:\dd\vctools\crt\crtw32\misc\winapisupp.c @ 422]
00007ff7`79d67699 : 00000000`00000000 00000000`00000001 00000218`a2290000 00007fff`fc0c4ae5 : qacompb!_getptd_noexit+0x19 [f:\dd\vctools\crt\crtw32\startup\tidtable.c @ 277]
00007ff7`79d4708a : cccccccc`cccccc01 00000218`a2350fa0 00000000`0000044c 00000000`40000062 : qacompb!_getptd+0x9 [f:\dd\vctools\crt\crtw32\startup\tidtable.c @ 337]
00007ff7`79d63a61 : 00000044`7c0f9fc8 00000000`00000000 00000218`a2290000 cccccccc`cccc0000 : qacompb!_LocaleUpdate::_LocaleUpdate+0x2a [f:\dd\vctools\crt\crtw32\h\setlocal.h @ 248]
00007ff7`79d43506 : 00000044`7c0fa2b0 00007ff7`7a0c25f4 00000000`00000000 00000044`7c0fa300 : qacompb!_output_l+0x91 [f:\dd\vctools\crt\crtw32\stdio\output.c @ 1027]
00007ff7`79eb1cfa : 00007ff7`7a114350 00007ff7`7a0c25f4 00000000`00000090 00007ff7`7a114350 : qacompb!sprintf+0x1f6 [f:\dd\vctools\crt\crtw32\stdio\sprintf.c @ 130]

4) The application main thread spawns two more threads. sprintf is called in one of the spawned thread.

Please assist me in finding the root cause behind the issue.

Thanks in advance...

Continue reading...
 
Back
Top