Ticket #183 (closed defect: fixed)
VIC H.264 crashing on startup in avcodec.dll
|Reported by:||piers||Owned by:||piers|
Description (last modified by piers) (diff)
VIC was crashing on startup in __gcc_register_frame() - having been called by __do_global_ctors () and by DllMainCRTStartup@12 () when the dll is loaded. Had to debug in gdb - after tracking the original crash in from Visual C++ but since VC++ can't read the debug info generated by mingw I ran it in mingw gdb. It seems that gdb can use the symbol information from VC++ (which setup in VC++ using the Microsoft symbol server: http://msdl.microsoft.com/download/symbols)
It turns out the problem was the same as this project was having:
The problem is that DLLs generated by MingW GCC (with -shared) are not correctly relocatable, even though they contain relocation information. LoadLibrary?() returns ERROR_NOACCESS if it is forced to relocate the DLL and a backtrace shows a blind jump into bad memory from __gcc_register_frame.
- The crash is caused by the weak reference __register_frame_info being given an out-of-segment pointer (0x9dae0000) in the relocated DLL. I presume fixup has gone wrong?
- This is not an issue with GCC 4.2.1-SJLJ, likely due to the SJLJ unwind model, which uses different code in __gcc_register_frame. However, I was unable to find the 4.2.1-DW2 package to confirm this.
VIC's avcodec.dll library had been compiled with mingw gcc-4.3.0-alpha - It was fixed by compiling it with GCC 4.2.1-SJLJ.