Hugin crashes on opening pto file (OS X)

Bug #1065780 reported by Willeke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hugin
Fix Released
Undecided
Unassigned

Bug Description

Hugin crashes from time to time on opening a pto file. It seems to hapen more often when other programs are open in the background.
The same pto file can open 10 times without a problem and then 4 times cause Hugin to crash.

Hugin 2011.4.0 (Mac)
OS X 10.6.8
iMac7,1, Intel Core 2 Duo, 2.4 GHz, 4 GB
Activity monitor: page-outs: 0 bytes, free memory 1.95 GB
pto file with 2 or 4 TIFF images, 16 bit gray, 717 x 2706, 3.9 MB

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Application Specific Information:
abort() called

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libSystem.B.dylib 0x922a4c5a __kill + 10
1 libSystem.B.dylib 0x922a4c4c kill$UNIX2003 + 32
2 libSystem.B.dylib 0x923375a5 raise + 26
3 libSystem.B.dylib 0x9234d6e4 abort + 93
4 net.sourceforge.hugin.Hugin 0x001b877d celeste::SafeAbs(int) + 125
5 net.sourceforge.hugin.Hugin 0x00039428 boost::shared_ptr<HuginBase::ImageCache::Entry>::operator->() const + 56
6 net.sourceforge.hugin.base_wx 0x011650a7 HuginBase::ImageCache::postEvent(boost::shared_ptr<HuginBase::ImageCache::Request>, boost::shared_ptr<HuginBase::ImageCache::Entry>) + 183
7 net.sourceforge.hugin.Hugin 0x0000fa95 huginApp::relayImageLoaded(ImageReadyEvent&) + 85
8 libwx_macu-2.8.0.7.0.dylib 0x005dbbb2 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 114

