Feature request #1308

dxf plugin crashes QGIS

Added by Paolo Cavallini over 15 years ago. Updated almost 13 years ago.

Assignee:nobody -
Category:C++ Plugins
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:11368


When opening a dxf, I get:
Warning: Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr

Self compiled on Debian from current trunk

dxf2shp.diff Magnifier - patch for dxf2shp exception if no output layer is given (536 Bytes) Anne Ghisla, 2011-03-07 08:24 AM

Associated revisions

Revision 852dd612
Added by Jürgen Fischer almost 13 years ago

fix #1308

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15380 c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 6f45929d
Added by Jürgen Fischer almost 13 years ago

fix #1308

git-svn-id: http://svn.osgeo.org/qgis/trunk@15380 c8812cc2-4d05-0410-92ff-de0c093fc19c


#1 Updated by Tom Elwertowski over 15 years ago

Unable to reproduce on a Mac. I tried adding various things to a valid dxf but the reader seems very good at ignoring unexpected input and still doing something reasonable.

Added application-wide exception handler for uncaught events in b254446b (SVN r9320). It will display an alert rather than crashing and may allow you to continue working if the unsuccessful load doesn't create an unstable layer.

#2 Updated by Paolo Cavallini over 15 years ago

The problem derives by the lack of an output layer. If I insert it, everything works. However, the error message: basic_string::substr is not very helpful - could you please change it with something like "Please select a name for the output layer". With this modification, the bug can be closed.

#3 Updated by Giovanni Manghi over 14 years ago

I confirm that if you forget to select an output file, the message given is


that as a matter of fact should be changed with something different. Should be a pretty easy bug to fix.

#4 Updated by Anne Ghisla almost 13 years ago

Let me attach a patch, excusing my poor C++. Hope this helps!

#5 Updated by Jürgen Fischer almost 13 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in 6f45929d (SVN r15381).

Also available in: Atom PDF