When I compile with the MSVC version of Rust, whenever I open a file with the vorbis library I get a crash. When I compile with the MinGW version, everything works fine.
Here’s what happens:
The function creates a
Boxand obtains a pointer to it, and fills a struct with pointers to the callbacks. It then calls
ov_open_callbacksfrom the C library.
ov_open_callbacksthen immediately calls
The first line of
_ov_open1apparently reads from address
0xFFFFFFFFFFFFFFFF, which triggers a crash. I confirm that the
seek_funccallback isn’t called.
The exact message given by Visual Studio’s debugger is:
Exception thrown at 0x000000013FCD6A66 in basic.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF. You can find a screenshot with the stack trace and the local variables here.
The error doesn’t even make sense. The only memory that is read here (
callbacks) is the stack.
Because it only happens with MSVC, I suspect a problem during the compilation, but I don’t know enough about this topic to have an idea what to search for.