Feature request #1308

dxf plugin crashes QGIS

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

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

Description

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
Abortito

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 over 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 over 13 years ago

fix #1308

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

History

#1 Updated by Tom Elwertowski almost 16 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 almost 16 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 almost 15 years ago

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

basic_string::substr

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 over 13 years ago

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

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

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

fixed in 6f45929d (SVN r15381).

Also available in: Atom PDF