Icy crashes when clicking 3D view (MacOS Catalina)

I have icy crashing every time I try to see the volume in 3D (Macbook Pro, Mac OS Catalina 10.15.5). Icy opens fine, loads the images just fine but when I click the 3D button the program just crashes. Here’s the output when I run the app in the terminal (in case it helps):

Apple AWT Internal Exception: NSWindow drag regions should only be invalidated on the Main Thread!
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'

*** First throw call stack:
(
0   CoreFoundation                      0x00007fff324cfbe7 __exceptionPreprocess + 250
1   libobjc.A.dylib                     0x00007fff6b2a75bf objc_exception_throw + 48
2   CoreFoundation                      0x00007fff324f83dc -[NSException raise] + 9
3   AppKit                              0x00007fff2f6f6ddc -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 310
4   AppKit                              0x00007fff2f6de842 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1416
5   AppKit                              0x00007fff2f6de2b3 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42
6   libnativewindow_macosx.jnilib       0x000000016b1f56be Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 382
7   ???                                 0x0000000112d286c7 0x0 + 4610754247
)

libc++abi.dylib: terminating with uncaught exception of type NSException
1 Like

Dear niseto,

VTK (the library we are using for visualization) is often prone to crash on MacOSX. Internally it’s using OpenGL2 so maybe you can try to check if something can de done on the video card driver but honestly i’m not sure how much that can be fixed as i saw several topics about VTK issues on later OSX :

Also Icy is using the old VTK 6.3 version, i don’t have recent MacOS version here to test but maybe it’s not anymore supported on 10.15.5
Maybe some people having the same OS than you with a working Icy can provide more information about their system so you can spot the difference with your.

Best,

– Stephane

I think the crash is general. I could reproduce it on 3 difference Mac with 10.14 -> 10.15.

2 Likes

Thanks for confirming @tinevez ! We will investigate the issue but it’s possible that VTK 6.3 is simply not anymore supported on newer OSX :-/
The solution would be to upgrade VTK version but that is something that always scary us a bit :sweat_smile:

Have you checked your Java version? I had a very similar Icy crash running Archlinux with java-14-openjdk. I tried with java-8-openjdk/jre (as recommended in the installation notes) and Icy/3D vtk visualization worked.

Best, Jose.

1 Like

After lots of trials I still can’t get it working properly.
When I use openjdk 1.8 in Archlinux I can see a 3D rendering in icy but as soon as I move the mouse or hit play I get a terrible low quality image (pixelated view of the images). Same for fixed samples (no time). If I don’t do anything to the image and I click on export snapshot either icy crashes or a get a completely none sense image as output.

I have tried with openjdk1.7, 1.8, 11, 12, 14 and oracle’s implementation. The best one is 1.8 but far from good. I have tried in archlinux and debian buster. In buster icy crashes regardless of the java version I try.

I don’t think is a “purely” java problem but I couldn’t narrow down the problem. I have even tried virtualizing ubuntu but no success there. Probably not an icy related issue in this case.

I will try to get my hands on a windows or old mac computer and see what happens there.

Best, jose.

