On Sun, Dec 11, 2011 at 02:10:25PM +0100, Mariano Martinez Peck wrote:
On Sun, Dec 11, 2011 at 6:46 AM, David T. Lewis lewis@mail.msen.com wrote:
This is starting to look like an interesting bug. There certainly is some kind of problem in the serialization phase of the Fuel test, but of course it is hard to debug that when the VM is crashing.
Yes! What should happen with that test is that it should fail because it doesn't find an instVar called 'testSelector'. If that happens, then it is perfect ;) this is because of something we have recently changed and we need to fix it.
For what it's worth, I when I run the test with a non-optimized plugin (so it does not crash), I am able to get to a debugger that suggests some problem related to array bounds (see attached). No surprise there, but it suggests that the test is probably feeding some invalid parameters to a primitive that crashes it in one case but not the other. This is just speculation of course, but perhaps this is the reason that no one has encountered the bug up to this time.
Good news: I figured out how to make it stop crashing, which should make it possible for you to go back to debugging your Fuel test.
Bad news: The way to make the VM stop crashing is to compile it with optimization turned off. That means that perhaps the plugin itself is not directly at fault, but maybe it is something induced by gcc optimization. Or possibly the reverse, it may be a bug in the plugin that is exposed by the optimizer.
I found this by accident because I built a VM with debugging on and optimization off so that I would be able to catch the crash in a debugger. Wonder of wonders, it stopped crashing. Specifically, it worked with 'CFLAGS=-g' and it crashes with 'CFLAGS=-g -O1' or with 'CFLAGS=-g -O2'.
The issue is specific to the plugin itself. If I compile the VM with optimization on, and the plugin with optimization off, then there is no crash.
Thanks Dave for digging in the issue. I tried to do the same as you did with the CMakeVMMaker but I it cashed anyway, so I think I am doing something wrong here. Igor, could you take a look? I have implemented:
configureDeflatePlugin: maker
maker addDefinitions: '-g -O0'.
I was using Ian's CMake build (the standard interpreter VM one for unix), and I hacked around it by editing this file: ZipPlugin/CMakeFiles/ZipPlugin.dir/flags.make
You can probably do something similar with Igor's CMake build as a workaround for your testing. Just ignore the "do not edit this file" warning ;)
Dave