Inherited interface corrupts mem from DataBuffer

Monkey Forums/Monkey Bug Reports/Inherited interface corrupts mem from DataBuffer

Nobuyuki(Posted 2014) [#1]
This only occurs when compiling with MinGW, and not msbuild. A large chunk of this code was lifted directly from skn3's Spine implementation. Tested with v76d and v77f on Windows XP 32-bit.



Again, this builds fine under msbuild, but crashes with "Memory Access Violation" under gcc. The call stack has problems with line 88, "start=total" after peeking the result string. start and total are both overwritten with the value -36 after being loaded (late-bound?) into Local fileStream when compiling with gcc. Furthermore, the results from attempting to peek from the string is garbage, but that would make sense if it's trying to start from an out-of-bounds position. The value is getting smashed sometime before the method is called. I'm guessing what's going on here that there's something gcc doesn't like with how the interface inheritance works, but I can't be certain.

The contents of test.json can be anything. For example, {"testKey" : "testValue"}


marksibly(Posted 2014) [#2]
What version of gcc are you using? It could be this bug...

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55453

It was fixed in gcc 4.8.something I think.

I'm on 4.8.1 here, and the above code runs without crashing.


Nobuyuki(Posted 2014) [#3]
The official installer for MinGW is stuck at gcc 4.7.2 :(

I'll try getting a dev build later and let you know if that fixes it....


Nobuyuki(Posted 2014) [#4]
Update: Confirmed resolved in gcc 4.8.1. For those of you on Windows who are encountering this bug (it will happen if you use Spine!), you have to upgrade MinGW from the commandline. Go to your MinGW/bin directory and type the following commands:

mingw-get update
mingw-get upgrade


and wait a bit. This should update you to gcc 4.8.1. Why they chose not to include it with the official installer, I have no idea.