Skip to main content

SIGSEGV (11) one more time

1 reply [Last post]
andrzejros
Offline
Joined: 2005-02-03

Hi!

I've read prevoius post ,it's maybe close to that issue, but, PrintCanvas3D works perfectly - other examples also. When I've tried to wrote porogram that is not using normal (on-screen) rendering mode - it have to be server side part of application seg fault is thrown each time I execute it.

Some background, I've took OffScreenCanvas3D.java from mentioned example (PrintCanvas3D) and tried to execute such code:

GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
OffScreenCanvas3D canvas = new OffScreenCanvas3D(config, true);
canvas.setSize(320, 200);
canvas.setOffScreenLocation(2, 2);
Screen3D screen = canvas.getScreen3D();
screen.setPhysicalScreenWidth(320.0);
screen.setPhysicalScreenHeight(200.0);
screen.setSize(320, 200);

SimpleUniverse univ = new SimpleUniverse(canvas);
univ.getViewingPlatform().setNominalViewingTransform();

BranchGroup scene = new BranchGroup();
scene.addChild(new ColorCube(0.5));
Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);
Background bgNode = new Background(bgColor);
scene.addChild(bgNode);
scene.compile();

univ.addBranchGraph(scene);

BufferedImage image = canvas.doRender(800, 600);

try
{
if (!ImageIO.write(image, "jpg", new File("/tmp/image.jpg")))
{ // cut
}
}
catch (IOException e)
{ // cut
}

the hs_err is reported:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x4D41D0DE
Function=Java_javax_media_j3d_Canvas3D_createOffScreenBuffer+0xFA
Library=/usr/lib/j2sdk1.4.2_04/jre/lib/i386/libJ3D.so

Current Java thread:
at javax.media.j3d.Canvas3D.createOffScreenBuffer(Native Method)
at javax.media.j3d.Canvas3D.setOffScreenBuffer(Canvas3D.java:1776)
at net.homeunix.andrzejros.test3d.OffScreenCanvas3D.doRender(OffScreenCanvas3D.java:24)
at net.homeunix.andrzejros.test3d.Test3d.test(Test3d.java:58)
at net.homeunix.andrzejros.test3d.Test3d.main(Test3d.java:81)

I'm using Blackdown j3d-1.3.1-fcs distro under Slackware-current (Xorg) and Sun's java 1.4:

java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

from slackware distribution

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
andrzejros
Offline
Joined: 2005-02-03

it is possible that this is a bug in j3d implementation, this code works fine under win xp