macoS crashes with 2019.0beta1

36 views
Skip to first unread message

Niklas Mischkulnig

unread,
Jan 26, 2019, 12:38:32 PM1/26/19
to hugin and other free panoramic software
Hello,

with 2019.0beta1, calibrate_lens_gui.app sometimes crashes on startup (crashdump attached - lensgui.txt).

When closing Hugin itself, it seems to get into an infinite loop and segfaults (hugin.txt).

(macOS 10.13.6)


Niklas
hugin.txt
lensgui.txt

T. Modes

unread,
Jan 26, 2019, 1:08:24 PM1/26/19
to hugin and other free panoramic software
Hi Niklas,


Am Samstag, 26. Januar 2019 18:38:32 UTC+1 schrieb Niklas Mischkulnig:
with 2019.0beta1, calibrate_lens_gui.app sometimes crashes on startup (crashdump attached - lensgui.txt).
This  seems to come from the code to retrieve the currently active monitor color profile:
HuginBase::Color::GetMonitorProfile in src/hugin1/base_wx/wxcms.cpp, line 166
This is platform depend code. I can't debug it from here. It is surprising that is starts now. The Mac OS code was written in 2016 and stayed untouched in the meantime.
Maybe there was some changes on Mac OS side?
Could you try to try to isolate the crash further? (Run in a debugger?)

When closing Hugin itself, it seems to get into an infinite loop and segfaults (hugin.txt).
I'm currently debugging this one.

Thomas

T. Modes

unread,
Jan 26, 2019, 2:09:06 PM1/26/19
to hugin and other free panoramic software


Am Samstag, 26. Januar 2019 19:08:24 UTC+1 schrieb T. Modes:

When closing Hugin itself, it seems to get into an infinite loop and segfaults (hugin.txt).
I'm currently debugging this one.
I committed a fix. Hopefully this works also for you.

Thomas

Niklas Mischkulnig

unread,
Jan 26, 2019, 2:31:12 PM1/26/19
to hugin and other free panoramic software

Hi Thomas,


Am Samstag, 26. Januar 2019 19:08:24 UTC+1 schrieb T. Modes:

This is platform depend code. I can't debug it from here. It is surprising that is starts now. The Mac OS code was written in 2016 and stayed untouched in the meantime. 
Maybe there was some changes on Mac OS side?


It seems to happen only when f.lux is making my screen more reddish, I guess I never ran that app that late in the evening?

And it's not the platform specific part: http://hg.code.sf.net/p/hugin/hugin/file/7745efc3e3c7/src/hugin1/base_wx/wxcms.cpp#l205

 

Could you try to try to isolate the crash further? (Run in a debugger?)

 

cmsCloseProfile fails, but it should really just return false on error? 


Given that the segfault happens on a member access, I would say that hProfile isn't actually a cmsHPROFILE object? 


// Closes a profile freeing any involved resources

cmsBool  CMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile)

{

  _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile;


  // ..


  if (Icc ->IsWrite) { // <-------------------------------- segfault




Adding std::cout << profile << "\n"; here prints 0xffffffffffffffff, not sure what printing is actually printed here, but seems quite suspicious.



Process 49904 stopped

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x7fff7d8b9baf)

    frame #0: 0x0000000101eff6f6 liblcms2.2.dylib`cmsCloseProfile + 38

liblcms2.2.dylib`cmsCloseProfile:

->  0x101eff6f6 <+38>: movl   $0x0, 0xe98(%r13)

    0x101eff701 <+49>: movq   (%r13), %r15

    0x101eff705 <+53>: movq   0x8(%r13), %rdi

    0x101eff709 <+57>: addq   $0x18, %r15

Target 0: (calibrate_lens_gui) stopped.

(lldb) bt

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x7fff7d8b9baf)

  * frame #0: 0x0000000101eff6f6 liblcms2.2.dylib`cmsCloseProfile + 38

    frame #1: 0x000000010031dabf libhuginbasewx.0.0.dylib`HuginBase::Color::GetMonitorProfile(profileName=0x00007ffeefbfcd50, profile=0x0000000103899fb8) at wxcms.cpp:206

    frame #2: 0x000000010004411a calibrate_lens_gui`LensCalImageCtrl::LensCalImageCtrl(this=0x0000000103899c00) at LensCalImageCtrl.cpp:60

    frame #3: 0x00000001000443c5 calibrate_lens_gui`LensCalImageCtrl::LensCalImageCtrl(this=0x0000000103899c00) at LensCalImageCtrl.cpp:45

 



Am Samstag, 26. Januar 2019 20:09:06 UTC+1 schrieb T. Modes:

I committed a fix. Hopefully this works also for you.


Yes, it does.



Niklas

Niklas Mischkulnig

unread,
Jan 26, 2019, 2:36:56 PM1/26/19
to hugin and other free panoramic software
Actually, the profile passed to GetMonitorProfile is never initialized, this fixes it:

diff --git a/src/hugin1/calibrate_lens/LensCalImageCtrl.cpp b/src/hugin1/calibrate_lens/LensCalImageCtrl.cpp
--- a/src/hugin1/calibrate_lens/LensCalImageCtrl.cpp
+++ b/src/hugin1/calibrate_lens/LensCalImageCtrl.cpp
@@ -55,6 +55,7 @@
     m_c=0;
     m_d=0;
     m_e=0;
+    m_monitorProfile=NULL;
     // load monitor profile
     wxString profileName;
     HuginBase::Color::GetMonitorProfile(profileName, m_monitorProfile);


Niklas

T. Modes

unread,
Jan 26, 2019, 3:16:59 PM1/26/19
to hugin and other free panoramic software
Hi Niklas


Am Samstag, 26. Januar 2019 20:36:56 UTC+1 schrieb Niklas Mischkulnig:
Actually, the profile passed to GetMonitorProfile is never initialized, this fixes it:

good catch. Thanks for debugging this and providing the patch. I committed the patch to the repository.

Thomas

Reply all
Reply to author
Forward
0 new messages