In Console:
12-10-12 03:00:00 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] MainFrame::RestoreLayoutOnNextResize()
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] Number of images 4
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] ContractViolation:
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] Precondition violation!
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] Unable to open file ''.
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] (/Users/Shared/development/hugin_related/hugin-2011.4.0/mac/../src/foreign/vigra/vigra_impex/codecman:206)
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] ERROR: 03:00:54.104600 (/Users/Shared/development/hugin_related/hugin-2011.4.0/mac/../src/hugin_base/huginapp/ImageCache.cpp:658) loadImageSafely(): Error during image reading:
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] Precondition violation!
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] Unable to open file ''.
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] (/Users/Shared/development/hugin_related/hugin-2011.4.0/mac/../src/foreign/vigra/vigra_impex/codecman:206)
12-10-12 03:00:54 [0x0-0x90090].net.sourceforge.hugin.Hugin[958] /Users/Shared/development/hugin_related/ExternalPrograms/3way-repository/include/boost/smart_ptr/shared_ptr.hpp:418: failed assertion `px != 0'
12-10-12 03:00:54 com.apple.launchd.peruser.502[100] ([0x0-0x90090].net.sourceforge.hugin.Hugin[958]) Job appears to have crashed: Abort trap
12-10-12 03:00:55 ReportCrash[966] Saved crash report for Hugin[958] version 2011.4.0 (cf9be9344356) to /Users/Willeke/Library/Logs/DiagnosticReports/Hugin_2012-10-12-030055_imac-van-willeke.crash

Also from Console, another attempt, didn't crash:
12-10-12 01:24:45 [0x0-0x3a03a].net.sourceforge.hugin.Hugin[410] ERROR: 01:24:45.271502 (/Users/Shared/development/hugin_related/hugin-2011.4.0/mac/../src/hugin_base/huginapp/ImageCache.cpp:934) loadSafely(): Please set HuginBase::ImageCache::getInstance().asyncLoadCompleteSignal to handle asynchronous image loads.

Revision history for this message
Willeke (willeke2007) wrote :
Revision history for this message
Willeke (willeke2007) wrote :
Revision history for this message
tmodes (tmodes) wrote :

I can't reproduce it. It may be connected with your image file (gray image).
Could you provide a link to one or two image files?
Or try with the image converted to a "coloured" tif.

Changed in hugin:
status: New → Incomplete
Revision history for this message
Willeke (willeke2007) wrote :

I tried different image formats but 8 bit gray, 32 bit color and jpeg make Hugin crash.

After some experimenting it appears that Hugin always crashes on my Mac after these steps:
- Take two small screen shots, ± 80 x 60 pixels.
- Remove hugin Preferences.
- Start Hugin.
- Drag the images into the images pane, fov = 10.
- Save.
- Open Fast Preview window and make it bigger so the images are visible.
- Quit Hugin.
- Change the name of one of the image files.
- Double click the pto file in the Finder.
- Hugin says "image file not found" and crashes.

I tried to do some debugging and put a break in getFileTypeByMagicString. Before "Unable to open file ''." is logged, filename.c_str() is
0xa00aadbc <_ZNSs4_Rep20_S_empty_rep_storageE+12>: ""

#0 0x00fb5b45 in vigra::CodecManager::getFileTypeByMagicString ()
#1 0x00fb5fdf in vigra::CodecManager::getDecoder ()
#2 0x00fb634c in vigra::getDecoder ()
#3 0x00fbfdba in vigra::ImageImportInfo::ImageImportInfo ()
#4 0x01160217 in HuginBase::ImageCache::loadImageSafely ()
#5 0x0116407b in HuginBase::ImageCache::loadSafely ()
#6 0x01168007 in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(boost::shared_ptr<HuginBase::ImageCache::Request>, boost::shared_ptr<HuginBase::ImageCache::Entry>), boost::_bi::list2<boost::_bi::value<boost::shared_ptr<HuginBase::ImageCache::Request> >, boost::_bi::value<boost::shared_ptr<HuginBase::ImageCache::Entry> > > > >::run ()
#7 0x00df81ac in thread_proxy ()
#8 0x92271259 in _pthread_start ()
#9 0x922710de in thread_start ()

Changed in hugin:
status: Incomplete → New
Revision history for this message
tmodes (tmodes) wrote :

I can't reproduce it (Windows here).
I tried your steps: After the message "image file not found" I can select an other image and proceed normal.

Can somebody else reproduce it? Or it is a Mac specific issue?

Revision history for this message
zarl (carl-einem) wrote :

I can't reproduce this on my OS X 10.6.8 MacPro with hugin 2012.0.0-RC3
I can't remember having crashes when moving or renaming files before reopening a .pto file.

About stitching screenshots... what's your plan behind that?

You could try the latest RC version
http://sourceforge.net/projects/hugin/files/hugin/hugin-2012.0/hugin-mac-2012.0.0_rc3.dmg/download
Make sure you follow the notes coming with this version.

You don't use the graphic card option or other prefs that are "experimental", right?

Revision history for this message
Willeke (willeke2007) wrote :

If Hugin is started by double clicking the pto file and Hugin has to ask for a File Hugin always crashes (on my Mac). If the pto file is opened from Hugin or when all files are present, Hugin doesn't alwasys crash but the cursor is a watch when Hugin says "Image file not found".
I don't want to stitch screenshots but wanted to use small images that everyone can produce.
hugin-mac-2012.0.0_rc3 has the same problem.
I removed the preferences file and didn't change any prefs.

Revision history for this message
zarl (carl-einem) wrote :

I think this is less of a hugin problem but a good reason for a system check. I prefer http://applejack.sf.net (which starts fsck and a few more tests) for that, but an OS X startup DVD with Disk Utility (see http://support.apple.com/kb/TS1417 ) will be a good start.

From the first report "It seems to hapen more often when other programs are open in the background." In that case I'd close all other apps and have an eye on the activity monitor.

About "cursor is a watch", isn't it a "spinning beach ball"?

You wrote that you "didn't change any prefs." Please read the READMEs that come with the software, there are indeed some prefs you should adapt to your needs...

Revision history for this message
zarl (carl-einem) wrote :

Just a short addition: "change prefs" aka "set up hugin".

Revision history for this message
Willeke (willeke2007) wrote :

I checked my harddisk with Disk Utility and everything is ok. I did repair the permissions.

The pto file created with the steps above always makes hugin crash. I tried another user, first action after loggin in, no other programs open (except the usual like Finder, Dock, etc).

The cursor is a watch: the Mac OS 9 black and white wristwatch.

Hugin comes with one "Read Me First (Mac).pdf", are there other READMEs? I didn't read anything about prefs I have to change or things I have to set up.

If I am the only one experiencing this crash, there is something special about my Mac. I'm trying to figure out what it is.

Revision history for this message
zarl (carl-einem) wrote :

Can you attach an affected pto file (image files not needed)?

Revision history for this message
Willeke (willeke2007) wrote :
Revision history for this message
tmodes (tmodes) wrote :

Does this still happens with current version 2013.0? If so report back and set status back to new.

Changed in hugin:
status: New → Incomplete
Revision history for this message
zarl (carl-einem) wrote :

I see a remark in your error message that says:

  Unable to open file ''

Could you please try your double click trick again but this time using file names without blanks (space character) and other special characters in it, please?

See http://wiki.panotools.org/Hugin_FAQ#Special_Characters_in_Paths

What's your current version of OS X and hugin? Could you please also try other file formats like JPG or TIFF? And is there a reason why you provoke hick ups by renaming files?

Revision history for this message
Willeke (willeke2007) wrote :
Download full text (3.5 KiB)

Hugin 2013.0 doesn't open my document at launch so it doesn't crash. Is this a bug or a solution?

Hugin still crashes most of the time if:
Hugin is already running, the Fast Preview window is the front window.
I double click my document in the Finder, one of the files can't be found.
Hugin crashes after I select the file or click on the Cancel button of the Open dialog.

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000048
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libhugin_base-2013.0.dylib 0x00000001008a2522 HuginBase::ImageCache::postEvent(boost::shared_ptr<HuginBase::ImageCache::Request>, boost::shared_ptr<HuginBase::ImageCache::Entry>) + 260
1 net.sourceforge.hugin.Hugin 0x0000000100097284 huginApp::relayImageLoaded(ImageReadyEvent&) + 82
2 ..._osx_cocoau-2.9.5.0.0.dylib 0x000000010141e775 wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 93
3 ..._osx_cocoau-2.9.5.0.0.dylib 0x0000000101421f2b wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) + 241
4 ..._osx_cocoau-2.9.5.0.0.dylib 0x0000000101421fcc wxEvtHandler::TryHereOnly(wxEvent&) + 152
5 ..._osx_cocoau-2.9.5.0.0.dylib 0x000000010142202a wxEvtHandler::ProcessEventLocally(wxEvent&) + 46
6 ..._osx_cocoau-2.9.5.0.0.dylib 0x0000000101421534 wxEvtHandler::ProcessEvent(wxEvent&) + 142
7 ..._osx_cocoau-2.9.5.0.0.dylib 0x0000000101421101 wxEvtHandler::ProcessPendingEvents() + 243
8 ..._osx_cocoau-2.9.5.0.0.dylib 0x000000010135a987 wxAppConsoleBase::ProcessPendingEvents() + 105
9 ..._osx_cocoau-2.9.5.0.0.dylib 0x00000001014058c6 wxCFEventLoop::CommonModeObserverCallBack(__CFRunLoopObserver*, int) + 48
10 com.apple.CoreFoundation 0x00007fff854f5b07 __CFRunLoopDoObservers + 519
11 com.apple.CoreFoundation 0x00007fff854d1434 __CFRunLoopRun + 468
12 com.apple.CoreFoundation 0x00007fff854d0d8f CFRunLoopRunSpecific + 575
13 com.apple.HIToolbox 0x00007fff895d37ee RunCurrentEventLoopInMode + 333
14 com.apple.HIToolbox 0x00007fff895d3551 ReceiveNextEventCommon + 148
15 com.apple.HIToolbox 0x00007fff895d34ac BlockUntilNextEventMatchingListInMode + 59
16 com.apple.AppKit 0x00007fff84aa9eb2 _DPSNextEvent + 708
17 com.apple.AppKit 0x00007fff84aa9801 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
18 com.apple.AppKit 0x00007fff84a6f68f -[NSApplication run] + 395
19 ..._osx_cocoau-2.9.5.0.0.dylib 0x00000001014d4f24 wxGUIEventLoop::OSXDoRun() + 108
20 ..._osx_cocoau-2.9.5.0.0.dylib 0x0000000101405d94 wxCFEventLoop::DoRun() + 50
21 ..._osx_cocoau-2.9.5.0.0.dylib 0x000000010137fe77 wxEventLoopBase::Run() + 83
22 ..._osx_cocoau-2.9.5.0.0.dylib 0x000000010135a0df wxAppConsoleBase::MainLoop() + 109
23 ..._osx_cocoau-2.9.5.0.0.dylib 0x000000010147f55b wxApp::OnRun() + 29
24 ..._osx_cocoau-2.9.5.0.0.dylib 0x00000001013a9cb6 wxEntry(int&, wchar_t**) + 102
25 net.sourceforge.hugin.Hugin 0x000000010009cf14 main + 20
26 net.sourceforge.hugin.Hugin 0x0000000100001c74 start + 52

I used...

Read more...

Changed in hugin:
status: Incomplete → New
Revision history for this message
zarl (carl-einem) wrote :

You should try to minimize the number of problems. Hiding an image file before you open the .pto may show some bug but I think you want to solve other problems first, right? Apart from that this should be filed as another bug.

I saw a remark that you try to work with grayscale TIFFs. Please convert those to RGB (this won't degrade the image quality) for the libraries used by Hugin don't work with grayscale.

Now make sure your file names (images as well as the pto) are named properly and contain no special characters or blanks, but have a proper extension like .tif
Also make sure that the complete path to the project files contains no special characters so the tools used by Hugin don't run into problems while trying to access your images.

Make sure no other copies (e.g. older versions) of hugin are on your Mac.

Now can you please try two different ways to open your .pto project file:
- double click the project
- Open Hugin and PTBatcherGUI, and from inside Hugin use the "open file..." dialog.

Does it work now?

BTW I can test on 10.6.8, my projects work without problems so there should be a solution for you.

Revision history for this message
Willeke (willeke2007) wrote :

As far as I can tell Hugin doesn't crash anymore when I open a project. I'll file the other bugs.

tmodes (tmodes)
Changed in hugin:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.