[vtkusers] VTK6 and Java Cone Example 5

Ric Wright rkwright at geofx.com
Mon Aug 5 17:10:55 EDT 2013


Well, a little playing around didn't seem to help, but I am frankly not an
expert on threads.  However, it seems to me that the source of the problem
is that the vtkRenderWindowInteractor gets initialized then the start()
method creates an event loop that is monitored by the
vtkRenderWindowInteractor.  I suspect that start() method spawns a new
thread to listen to the events and it is the spawning of that thread that
causes the exception.

But I am a newbie to VTK and no expert on threads.  I have attached the
revised Sample/Cone5.java that demonstrates the problem if someone else
wants to experiment with it.

Thanks
Ric


From:  Sebastien Jourdain <sebastien.jourdain at kitware.com>
Date:  Monday, August 5, 2013 3:51 PM
To:  Ric Wright <rkwright at geofx.com>
Cc:  vtkusers <vtkusers at vtk.org>
Subject:  Re: [vtkusers] VTK6 and Java Cone Example 5

Try to run the content of the main in the EDT to see if that change?

Seb


On Mon, Aug 5, 2013 at 3:55 PM, Ric Wright <rkwright at geofx.com> wrote:
> SO I worked my way through the Java Examples in VTK/Examples/Tutorial,
> converting each to an Eclipse project, correcting the load library calls.
> They all worked until I reach # 5, which differs from the others in that it
> has the following code:
> 
> vtkInteractorStyleTrackballCamera style = new
> vtkInteractorStyleTrackballCamera();
>      iren.SetInteractorStyle(style);
> 
>      iren.Initialize();
>      iren.Start();
> 
> This causes:
> 
> 2013-08-05 14:38:21.256 java[6596:1203] *** Assertion failure in
> +[NSUndoManager _endTopLevelGroupings],
> /SourceCache/Foundation/Foundation-945.18/Misc.subproj/NSUndoManager.m:328
> 2013-08-05 14:38:21.256 java[6596:1203] +[NSUndoManager(NSInternal)
> _endTopLevelGroupings] is only safe to invoke on the main thread.
> 2013-08-05 14:38:21.258 java[6596:1203] (
> 0   CoreFoundation                      0x00007fff880b2b06
> __exceptionPreprocess + 198
> 1   libobjc.A.dylib                     0x00007fff90a073f0
> objc_exception_throw + 43
> 2   CoreFoundation                      0x00007fff880b2948 +[NSException
> raise:format:arguments:] + 104
> 3   Foundation                          0x00007fff92f914c2
> -[NSAssertionHandler
> handleFailureInMethod:object:file:lineNumber:description:] + 189
> 4   Foundation                          0x00007fff92ff7807
> +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156
> 5   AppKit                              0x00007fff8bea024d -[NSApplication
> run] + 687
> 6   libvtkRenderingOpenGL-6.0.1.dylib   0x00000001177ee284 -[vtkCocoaServer
> start] + 244
> 7   libvtkRenderingOpenGL-6.0.1.dylib   0x00000001177eea09
> _ZN30vtkCocoaRenderWindowInteractor5StartEv + 265
> 8   libvtkRenderingCoreJava.dylib       0x00000001172fc3b1
> Java_vtk_vtkRenderWindowInteractor_Start_15 + 49
> 9   ???                                 0x000000010df1ecd5 0x0 + 4528925909
> <tel:%2B%204528925909>
> 10  ???                                 0x000000010df0d8da 0x0 + 4528855258
> <tel:%2B%204528855258>
> 
> This is apparently a Cocoa problem on 64 bit systems:
> 
> http://www.dsource.org/forums/viewtopic.php?t=5762&sid=e34eedb51399e9c6776536c
> 3d0da67ef
> 
> https://bugreports.qt-project.org/browse/QTBUG-7393
> 
> http://code.google.com/p/ultra-finance/issues/detail?id=5
> 
> I am on OSX 10.8.4 64 bit, MBP.
> 
> Oddly, though, in the debugger there APPEARS to be only one thread when the
> exception occurs and it is labelled (main) but it could be that Eclipse (which
> itself tends to use lots of threads) may be using what OSX thinks is the main
> thread and so this widget is being created in not-the-real-main-thread.
> 
> Haven't dug into it any farther.
> 
> Ric
> 
> 
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com>
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130805/63b2291c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cone5.java
Type: application/octet-stream
Size: 4412 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130805/63b2291c/attachment.obj>


More information about the vtkusers mailing list