Here I include one of the error logs I get after a crash, which is not always the problem.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f4bfa0b31d8, pid=10806, tid=0x00007f4b828e0700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_172-b11) (build 1.8.0_172-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.172-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libawt_xawt.so+0x421d8]  ReadRegionsInList+0x3b8
#
# Core dump written. Default location: /home/netlak/core or core.10806
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00007f4ba466e800):  JavaThread "3D-V-IMP-updater" daemon [_thread_in_native, id=10919, stack(0x00007f4b827e0000,0x00007f4b828e1000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000068

Registers:
RAX=0x0000000000000200, RBX=0x0000000000000000, RCX=0x0000000000001bc1, RDX=0x0000000000000000
RSP=0x00007f4b828df110, RBP=0x00007f4b828df220, RSI=0x0000000000000000, RDI=0x0000000000000000
R8 =0x0000000000000010, R9 =0x00007f4be0088480, R10=0x0000000000001000, R11=0x00007f4be0088c10
R12=0x0000000000000000, R13=0x0000000000000000, R14=0x00007f4be0085410, R15=0x0000000000000200
RIP=0x00007f4bfa0b31d8, EFLAGS=0x0000000000010246, CSGSFS=0x002b000000000033, ERR=0x0000000000000004
  TRAPNO=0x000000000000000e
--------------  S Y S T E M  ---------------

OS:NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux

uname:Linux 5.8.1-arch1-1 #1 SMP PREEMPT Wed, 12 Aug 2020 18:50:43 +0000 x86_64
libc:glibc 2.31 NPTL 2.31 
rlimit: STACK 8192k, CORE infinity, NPROC 63633, NOFILE 524288, AS infinity
load average:0,97 1,33 1,34

/proc/meminfo:
MemTotal:       16309188 kB
MemFree:         7853276 kB
MemAvailable:   11452820 kB
Buffers:          210212 kB
Cached:          3778820 kB
SwapCached:            0 kB
Active:          6216100 kB
Inactive:        1688424 kB
Active(anon):    4092068 kB
Inactive(anon):    96964 kB
Active(file):    2124032 kB
Inactive(file):  1591460 kB
Unevictable:      158020 kB
Mlocked:             312 kB
SwapTotal:       4095996 kB
SwapFree:        4095996 kB
Dirty:               252 kB
Writeback:             0 kB
AnonPages:       4073808 kB
Mapped:           563604 kB
Shmem:            273344 kB
KReclaimable:     220080 kB
Slab:             296176 kB
SReclaimable:     220080 kB
SUnreclaim:        76096 kB
KernelStack:       12176 kB
PageTables:        24356 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    12250588 kB
Committed_AS:    8205844 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       31872 kB
VmallocChunk:          0 kB
Percpu:             2304 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      332684 kB
DirectMap2M:     9019392 kB
DirectMap1G:     8388608 kB


CPU:total 4 (initial active 4) (2 cores per cpu, 2 threads per core) family 6 model 60 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2

/proc/cpuinfo:
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping	: 3
microcode	: 0x28
cpu MHz		: 2815.253
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
vmx flags	: vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds
bogomips	: 5189.98
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping	: 3
microcode	: 0x28
cpu MHz		: 2632.038
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
vmx flags	: vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds
bogomips	: 5189.98
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping	: 3
microcode	: 0x28
cpu MHz		: 2596.231
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
vmx flags	: vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds
bogomips	: 5189.98
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping	: 3
microcode	: 0x28
cpu MHz		: 2594.723
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
vmx flags	: vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds
bogomips	: 5189.98
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:



Memory: 4k page, physical 16309188k(7853276k free), swap 4095996k(4095996k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.172-b11) for linux-amd64 JRE (1.8.0_172-b11), built on Mar 28 2018 21:44:09 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)

time: Thu Aug 20 23:45:29 2020
elapsed time: 68 seconds (0d 0h 1m 8s)

Here I attach a vtk.log file generated after a crash. Seems an vtk issue as Stephane suggested.

Warning: In /home/stephane/Documents/dev/vtk/6.3/source/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 428
vtkGenericOpenGLRenderWindow (0x7f03245f2da0): VTK is designed to work with OpenGL version 3.2 but it appears it has been given a context that does not support 3.2. VTK will run in a compatibility mode designed to work with OpenGL 2.1 but some features may not work.


ERROR: In /home/stephane/Documents/dev/vtk/6.3/source/Rendering/OpenGL2/vtkShaderProgram.cxx, line 366
vtkShaderProgram (0x7f0327caaef0): 1: /*=========================================================================
2: 
3:   Program:   Visualization Toolkit
4:   Module:    vtkPolyDataFS.glsl
5: 
6:   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7:   All rights reserved.
8:   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9: 
10:      This software is distributed WITHOUT ANY WARRANTY; without even
11:      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12:      PURPOSE.  See the above copyright notice for more information.
13: 
14: =========================================================================*/
15: // Template for the polydata mappers fragment shader
16: 
17: // The following line handle system declarations such a
18: // default precisions, or defining precisions to null
19: #version 120
20: #extension GL_EXT_gpu_shader4 : require
21: #define highp
22: #define mediump
23: #define lowp
24: 
25: uniform int PrimitiveIDOffset;
26: 
27: // VC position of this fragment
28: //VTK::PositionVC::Dec
29: 
30: // optional color passed in from the vertex shader, vertexColor
31: uniform float opacityUniform; // the fragment opacity
32: uniform vec3 ambientColorUniform; // intensity weighted color
33: uniform vec3 diffuseColorUniform; // intensity weighted color
34: 
35: 
36: // optional surface normal declaration
37: //VTK::Normal::Dec
38: 
39: // extra lighting parameters
40: //VTK::Light::Dec
41: 
42: // Texture coordinates
43: //VTK::TCoord::Dec
44: 
45: // picking support
46: //VTK::Picking::Dec
47: 
48: // Depth Peeling Support
49: //VTK::DepthPeeling::Dec
50: 
51: // clipping plane vars
52: //VTK::Clip::Dec
53: 
54: // the output of this shader
55: //VTK::Output::Dec
56: 
57: // Apple Bug
58: //VTK::PrimID::Dec
59: 
60: void main()
61: {
62:   // Apple Bug
63:   //VTK::PrimID::Impl
64: 
65:   //VTK::Clip::Impl
66: 
67:   vec3 ambientColor;
68:   vec3 diffuseColor;
69:   float opacity;
70:   ambientColor = ambientColorUniform;
71:   diffuseColor = diffuseColorUniform;
72:   opacity = opacityUniform;
73: 
74: 
75:   // Generate the normal if we are not passed in one
76:   //VTK::Normal::Impl
77: 
78:   gl_FragData[0] =  vec4(ambientColor + diffuseColor, opacity);
79: 
80:   //VTK::TCoord::Impl
81: 
82:   if (gl_FragData[0].a <= 0.0)
83:     {
84:     discard;
85:     }
86: 
87:   //VTK::DepthPeeling::Impl
88: 
89:   //VTK::Picking::Impl
90: 
91: }
92: 



ERROR: In /home/stephane/Documents/dev/vtk/6.3/source/Rendering/OpenGL2/vtkShaderProgram.cxx, line 367
vtkShaderProgram (0x7f0327caaef0): 0:20(12): error: extension `GL_EXT_gpu_shader4' unsupported in fragment shader
1 Like

Thanks for the VTK log error, very informative.
So from this message it looks like this is a video card driver issue, i found some messages about this error :

Do you can try to do that if possible, update your video card driver and see if that helps.

Best,

– Stephane

1 Like

@Stephane @tinevez

I just ran into a similar issue playing with JOGL (unrelated to ICY, but maybe it helps…)
I also had the crash with

*** First throw call stack:
(
0   CoreFoundation                      0x00007fff324cfbe7 __exceptionPreprocess + 250
1   libobjc.A.dylib                     0x00007fff6b2a75bf objc_exception_throw + 48
2   CoreFoundation                      0x00007fff324f83dc -[NSException raise] + 9
3   AppKit                              0x00007fff2f6f6ddc -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 310
4   AppKit                              0x00007fff2f6de842 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1416
5   AppKit                              0x00007fff2f6de2b3 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42
6   libnativewindow_macosx.jnilib       0x000000016b1f56be Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 382
7   ???                                 0x0000000112d286c7 0x0 + 4610754247
)

for the latest openjdk 1.8 version.
Apparently this is resolved in the latest jogl 2.4.0 release candidate


Using this release candidate resolves it for me.
If it is an option to build ICY with these jars, that might help to solve it…
3 Likes

Thanks for the information @tpietzsch !
From the log detail i though it was related to an OpenGL version support issue from the video card driver but maybe there is a bug in the JOGL library which made it crashing on new OSX version.
Unfortunately we are kind of stuck with JOGL 2.1.5 with VTK, as this is the version used the build our (old) VTK 6.3 bundled with Icy and upgrading to newer version would break VTK. I need to test again but i think that is the case, but iIf it work with newer JOGL then we will try to upgrade to the last version :slight_smile:

1 Like

Unfortunately i tested VTK 6.3 with new JOGL 2.4 and it doesn’t work, so that means we will have to upgrade VTK version to fix the problem (hoping newer VTK are compatible with JOGL 2.4). Upgrading VTK version is definitely not a small task so it may take sometime before seeing it in Icy. Another (small) problem is that JOGL 2.4.0 is still only release candidate so not yet available on maven but that is not a big issue though.

– Stephane

Dear all,
I am having same issue as reported here.
Running ICY 2.1.0.1 in a MacBook Pro Retina (mid 2012), OSX Catalina 10.15.7
I have tried running java 9, 1.8, but no luck.
Indeed it seems some incompatibility between VTK and new OSX.
Please let me know if there is any log I can send to help you.
Looking forward to have a nice fix for this.
Best.
Murilo

1 Like

Thanks for reporting !
I think we have now all required information to fix the problem, just need sometime to do it.
We will post our progress here to keep you informed :slight_smile:

Best,

– Stephane

2 Likes