<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi, Ken,<br>
<br>
I have found two issues here. First, I think the
vtk.sample.VTKCanvas example (on which I based my simplified code)
might be wrong because it does not call frame.setVisible in EDT.
From what I have seen in other examples frame.setVisible should be
called from InvokeLater. Note that there are other places in Java
examples where JFrame.setVisible is called _NOT_ from within
InvokeLater. If this is an error, it might be a good idea to fix
this.. At least for me changing this partly fixed the problem, i.e.,
the error was more difficult for me to get in the example, but not
in my real code, where frame.setVisible is called from EDT (I am
_almost_ certain of this, as I call Java indirectly from MATLAB, and
I do use MATLABs EDT framework).<br>
<br>
Hunting the real problem, I have already mentioned that I got error
from glewInit. Writing out the reason for the error gave me 'Missing
GL version'. I am no expert in OpenGL, so I googled around and
understood that this might mean that glewInit was called before
OpenGL context was created. Due to this fact glew was not
initialized and the code segfaulted on call to glBlendFuncSeparate
in OpenGLInitState due to the address being NULL. <br>
<br>
This made me experiment with vtkOpenGLRenderWindow and
vtkXOpenGLRenderWindow. I have found that from 6.2 you have changed
the initialization in vtkXOpenGLRenderWindow::CreateAWindow. In
particular, you have added the if statement after '// try for 32
context'. Being desperate I have commented out the entire
if(this->internal->fbconfig) statement. This worked for me,
i.e., I did not manage to get a glewInit error after the change.
Neither in my code, nor in the VTKCanvas sample.<br>
<br>
I do not know exactly what this code does, but it might need a
second look. From the observed behavior it was very much like a race
condition: I was getting the glewInit 'Missing GL version' condition
sometimes, but not always. Of course, this might mean that
commenting out those lines does not fix anything, just hides the
problem.<br>
<br>
Let me know if you need more information - I will gladly work
towards fixing this.<br>
<br>
Marcin<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 09/08/2015 02:47 PM, Ken Martin
wrote:<br>
</div>
<blockquote
cite="mid:8235b87906c3f45aca23856ba5665409@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
<div class="WordSection1">
<p class="MsoNormal"><a moz-do-not-send="true"
name="_MailEndCompose"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Can
either of you verify that the VTK C++ tests work on the
system? E.g. ctest –R Mace passes? Just trying to see if
this is a general system/VM issue or tied specifically to
Java/OpenGL2 interactions.</span></a></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ken</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<div>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ken
Martin PhD</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Chairman
& CFO</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Kitware
Inc.</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">28
Corporate Drive</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Clifton
Park NY 12065</span></p>
<p class="MsoNormal"><a moz-do-not-send="true"
href="mailto:ken.martin@kitware.com"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif"">ken.martin@kitware.com</span></a><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">919
869-8871 (w)</span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This
communication, including all attachments, contains
confidential and legally privileged information, and it is
intended only for the use of the addressee. Access to
this email by anyone else is unauthorized. If you are not
the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is
prohibited and may be unlawful. If you received this
communication in error please notify us immediately and
destroy the original message. Thank you.</span></p>
</div>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<div>
<div style="border:none;border-top:solid #b5c4df
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
vtkusers [mailto:<a moz-do-not-send="true"
href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a>]
<b>On Behalf Of </b>Jens Schmidt<br>
<b>Sent:</b> Monday, September 7, 2015 12:53 PM<br>
<b>To:</b> marcin.krotkiewski; VTK Users<br>
<b>Subject:</b> Re: [vtkusers] segfault with Opengl2 in
6.3.0.rc2</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom:12.0pt">To chime in,
the jvm (1.8.60) crashes on debian jessie (virtualbox) when
using the opengl2 rendering backend (vtk 6.3.0rc1 and rc2) and
the swtComponent. The old OpenGL works fine.<br>
When not using virtualbox's 3d accelleration the window wont
even open. When activating the 3d accelleration you get a
window but as soon as you add some actors and call update it
crashes (some of the time).<br>
Also the jvm crashes when running everything on "real"
hardware (Intel HD Graphics 4600) instead of a virtual
machine. <br>
Unfortunately i cannot access the logs right now (vacation) if
this still is an issue after, i happily provide any logs you
desire :-)<br>
Just wanted to let you know, keep up the good work!<br>
<br>
<br>
i also have segfaults with the opengl2 backend on linux
(debian jessie) running on virtualbox.<br>
<br>
</p>
<div>
<p class="MsoNormal">Am 05.09.2015 um 21:32 schrieb
marcin.krotkiewski:</p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">I keep getting segfaults when using
vtk.sample.VTKCanvas with OpenGL2 backend in 6.3.0.rc2. This
does not happen with 6.2.0 + OpenGL2, nor with the standard
OpenGL backend. I use ubuntu 14.04 and compile with gcc
4.9.2 and jdk1.8.0_60. <br>
<br>
On my laptop, the segfaults are 100 reproducible with mesa
library - some lines from glxinfo: <br>
<br>
<br>
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile <br>
OpenGL core profile version string: 3.3 (Core Profile) Mesa
10.1.3 <br>
OpenGL core profile shading language version string: 3.30 <br>
<br>
<br>
When I use the high performance card (fglrx drivers, Radeon
HD 8790M) the segfaults sometimes happen, sometimes not.
Lines from glxinfo: <br>
<br>
<br>
OpenGL vendor string: Advanced Micro Devices, Inc. <br>
OpenGL renderer string: AMD Radeon HD 8790M <br>
OpenGL core profile version string: 4.3.13374 Core Profile
Context 15.20.1013 <br>
OpenGL core profile shading language version string: 4.40 <br>
<br>
<br>
I have attached a simplified java code based on VTKCanvas -
In my experience this one segfaults always, both with mesa,
and with Radeon drivers. I get the following line before vtk
dies: <br>
<br>
<br>
ERROR: In
/home/angainor/bergverk/vtk/VTK-6.3.0.rc2/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx,
line 412 <br>
vtkXOpenGLRenderWindow (0x7f110429aa90): GLEW could not be
initialized. <br>
<br>
<br>
And this is the top of the stack reported by the dying Java
VM <br>
<br>
<br>
R11=0x00007fcbd8a79840: <offset 0x72840> in
/usr/lib/fglrx/libGL.so.1 at 0x00007fcbd8a07000 <br>
<br>
Stack: [0x00007fcbb94e4000,0x00007fcbb95e5000],
sp=0x00007fcbb95e1148, free space=1012k <br>
Java frames: (J=compiled Java code, j=interpreted, Vv=VM
code) <br>
j vtk.vtkRenderWindow.Render_9()V+0 <br>
j vtk.vtkRenderWindow.Render()V+1 <br>
j vtk.vtkPanel.Render()V+164 <br>
j vtk.vtkPanel.paint(Ljava/awt/Graphics;)V+1 <br>
<br>
[...] <br>
<br>
<br>
It seems that this is a problem specific to 6.3.0.rc2 with
OpenGL2. I could not reproduce it for 6.2.0, nor when using
OpenGL backend. Do you know any reason why this could
happen? I will be happy to provide more information and help
to solve this. <br>
<br>
Cheers, <br>
<br>
Marcin <br>
<br>
<br>
<br>
<br>
</p>
<pre>_______________________________________________</pre>
<pre>Powered by <a moz-do-not-send="true" href="http://www.kitware.com">www.kitware.com</a></pre>
<pre> </pre>
<pre>Visit other Kitware open-source projects at <a moz-do-not-send="true" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></pre>
<pre> </pre>
<pre>Please keep messages on-topic and check the VTK FAQ at: <a moz-do-not-send="true" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a></pre>
<pre> </pre>
<pre>Search the list archives at: <a moz-do-not-send="true" href="http://markmail.org/search/?q=vtkusers">http://markmail.org/search/?q=vtkusers</a></pre>
<pre> </pre>
<pre>Follow this link to subscribe/unsubscribe:</pre>
<pre><a moz-do-not-send="true" href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a></pre>
</blockquote>
<p class="MsoNormal"> </p>
</div>
</blockquote>
<br>
</body>
</html>