Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

[BUG] Crash when opening gpx files #727

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 11 comments
Closed

[BUG] Crash when opening gpx files #727

openstreetmap-trac opened this issue Jul 23, 2021 · 11 comments

Comments

@openstreetmap-trac
Copy link

Reporter: dantje
[Submitted to the original trac issue database at 10.04pm, Friday, 7th March 2008]

Steps:

  1. Start Merkaator[[BR]]
  2. File/Open <somefile.gpx>

The backtrace is not directly helpful:


(gdb) bt
#0  0xb78c0790 in ?? () from /usr/lib/libQtGui.so.4
#1  0xbf993b28 in ?? ()
#2  0xb799606f in QPainter::drawText () from /usr/lib/libQtGui.so.4
Backtrace stopped: frame did not save the PC

The code visits LayerManger::backZoomIn() twice. The second time around it
calls ImageManager::instance()->abortLoading() and segfaults.

@openstreetmap-trac
Copy link
Author

Author: bart[at]vanhauwaert.org
[Added to the original trac issue at 4.02pm, Saturday, 8th March 2008]

The backtrace in Visual Studio is a bit more clear, although I have not fully studied the issue. There seems to be a mishandling in the layerwidgets. Maybe Chris can find out what the problem is?

@openstreetmap-trac
Copy link
Author

Author: bart[at]vanhauwaert.org
[Added to the original trac issue at 4.03pm, Saturday, 8th March 2008]

Also, if you import a GPX file, merkaartor doesn't crash but you end up with two background image layers. I suppose that one is related.

@openstreetmap-trac
Copy link
Author

Author: dantje
[Added to the original trac issue at 7.03pm, Saturday, 8th March 2008]

I ran this in valgrind and it did not crash. Duh. Heisenbug.

@openstreetmap-trac
Copy link
Author

Author: dantje
[Added to the original trac issue at 9.20pm, Saturday, 8th March 2008]

I stepped thru this until I found the last instruction before the crash. It is in the
the loadingFinished signal emit. I saved the backtrace before and after.

ImageManager::abortLoading (this=0x8198538) at QMapControl/imagemanager.cpp:93
93              loadingQueueEmpty();
(gdb) s
ImageManager::loadingQueueEmpty (this=0x8198538) at QMapControl/imagemanager.cpp:84
84              emit(loadingFinished());
(gdb) s
ImageManager::loadingFinished (this=0x8198538) at GeneratedFiles/debug/moc_imagemanager.cpp:91
91          QMetaObject::activate(this, &staticMetaObject, 2, 0);
(gdb) bt
#0  ImageManager::loadingFinished (this=0x8198538) at GeneratedFiles/debug/moc_imagemanager.cpp:91
#1  0x080dea75 in ImageManager::loadingQueueEmpty (this=0x8198538) at QMapControl/imagemanager.cpp:84
#2  0x080dea97 in ImageManager::abortLoading (this=0x8198538) at QMapControl/imagemanager.cpp:93
#3  0x080e23c0 in LayerManager::backZoomIn (this=0x86f55d8) at QMapControl/layermanager.cpp:275
#4  0x080e2e1d in LayerManager::setView (this=0x86f55d8, coordinates=@0xbfae638c) at QMapControl/layermanager.cpp:145
#5  0x0807a0c0 in Projection::layerManagerSetViewport (this=0x818604c, TargetMap=@0xbfae6460, Screen=@0xbfae6480) at Map/Projection.cpp:186
#6  0x0807a184 in Projection::setViewport (this=0x818604c, TargetMap=@0xbfae6460, Screen=@0xbfae6480) at Map/Projection.cpp:115
#7  0x080b5453 in MainWindow::on_viewZoomAllAction_triggered (this=0xbfae79b4) at MainWindow.cpp:307
#8  0x080b3b08 in MainWindow::on_fileOpenAction_triggered (this=0xbfae79b4) at MainWindow.cpp:266
#9  0x080f1c89 in MainWindow::qt_metacall (this=0xbfae79b4, _c=QMetaObject::InvokeMetaMethod, _id=20, _a=0xbfae6adc)
    at GeneratedFiles/debug/moc_MainWindow.cpp:164
