[vtkusers] Mac OS 10.4.8, Intel, VTK 5.0 , java 1.5 crashes

Mike Jackson imikejackson at gmail.com
Thu Feb 22 12:30:49 EST 2007


Looks like the JVM has crashed which means something bad deep in the  
JVM is causing a problem or something in the JNI code is trying to  
access something that either was never there to begin with OR was  
there as was "deleted" but the reference to it stuck around.

Also, Cocoa is Objective-C which is to Apple like .Net is to  
Microsoft. It is Apple's language of choice and most everything that  
is written by Apple is based on it. Not deprecated, but actually  
being radically enhanced in OS X 10.5 (Leopard).

Java 1.3 was based on Carbon
Java 1.4 switched to Cocoa (Objective-C)
Java 1.5 is also based on Cocoa

So in Java 1.4 and above, when you call an AWT window, you are  
actually calling a Cocoa window deep down in the JVM. Now I have no  
idea if this really makes a difference since Carbon and Cocoa can  
coexist peacefully last I checked but you can never be too safe.

Now, along those lines, SWT from Eclipse is actually based on Carbon.  
So if you are going to use Java with VTK and want to use Eclipse as a  
Rich Client Platform, then I would build VTK with Carbon and not  
Cocoa. If you are just using Eclipse for Development and going to use  
"native" java for the widowing, then build VTK with Cocoa.

Cheers
-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Feb 22, 2007, at 11:57 AM, Kustaa Nyholm wrote:

