FPU stack overflow

Project:JNode Core
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

While trying to run art of illusion v2.6.1 without the optional parts (JOGL and Java Media Framework), I have a FPU stack overflow (look attached file), just after the splash screen is displayed on the screen.

Context : JNode 32 bits, all plugins, Kernel Virtual Machine (kvm) under kubuntu/AMD 64 bits.
I have used the jar packager (which give AllPermission to the plugin) with only the file ArtOfIllusion.jar (the other files from aoi install are not in the plugin)

AttachmentSize
aoi_FPU_stack_full.png14.77 KB

#1

It would be easier for others to reproduce this bug if you created a more managable testcase for it.
Could you please try to find the class in art of illusion which makes the compiler break and based on its surce code create a small and to the point testcase for the bug?

#2

I extracted the code from aoi to reproduce the bug : see attached file.

AttachmentSize
Mat4.java_.zip1.19 KB

#3

Status:active» patch (code needs review)

I have a patch for this bug. But I'm not sure if it's the way to go.
The code in fpu compiler properly checks for a non full fpu stack. If it is full, it pushes everything onto the real stack to make room again. As the ByteCodeVisitor itself does not check for a full fpu stack you might get the overflow. I fixed this with my patch but this code might not be generic enough as we hopefully will have an SSECompiler at some point where it might make more sense to just spill a register or something like that.
Feel free to commit if you like the patch.

AttachmentSize
compiler.patch1.5 KB

#4

I have tested the patch both with direct usage of Mat4 class (see file Mat4.java_.zip) and with aoi.
It works but is it the right way to fix the bug ?

#5

Status:patch (code needs review)» fixed

I have committed your bug fix and added a test (org.jnode.test.TestFPStackException).
Marking as fixed.

#6

Status:fixed» closed