[Bug regression/37629] New: auto-import of constant data results in a crash at runtime
jkolb at wsi dot com
gcc-bugzilla@gcc.gnu.org
Tue Sep 23 20:48:00 GMT 2008
Compiling ffmpeg (see
http://sourceforge.net/tracker2/?func=detail&aid=2118261&group_id=202880&atid=983354)
under mingw-w64 into a DLL results in a runtime crash involving two dlls.
in libavutil.dll:
const uint8_t ff_log2_tab[256];
in libavcodec.dll:
extern const uint8_t ff_log2_tab[256];
static inline int av_log2(unsigned int)
{
...
}
which uses the ff_log2_tab array. The ff_log2_tab array is auto-imported from
libavutil into libavcodec.
When av_log2 is called the resulting program crashes. The workaround is to
explicitly import ff_log2_tab into libavcodec via:
__declspec(dllimport) const uint8_t ff_log2_tab[256];
If this is done the crash goes away.
This worked fine in gcc 4.3.
--
Summary: auto-import of constant data results in a crash at
runtime
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: regression
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jkolb at wsi dot com
GCC build triplet: x86_64-mingw-32
GCC host triplet: x86_64-mingw-32
GCC target triplet: x86_64-mingw-32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37629
More information about the Gcc-bugs
mailing list