#10 0xb763ac04 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#11 0xb763ae00 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#12 0xb786c878 in QAction::triggered () from /usr/lib/libQtGui.so.4
#13 0xb786e5e6 in QAction::activate () from /usr/lib/libQtGui.so.4
#14 0xb7c59abf in ?? () from /usr/lib/libQtGui.so.4
#15 0x0815efb8 in ?? ()
#16 0x00000000 in ?? ()
(gdb) p $pc
$5 = (void (*)(void)) 0x80f35dc <ImageManager::loadingFinished()+6>
(gdb) p $sp
$6 = (void *) 0xbfae6210
(gdb) p this
$7 = (ImageManager * const) 0x8198538
(gdb) p staticMetaObject 
$8 = {d = {superdata = 0x812de80, stringdata = 0x80fdf60 "ImageManager", data = 0x80fdfc0, extradata = 0x0}}
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0xb789c790 in ?? () from /usr/lib/libQtGui.so.4
(gdb) bt
#0  0xb789c790 in ?? () from /usr/lib/libQtGui.so.4
#1  0xbfae45e8 in ?? ()
#2  0xb797206f in QPainter::drawText () from /usr/lib/libQtGui.so.4
Backtrace stopped: frame did not save the PC
(gdb) p $pc
$9 = (void (*)(void)) 0xb789c790 <_fini+6373292>
(gdb) p $sp
$10 = (void *) 0xbfae4538

@openstreetmap-trac
Copy link
Author

Author: koying
[Added to the original trac issue at 9.54pm, Saturday, 8th March 2008]

I must say I don't get any of your problems with my development version on linux.
This version should be no different than the one in svn regarding this, but I'll anyway test with the svn version.

Just to be aligned, could you both attach your problematic GPX, just in case it's file dependent.

@openstreetmap-trac
Copy link
Author

Author: koying
[Added to the original trac issue at 9.59pm, Saturday, 8th March 2008]

Also, could you specify which image backend you were using and your Qt version (I'm using 4.3.3)

@openstreetmap-trac
Copy link
Author

Author: dantje
[Added to the original trac issue at 11.50am, Sunday, 9th March 2008]

I see the same behaviour in a fresh checkout from svn. Qt revision is 4.3.2 on Ubuntu 7.10 (gutsy). It does not seem to be related to the gpx file, but I'll attach a "bad" file that I just got from the traces list.

Image backend is the background image layer? I use the OSM one. But if I check "None" it also happens.

I can make the file/open work by commenting out the Layout->addWidget(w) line from theLayerDock::updateContent() method.

@openstreetmap-trac
Copy link
Author

Author: koying
[Added to the original trac issue at 12.55pm, Sunday, 9th March 2008]

Definitely cannot reproduce on my gentoo. Will check on monday on win32 (also 4.3.3 unfortunately).

I suspect a qt bug which was corrected on 4.3.3, so I'll install a virtual ubuntu 7.10 machine to try to reproduce.

@openstreetmap-trac
Copy link
Author

Author: koying
[Added to the original trac issue at 6.27pm, Sunday, 9th March 2008]

I confirm I get the crash on Ubuntu 7.10/Qt 4.3.2. Debugging...

@openstreetmap-trac
Copy link
Author

Author: koying
[Added to the original trac issue at 9.01pm, Sunday, 9th March 2008]

LayerWidgets are reparented to the groupbox, so leave to it to delete them.
The crash on qt 4.3.2 seems to come from an additional repaint of the widget on an already deleted layer.
Fixed in [7067]

@openstreetmap-trac
Copy link
Author

Author: koying
[Added to the original trac issue at 9.13pm, Sunday, 9th March 2008]

(In [7068]) ADD : Export viewport to OSM
FIX : LayerWidget destruction (should fix #727, and not 731)
FIX : Update layer list on download
FIX : do not create undo list on track open

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant