Access violation using different c++ runtime build VS 2017

0

I got an c0000005 memory exception when my program use a newer version of c++ runtime, specifically of msvcp140.dll :

  • 14.16.27012.6 the program works
  • 14.24.28127.4 the program crashes.

My application uses signalrclient library for connecting to our web service. When there’s a problem with the connection, the program crashes with an access violation. I got the stack from a dump:

00 0b7ff34c 0b7ff370 BC32RECV!__ExceptionPtr::_RethrowException+0x82 [d:\agent\_work\3\s\src\vctools\crt\crtw32\eh\excptptr.cpp @ 541] 
WARNING: Frame IP not in any known module. Following frames may be wrong.
01 0b7ff350 052b1466 0xb7ff370
02 0b7ff358 052b1561 BC32RECV!std::exception_ptr::_RethrowException+0x6 [c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\exception @ 282] 
03 0b7ff370 052b395b BC32RECV!std::rethrow_exception+0x31 [c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\exception @ 358] 
04 0b7ff388 052b3e8f BC32RECV!Concurrency::details::_ExceptionHolder::_RethrowUserException+0x2b [c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\ppltasks.h @ 789] 
05 0b7ff3d8 052b9d09 BC32RECV!Concurrency::details::_Task_impl_base::_Wait+0x22f [c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\ppltasks.h @ 1613] 
06 (Inline) -------- BC32RECV!Concurrency::task<unsigned char>::wait+0xf [c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\ppltasks.h @ 3297] 
07 (Inline) -------- BC32RECV!Concurrency::task<void>::wait+0xf [c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\ppltasks.h @ 4223] 
08 0b7ffa60 052c75e1 BC32RECV!try_connection+0x479 [c:\my .net projects\builder\main\utility\bc32recv\bc32recv.cpp @ 578]

The code of my function is :

try {

    client->connection.start().wait(); -> access vio
    connection_success = true;
}
catch (std::exception& ex)
{
...
}

It seems it had a different std::exception_ptr, changing version from 14.16.27012.6 to 14.24.28127.4 of msvcp140.dll.

I assumed compatibility was maintained in this case when only the build / minor version changes.

The exception info from the dump is:

0:014> .exr -1
ExceptionAddress: 052c7d2e (BC32RECV!__ExceptionPtr::_RethrowException+0x00000082)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: b0688e75
Attempt to read from address b0688e75

There's a attempt of reading b0688e75 address. The first frame of the stack reports:

frame 0n0;dv /t /v
00 0b7ff34c 0b7ff370 BC32RECV!__ExceptionPtr::_RethrowException+0x82 [d:\agent\_work\3\s\src\vctools\crt\crtw32\eh\excptptr.cpp @ 541] 
@ebx              class __ExceptionPtr * this = 0x0a09b2bc
0b7ff2f8          struct _EXCEPTION_RECORD ThisException = struct _EXCEPTION_RECORD
@eax              struct _s_ThrowInfo * pThrow = 0xb0688e69
<unavailable>     struct _s_CatchableType * pType = <value unavailable>
<unavailable>     void * pExceptionBuffer = <value unavailable>

I dont know how to "read" theese infos. What it seems near to the address VAM is

@eax              struct _s_ThrowInfo * pThrow = 0xb0688e69

and it seems wrong:

((BC32RECV!_s_ThrowInfo *)0xffffffffb0688e69)                 : 0xffffffffb0688e69 [Type: _s_ThrowInfo *]
    [+0x000] attributes       : Unable to read memory at Address 0xffffffffb0688e69
    [+0x004] pmfnUnwind       : Unable to read memory at Address 0xffffffffb0688e6d
    [+0x008] pForwardCompat   : Unable to read memory at Address 0xffffffffb0688e71
    [+0x00c] pCatchableTypeArray : Unable to read memory at Address 0xffffffffb0688e75
c++
visual-studio-2017
c++17
signalr.client
asked on Stack Overflow May 6, 2020 by alangab • edited Jul 5, 2020 by Martijn Pieters

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0