Ticket #183 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

VIC H.264 crashing on startup in avcodec.dll

Reported by: piers Owned by: piers
Priority: major Milestone:
Component: vic Version: 2.8ucl-1.4.0
Keywords: Cc:

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.

Change History

Changed 7 years ago by piers

  • status changed from new to closed
  • resolution set to fixed

Fixed as described - though I await a better 4.3.0 version of gcc

Changed 7 years ago by piers

There still doesn't seem to be a better version - this is the link to the download for  gcc-4.2.1-sjlj

Changed 7 years ago by piers

  • description modified (diff)
Note: See TracTickets for help on using tickets.