0

I'm working on an multi-threaded application, which has generally worked fine.

Now it seems that the subthreads are crashing, and by configuring Visual Studio in order to throw C++ exceptions, I've discovered following information about the exception:

ExceptionCode : 3765269347
ExceptionFlags : 1
ExceptionRecord : <NULL>
ExceptionAddress : 0x0000...0
NumberOfParameters : 4
params:
  magicNumber : 429065504
  pExceptionObject : 0x... (some memory address)
  pThrowInfo : 0x... (some memory address) 
               {<application.exe>_Tl3?AVC_IOException@@ ...
    attributes : 0
    pmfnUnwind : 470560
    pForwardCompat : 0
    pCatchableTypeArray : 6451800
  pThrowImageBase : 0x... (some memory address) 
                    {<application.exe>_IMAGE_DOS_HEADER_ImageBase}

(I've tried to copy as good as possible, don't shoot me in case of typos)

I've been looking on the internet for the mentioned exception code but I don't understand the explanation and I've searched for the mentioned AVC_IoException but I didn't find anything. Does anybody know what I can do here?

For your information, the exception is thrown when I try to write something into a buffer (for your information, this buffer is not NULL), it seems not to be related to the loading of any DLL files (I've put breakpoints at every loadlibrary() function, but none of them was called).

Hereby the piece of code (it's a recursive function, writing something into a buffer):

  virtual void fillBuffersBeforeWrite(const <internal_struct>* pDsp, 
                                      size_t nByteCount)
  {
    <internal_class>* w = writer();
    if (w && (w != this)) {
      w->fillBuffersBeforeWrite(pDsp, nByteCount);
    }
  }

Thanks in advance

Dominique
  • 16,450
  • 15
  • 56
  • 112
  • 1
    Related questions about this same exception: http://stackoverflow.com/search?q=3765269347 – Paul R Nov 17 '16 at 09:31
  • Have you tried *running* in the debugger to actually catch the exception/crash in action? Where in your code does it happen? What are you doing there? Could it be a race-condition you missed handling? There are thousands of possibilities, and we can't list them all. You have to help us by narrowing the list down. – Some programmer dude Nov 17 '16 at 09:32
  • A possible explanation that the `dllmain()` function in a DLL died due to an exception being thrown. http://stackoverflow.com/questions/17069336/c-loadlibrary-error-3765269347 If it's that, you'll need to look at dlls being loaded by your program, and what causes them to fail. – Peter Nov 17 '16 at 09:36
  • I've updated my question: the exception is thrown while writing to a buffer, there seems to be no link with a `LoadLibrary` function. – Dominique Nov 17 '16 at 09:41
  • *Do* you load any DLL dynamically with `LoadLibrary` in your code? Is the buffer coming from such a DLL? Are you doing it *in* such a DLL? Without seeing any code it's impossible to really say anything, so please try to create a [Minimal, Complete, and Verifiable Example](http://stackoverflow.com/help/mcve) and show us. Like I said before, there could be thousand of reasons for this crash, you need to narrow it down even more. – Some programmer dude Nov 17 '16 at 09:47
  • 1
    It is a very plain C++ exception. Some code you call, probably in a library, uses `throw` and there is no `catch` in your program so that terminates the process. "AVC" is the name of a video codec standard, so high likelihood that you did not write that code. "IOException" suggests that it has trouble reading or writing the video stream. Could be as simple as corrupt data or running out of disk space. That's about where the guessing needs to end. – Hans Passant Nov 17 '16 at 10:14
  • ? The program is converting ASCII data (lines, circles, ...) into a bitmap format. As far as I know, no external libraries are used. There is no video involved, the issue happens when certain runtime parameters are set to zero (so it's not related to corrupted data) and there is no disk space problem. – Dominique Nov 17 '16 at 10:19

1 Answers1

1

Try to catch the code that throws the exception: in MS Visual Studio 2015, Debug -> Windows -> Exception Settings, select "C++ Exceptions", right click "Add Exception", insert the exception type - "AVC_IoException"; mark also other common exception types - std::exception, CException etc. The debugger will stop in line where the exception is thrown. You can than analyze the stack. Be aware that you possibly may need to skip (i.e. to ask the debugger to continue) the irrelevant exceptions. It is also a good idea to keep the debug builds of all 3d parties, including the C++/C run-time and the OS.

Lesh
  • 151
  • 8