Opened 10 years ago

Closed 9 years ago

#2262 closed defect (fixed)

Crash when on previous use background plugin has been used

Reported by: Aleksandar Topuzovic Owned by: Chris Browet
Priority: critical Milestone:
Component: merkaartor Version:
Keywords: Cc:

Description

When I start merkaartor for the first time it starts without problems, then I select a background adapter and continue using merkaartor and close it. Then starting from now on merkaartor crashes, to avoid crashing I have to quickly go to Layer - "Map - None" and click none. Then it works OK, then I can go again and select the background adapter and use it (but to prevent further crashes before exiting I have to choose None as the background image adapter.

(gdb) run Starting program: /Users/aco/devel/merkaartor/binaries/bin/merkaartor.app/Contents/MacOS/merkaartor Reading symbols for shared libraries . done "2009-09-05T00:04:54" -- Starting "Merkaartor 0.14"



MerkaartorPreferences::fromOsmPref : "GET /api/0.6/user/preferences/" Reading symbols for shared libraries + done Reading symbols for shared libraries + done Reading symbols for shared libraries + done Reading symbols for shared libraries + done Reading symbols for shared libraries + done Reading symbols for shared libraries + done Reading symbols for shared libraries + done ImageMapLayer::drawFull: getting: "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=16.698897,42.970770,16.737177,42.951173" BrowserImageManager::launchRequest: "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=16.698897,42.970770,16.737177,42.951173" Hash: "WWFob28hcXJjOi9IdG1sL3ltYXAuaHRtbD9XSURUSD04NjgmSEVJR0hUPTYwNSZCQk9YPTE2LjY5ODg5Nyw0Mi45NzA3NzAsMTYuNzM3MTc3LDQyLjk1MTE3Mw==" ReqSize?: 868 , 605 Size: 211 , 146 , 657 , 458


Coord: 42.9708 , 16.6989 , 42.9512 , 16.7372 BrowserImageManager::pageLoadFinished: Hash: "WWFob28hcXJjOi9IdG1sL3ltYXAuaHRtbD9XSURUSD04NjgmSEVJR0hUPTYwNSZCQk9YPTE2LjY5ODg5Nyw0Mi45NzA3NzAsMTYuNzM3MTc3LDQyLjk1MTE3Mw==" ImageMapLayer::drawFull: getting: "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=16.698897,42.970770,16.737177,42.951173" BrowserImageManager::QPixmapCache hit!

Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x000000011b5fc000 0x00007fffffe008b1 in memcpy () (gdb) bt #0 0x00007fffffe008b1 in memcpy () #1 0x00000001021cb067 in QMacPixmapData::copy () #2 0x00000001021bf661 in QPixmap::copy () #3 0x000000010008ab81 in ImageMapLayer::drawImage (this=0x11743b210, thePix=@0x10318d1f0, delta={yp = 0, xp = 0}) at Maps/ImageMapLayer?.cpp:301 #4 0x00000001001785a0 in MapView::updateLayersImage (this=0x1030c9460) at MapView?.cpp:297 #5 0x000000010017994c in MapView::paintEvent (this=0x1030c9460, anEvent=0x7fff5fbfba90) at MapView?.cpp:193 #6 0x0000000102188de1 in QWidget::event () #7 0x00000001001743ed in MapView::event (this=0x1030c9460, event=0x7fff5fbfba90) at MapView?.cpp:1172 #8 0x0000000102141b8d in QApplicationPrivate::notify_helper () #9 0x00000001021487fe in QApplication::notify () #10 0x0000000102dd8a1c in QCoreApplication::notifyInternal () #11 0x000000010213fc40 in qt_sendSpontaneousEvent () #12 0x00000001020f5f0e in -[QCocoaView drawRect:] () #13 0x00007fff828123ce in -[NSView _drawRect:clip:] () #14 0x00007fff82811041 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] () #15 0x00007fff8280f713 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #16 0x00007fff828105df in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #17 0x00007fff828105df in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #18 0x00007fff828105df in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #19 0x00007fff8280f237 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () #20 0x00007fff8280badb in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] () #21 0x00007fff82785287 in -[NSView displayIfNeeded] () #22 0x00007fff82780133 in _handleWindowNeedsDisplay () #23 0x00007fff86319437 in CFRunLoopDoObservers () #24 0x00007fff862f56e4 in CFRunLoopRun () #25 0x00007fff862f503f in CFRunLoopRunSpecific () #26 0x00007fff857b6c4e in RunCurrentEventLoopInMode? () #27 0x00007fff857b6a53 in ReceiveNextEventCommon? () #28 0x00007fff857b690c in BlockUntilNextEventMatchingListInMode? () #29 0x00007fff82755570 in _DPSNextEvent () #30 0x00007fff82754ed9 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #31 0x00007fff8271ab29 in -[NSApplication run] () #32 0x0000000102100e29 in QEventDispatcherMac::processEvents () #33 0x0000000102dd8124 in QEventLoop::processEvents () #34 0x0000000102dd82b5 in QEventLoop::exec () #35 0x0000000102ddbe55 in QCoreApplication::exec () #36 0x00000001001d5ac6 in main (argc=1, argv=0x7fff5fbff768) at Main.cpp:201 (gdb)

Attachments (1)

pref-none.patch (554 bytes) - added by Aleksandar Topuzovic 10 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 years ago by Aleksandar Topuzovic

I think that the problem is that the last adapter's UUID is saved to preferences on OSM and after reading the preferences and the last used adapter program crashes. Quick fix is to allways get the NONE_ADAPTER_UUID.

Changed 10 years ago by Aleksandar Topuzovic

Attachment: pref-none.patch added

comment:2 Changed 10 years ago by Chris Browet

Owner: changed from cbro@… to Chris Browet
Status: newassigned

Could you try with the following patch, I suspect a Mac only issue with empty QPixmap.

modified file 'src/Maps/ImageMapLayer.cpp'

--- src/Maps/ImageMapLayer.cpp 2009-08-13 08:57:31 +0000 +++ src/Maps/ImageMapLayer.cpp 2009-09-15 12:22:59 +0000 @@ -285,6 +285,9 @@

return;

if (!p->theMapAdapter->getImageManager())

return;

+ Do not draw if saved pixmap is null as a copy of a null pixmap seems to crash on Mac (fixes #2262) + if (p->pm.isNull()) + return;

const QSize ps = p->pr.size(); const QSize pmSize = p->pm.size();

comment:3 Changed 10 years ago by Aleksandar Topuzovic

Still no luck ;(

(gdb) run
Starting program: /Users/aco/devel/merkaartor/binaries/bin/merkaartor.app/Contents/MacOS/merkaartor 
Reading symbols for shared libraries ......++.+.+++........................................................................................ done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
****  "2009-09-15T16:38:41"  -- Starting  "Merkaartor 0.14" 
------- "using QT version 4.5.2 (built with 4.5.2)" 
------- on Mac OS/X 
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
MerkaartorPreferences::fromOsmPref : "GET /api/0.6/user/preferences/" 
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
ImageMapLayer::drawFull: getting:  "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=15.991085,45.808115,15.994543,45.806429" 
BrowserImageManager::launchRequest:  "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=15.991085,45.808115,15.994543,45.806429"  Hash:  "WWFob28hcXJjOi9IdG1sL3ltYXAuaHRtbD9XSURUSD04NjgmSEVJR0hUPTYwNSZCQk9YPTE1Ljk5MTA4NSw0NS44MDgxMTUsMTUuOTk0NTQzLDQ1LjgwNjQyOQ==" 
ReqSize:  868 ,  605 
Size:  273 ,  189 ,  595 , 415 
----  322 ,  226 
Coord:  45.8081 ,  15.9911 ,  45.8064 , 15.9945 
Reading symbols for shared libraries ... done
BrowserImageManager::pageLoadFinished:   Hash:  "WWFob28hcXJjOi9IdG1sL3ltYXAuaHRtbD9XSURUSD04NjgmSEVJR0hUPTYwNSZCQk9YPTE1Ljk5MTA4NSw0NS44MDgxMTUsMTUuOTk0NTQzLDQ1LjgwNjQyOQ==" 
ImageMapLayer::drawFull: getting:  "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=15.991085,45.808115,15.994543,45.806429" 
BrowserImageManager::QPixmapCache hit! 

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000011c3ce000
0x00007fffffe008b1 in __memcpy ()
(gdb) bt
#0  0x00007fffffe008b1 in __memcpy ()
#1  0x00000001021cb067 in QMacPixmapData::copy ()
#2  0x00000001021bf661 in QPixmap::copy ()
#3  0x000000010008ab7d in ImageMapLayer::drawImage (this=0x1030ca210, thePix=@0x1177600d0, delta={yp = 0, xp = 0}) at Maps/ImageMapLayer.cpp:304
#4  0x000000010017859c in MapView::updateLayersImage (this=0x11765cd90) at MapView.cpp:297
#5  0x0000000100179948 in MapView::paintEvent (this=0x11765cd90, anEvent=0x7fff5fbfb4d0) at MapView.cpp:193
#6  0x0000000102188de1 in QWidget::event ()
#7  0x00000001001743e9 in MapView::event (this=0x11765cd90, event=0x7fff5fbfb4d0) at MapView.cpp:1172
#8  0x0000000102141b8d in QApplicationPrivate::notify_helper ()
#9  0x00000001021487fe in QApplication::notify ()
#10 0x0000000102dd8a1c in QCoreApplication::notifyInternal ()
#11 0x000000010213fc40 in qt_sendSpontaneousEvent ()
#12 0x00000001020f5f0e in -[QCocoaView drawRect:] ()
#13 0x00007fff87dad38a in -[NSView _drawRect:clip:] ()
#14 0x00007fff87dabffd in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#15 0x00007fff87daa6cf in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#16 0x00007fff87dab59b in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#17 0x00007fff87dab59b in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#18 0x00007fff87dab59b in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#19 0x00007fff87daa1f3 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#20 0x00007fff87da6a97 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] ()
#21 0x00007fff87d20237 in -[NSView displayIfNeeded] ()
#22 0x00007fff87d1b0e3 in _handleWindowNeedsDisplay ()
#23 0x00007fff86447437 in __CFRunLoopDoObservers ()
#24 0x00007fff864236e4 in __CFRunLoopRun ()
#25 0x00007fff8642303f in CFRunLoopRunSpecific ()
#26 0x00007fff82b31c4e in RunCurrentEventLoopInMode ()
#27 0x00007fff82b319b1 in ReceiveNextEventCommon ()
#28 0x00007fff82b7bea5 in IsUserStillTracking ()
#29 0x00007fff82b68c10 in TrackMenuCommon ()
#30 0x00007fff82b64eb0 in MenuSelectCore ()
#31 0x00007fff82b64695 in _HandleMenuSelection2 ()
#32 0x00007fff87d1ce7b in _NSHandleCarbonMenuEvent ()
#33 0x00007fff87cf09d3 in _DPSNextEvent ()
#34 0x00007fff87cefe89 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#35 0x00007fff87cb5a7d in -[NSApplication run] ()
#36 0x0000000102100e29 in QEventDispatcherMac::processEvents ()
#37 0x0000000102dd8124 in QEventLoop::processEvents ()
#38 0x0000000102dd82b5 in QEventLoop::exec ()
#39 0x0000000102ddbe55 in QCoreApplication::exec ()
#40 0x00000001001d5ac2 in main (argc=1, argv=0x7fff5fbff7c0) at Main.cpp:201
(gdb) 

comment:4 Changed 10 years ago by Aleksandar Topuzovic

I have noticed that the debug prints out the following message:

BrowserImageManager::QPixmapCache hit! 

It displays that even after I have deleted the BackgroundCache? form .merkaartor directory.

comment:5 Changed 10 years ago by Chris Browet

Resolution: fixed
Status: assignedclosed

(In [17651]) ADD : Allow all platforms to connect to a gpsd backend FIX : Set gpsd output to NMEA; allow to save log FIX : Do not draw background if saved pixmap is null as a copy of a null pixmap seems to crash on Mac (fixes #2262) FIX : Fixes MacOSX plugin dir (fixes #2253)

comment:6 Changed 10 years ago by Aleksandar Topuzovic

Resolution: fixed
Status: closedreopened

Sorry but this still doesn't fix it for me.

GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3 01:19:56 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...
warning: Unable to read symbols for "QtWebKit.framework/Versions/4/QtWebKit" (file not found).

warning: Unable to read symbols from "QtWebKit" (not yet mapped into memory).

warning: Unable to read symbols for "phonon.framework/Versions/4/phonon" (file not found).

warning: Unable to read symbols from "phonon" (not yet mapped into memory).

warning: Unable to read symbols for "QtSvg.framework/Versions/4/QtSvg" (file not found).

warning: Unable to read symbols from "QtSvg" (not yet mapped into memory).

warning: Unable to read symbols for "QtXml.framework/Versions/4/QtXml" (file not found).

warning: Unable to read symbols from "QtXml" (not yet mapped into memory).

warning: Unable to read symbols for "QtGui.framework/Versions/4/QtGui" (file not found).

warning: Unable to read symbols from "QtGui" (not yet mapped into memory).

warning: Unable to read symbols for "QtNetwork.framework/Versions/4/QtNetwork" (file not found).

warning: Unable to read symbols from "QtNetwork" (not yet mapped into memory).

warning: Unable to read symbols for "QtCore.framework/Versions/4/QtCore" (file not found).

warning: Unable to read symbols from "QtCore" (not yet mapped into memory).
Reading symbols for shared libraries ........ done

(gdb) run
Starting program: /Users/aco/devel/merkaartor/binaries/bin/merkaartor.app/Contents/MacOS/merkaartor 
Reading symbols for shared libraries .+.....++.+.+++.................................................................................................... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
****  "2009-09-19T16:59:14"  -- Starting  "Merkaartor 0.14" 
------- "using QT version 4.5.2 (built with 4.5.2)" 
------- on Mac OS/X 
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
MerkaartorPreferences::fromOsmPref : "GET /api/0.6/user/preferences/" 
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
ImageMapLayer::drawFull: getting:  "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=15.988157,45.814231,16.007297,45.804902" 
BrowserImageManager::launchRequest:  "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=15.988157,45.814231,16.007297,45.804902"  Hash:  "WWFob28hcXJjOi9IdG1sL3ltYXAuaHRtbD9XSURUSD04NjgmSEVJR0hUPTYwNSZCQk9YPTE1Ljk4ODE1Nyw0NS44MTQyMzEsMTYuMDA3Mjk3LDQ1LjgwNDkwMg==" 
ReqSize:  868 ,  605 
Size:  211 ,  146 ,  657 , 458 
----  446 ,  312 
Coord:  45.8142 ,  15.9882 ,  45.8049 , 16.0073 
BrowserImageManager::pageLoadFinished:   Hash:  "WWFob28hcXJjOi9IdG1sL3ltYXAuaHRtbD9XSURUSD04NjgmSEVJR0hUPTYwNSZCQk9YPTE1Ljk4ODE1Nyw0NS44MTQyMzEsMTYuMDA3Mjk3LDQ1LjgwNDkwMg==" 
ImageMapLayer::drawFull: getting:  "qrc:/Html/ymap.html?WIDTH=868&HEIGHT=605&BBOX=15.988157,45.814231,16.007297,45.804902" 
BrowserImageManager::QPixmapCache hit! 

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000011d1d0000
0x00007fffffe008b1 in __memcpy ()
(gdb) bt
#0  0x00007fffffe008b1 in __memcpy ()
#1  0x0000000102962067 in QMacPixmapData::copy ()
#2  0x0000000102956661 in QPixmap::copy ()
#3  0x000000010008ad63 in ImageMapLayer::drawImage (this=0x118410110, thePix=@0x1185995c0, delta={yp = 0, xp = 0}) at Maps/ImageMapLayer.cpp:304
#4  0x0000000100177f9a in MapView::updateLayersImage (this=0x118507e50) at MapView.cpp:297
#5  0x0000000100179309 in MapView::paintEvent (this=0x118507e50, anEvent=0x7fff5fbfbb30) at MapView.cpp:193
#6  0x000000010291fde1 in QWidget::event ()
#7  0x0000000100173efd in MapView::event (this=0x118507e50, event=0x7fff5fbfbb30) at MapView.cpp:1172
#8  0x00000001028d8b8d in QApplicationPrivate::notify_helper ()
#9  0x00000001028df7fe in QApplication::notify ()
#10 0x000000010356fa1c in QCoreApplication::notifyInternal ()
#11 0x00000001028d6c40 in qt_sendSpontaneousEvent ()
#12 0x000000010288cf0e in -[QCocoaView drawRect:] ()
#13 0x00007fff87dad38a in -[NSView _drawRect:clip:] ()
#14 0x00007fff87dabffd in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#15 0x00007fff87daa6cf in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#16 0x00007fff87dab59b in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#17 0x00007fff87dab59b in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#18 0x00007fff87dab59b in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#19 0x00007fff87daa1f3 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#20 0x00007fff87da6a97 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] ()
#21 0x00007fff87d20237 in -[NSView displayIfNeeded] ()
#22 0x00007fff87d1b0e3 in _handleWindowNeedsDisplay ()
#23 0x00007fff86447437 in __CFRunLoopDoObservers ()
#24 0x00007fff864236e4 in __CFRunLoopRun ()
#25 0x00007fff8642303f in CFRunLoopRunSpecific ()
#26 0x00007fff82b31c4e in RunCurrentEventLoopInMode ()
#27 0x00007fff82b31a53 in ReceiveNextEventCommon ()
#28 0x00007fff82b3190c in BlockUntilNextEventMatchingListInMode ()
#29 0x00007fff87cf0520 in _DPSNextEvent ()
#30 0x00007fff87cefe89 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#31 0x00007fff87cb5a7d in -[NSApplication run] ()
#32 0x0000000102897e29 in QEventDispatcherMac::processEvents ()
#33 0x000000010356f124 in QEventLoop::processEvents ()
#34 0x000000010356f2b5 in QEventLoop::exec ()
#35 0x0000000103572e55 in QCoreApplication::exec ()
#36 0x00000001001d535b in main (argc=1, argv=0x7fff5fbff7c0) at Main.cpp:203

comment:7 Changed 9 years ago by Chris Browet

Is this still valid with more recent Qt releases?

comment:8 Changed 9 years ago by Aleksandar Topuzovic

Resolution: fixed
Status: reopenedclosed

After upgrading to 4.6 it's OK.

Note: See TracTickets for help on using tickets.