> Hi Mike,
>
> thanks for the reply. Yes, good point, does it realy crash.?
>
> Actually, the answer is sort of yeas and no.
>
> It createas the java.crash.log file and which reports crash on  
> thread 15
> (see trace below), but actually
> the application seems to be running, judging from by that I can pause
> the application with debugger (running this on Eclipse) and see that
> there are four threads that appear to be running:
> AWT-AppKit,AWT-ShutDown,DestroyJavaVM and AWT-Event-Queue-0, last of
> which seems to be stuck
> inside a native method Object.wait(). The stack for that thread is
> roughly as follows (could not copy directly):
>
> Object.wait(long) line: not available [native method]	
> EventQueue(Object).wait() line: 474	
> EventQueue.getNextEvent() line: 345	
> EventDispatchThread.pumpOneEventForHierarchy(int, Component) line: 216
> EventDispatchThread.pumpEventsForHierarchy(int, Conditional,  
> Component)
> line: 190
> EventDispatchThread.pumpEvents(int, Conditional) line: 184
> EventDispatchThread.pumpEvents(Conditional) line: 176	
> EventDispatchThread.run() line: 110	
>
> On the console we get:
>
> Invalid memory access of location 646c7974 eip=9f42bd3f
> JavaAWT: Assertion failure: Java exception thrown
> JavaAWT: File src/macosx/native/apple/awt/util/AWTException.m; Line 40
> JavaAWT: Assertion failure: _javaException
> JavaAWT: File src/macosx/native/apple/awt/util/AWTException.m; Line 48
> 2007-02-22 18:35:01.657 java[25756] Exception raised during posting of
> notification.  Ignored.  exception: See Java exception object
>
> Note that the first line (invalid memory access) does not appear when
> running the VisQuad sample,
> the only sample that actually draws something, see below.
>
> So the JVM has not actually crashed, I guess.
>
> As to your other questions, I've tried the  
> SimpleRayCast,CADPart,VisQuad
> codes, all of which end with this same error. They open a window but
> then this crash happens. All open a window but only VisQuad draws
> something.By the look of it might be drawing "Visualizing a Quadric
> Function" sample code from vtk web site example code. A read 3d
> eliptical shape is drawn and around it an elliptical yellow/ 
> greenish 3D
> surface. But then it crashes. As mentioned the other Java example
> (sphere) code from that same page does nothing, but does not crash.
>
> And no, there are no unsatisfied link errors.	
>
> I'will now proceed to try Cocoa (I thought that was deprecated years
> ago).
>
> Thanks for the help and I any one has any more suggestions, they are
> naturally more wellcome.
>
>
> I'll report my success/failure here.
>
>
> br Kusti
> 	
> 	
>
>
> PART OF THE crash.java.log follows:
>
>
> Thread 15 Crashed:
> 0   libRIP.A.dylib                 	0x9e23d245 ripc_GetClipState +
> 267
> 1   libRIP.A.dylib                 	0x9e23ce44
> ripc_GetRenderingState + 182
> 2   libRIP.A.dylib                 	0x9e23b9e1 ripc_DrawImage + 144
> 3   com.apple.CoreGraphics         	0x9f4f88a5 CGContextDrawImage +
> 403
> 4   com.apple.HIToolbox            	0x9e5556db DrawCGImageFlipped +
> 259
> 5   com.apple.HIToolbox            	0x9e5516b1
> HIWindowFrameView::DrawSelf(short, __HIShape const*, CGContext*) +  
> 3715
> 6   com.apple.HIToolbox            	0x9e503150
> HIView::DrawCacheOrSelf(short, __HIShape const*, CGContext*) + 86
> 7   com.apple.HIToolbox            	0x9e502f5b
> HIView::SendDraw(short, OpaqueGrafPtr*, __HIShape const*,  
> CGContext*) +
> 97
> 8   com.apple.HIToolbox            	0x9e677d52
> HIView::RecursiveDrawComposited(__HIShape const*, unsigned long,
> HIView*, CGContext*, unsigned char) + 874
> 9   com.apple.HIToolbox            	0x9e6786d4
> HIView::DrawComposited(short, OpaqueGrafPtr*, __HIShape const*,  
> unsigned
> long, HIView*, CGContext*) + 600
> 10  com.apple.HIToolbox            	0x9e502b26 HIView::Draw(short,
> OpaqueGrafPtr*, unsigned long) + 74
> 11  com.apple.HIToolbox            	0x9e502a63
> HIView::Render(unsigned long, CGContext*) + 45
> 12  com.apple.HIToolbox            	0x9e4f25a2 _ShowHideWindows +
> 504
> 13  com.apple.HIToolbox            	0x9e51cdee ShowWindow + 72
> 14  libvtkRendering.5.0.dylib      	0x24d0b50b
> vtkCarbonRenderWindow::CreateAWindow(int, int, int, int) + 935
> 15  libvtkRendering.5.0.dylib      	0x24d0c1e9
> vtkCarbonRenderWindow::WindowInitialize() + 205
> 16  libvtkRendering.5.0.dylib      	0x24d09901
> vtkCarbonRenderWindow::Initialize() + 39
> 17  libvtkRendering.5.0.dylib      	0x24d095d7
> vtkCarbonRenderWindow::Start() + 39
> 18  libvtkRendering.5.0.dylib      	0x24cae30c
> vtkRenderWindow::DoStereoRender() + 26
> 19  libvtkRendering.5.0.dylib      	0x24cae2e7
> vtkRenderWindow::DoFDRender() + 1241
> 20  libvtkRendering.5.0.dylib      	0x24cade02
> vtkRenderWindow::DoAARender() + 1898
> 21  libvtkRendering.5.0.dylib      	0x24cad497
> vtkRenderWindow::Render() + 1751
> 22  ...tkRenderingJava.5.0.2.dylib 	0x24bac863
> Java_vtk_vtkRenderWindow_Render_17 + 63
> 23  <<00000000>> 	0x04587077 0 + 72904823
> 24  <<00000000>> 	0x0457f913 0 + 72874259
> 25  <<00000000>> 	0x0457f913 0 + 72874259
> 26  <<00000000>> 	0x0457f913 0 + 72874259
> 27  <<00000000>> 	0x0457f913 0 + 72874259
> 28  <<00000000>> 	0x0457f913 0 + 72874259
> 29  <<00000000>> 	0x0457f913 0 + 72874259
> 30  <<00000000>> 	0x0457fc19 0 + 72875033
> 31  <<00000000>> 	0x0457f913 0 + 72874259
> 32  <<00000000>> 	0x0457f913 0 + 72874259
> 33  <<00000000>> 	0x0457f913 0 + 72874259
> 34  <<00000000>> 	0x0457fa6b 0 + 72874603
> 35  <<00000000>> 	0x0457f913 0 + 72874259
> 36  <<00000000>> 	0x0457f913 0 + 72874259
> 37  <<00000000>> 	0x0457f913 0 + 72874259
> 38  <<00000000>> 	0x0457d15d 0 + 72864093
> 39  libclient.dylib                	0x9fc55ce2 jio_snprintf + 398024
> 40  libclient.dylib                	0x9fc622f3 JVM_StartThread +
> 2385
> 41  libclient.dylib                	0x9fc62205 JVM_StartThread +
> 2147
> 42  libclient.dylib                	0x9fc62151 JVM_StartThread +
> 1967
> 43  libclient.dylib                	0x9fc62083 JVM_StartThread +
> 1761
> 44  libclient.dylib                	0x9fbecc31 JNI_CreateJavaVM_Impl
> + 52845
> 45  libSystem.B.dylib              	0x90023d87 _pthread_body + 84
>
> Thread 15 crashed with X86 Thread State (32-bit):
>   eax: 0x00000000    ebx: 0x9e23d14b ecx: 0x00000000 edx: 0x003c5a60
>   edi: 0x003c59c0    esi: 0x00000079 ebp: 0xb0f8e9e8 esp: 0xb0f8e830
>    ss: 0x0000001f    efl: 0x00010206 eip: 0x9e23d245  cs: 0x00000017
>    ds: 0x0000001f     es: 0x0000001f  fs: 0x0000001f  gs: 0x00000037
>
>
> Kustaa Nyholm
> Research Manager, Software
> Research and Technology Division
> PLANMECA OY
> Asentajankatu 6
> 00880 HELSINKI
> FINLAND
>
> Please note our new telephone and fax numbers!
> Tel: +358 20 7795 572 (direct)
> Fax: +358 20 7795 676
> GSM: +358 40 580 5193
> e-mail: kustaa.nyholm at planmeca.com
>
> This e-mail may contain confidential or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in  
> this
> e-mail is strictly forbidden. We will not be liable for direct,
> indirect, special or consequential damages arising from alteration of
> the contents of this message by a third party or as a result of any
> virus being passed for viruses.
>
>




More information about the vtkusers mailing list