CloudCompare / CloudCompare

CloudCompare main repository
Other
3.54k stars 1.03k forks source link

CR line endings in ASCII files cause a crash #801

Open nick-yfeng opened 6 years ago

nick-yfeng commented 6 years ago

Current Behavior

Cloudcompare 2.9.1 crashes when I attempt to open files. I tried opening .csv and .txt files. I'm using OSX 10.14 and graphic specs are: NVIDIA GeForce GT 650M 1024 MB Intel HD Graphics 4000 1536 MB

The crash logs are: Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000018 Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [64480]

VM Regions Near 0x18: --> __TEXT 000000010c89d000-000000010cc0a000 [ 3508K] r-x/rwx SM=COW /Applications/CloudCompare.app/Contents/MacOS/CloudCompare

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 org.qt-project.QtGui 0x0000000111d34743 QMacCGContext::QMacCGContext(QPainter) + 51 1 org.qt-project.QtWidgets 0x000000011186430b 0x11149a000 + 3973899 2 org.qt-project.QtWidgets 0x0000000111599fdd QFrame::drawFrame(QPainter) + 77 3 org.qt-project.QtWidgets 0x00000001115f70d5 QLabel::paintEvent(QPaintEvent) + 69 4 org.qt-project.QtWidgets 0x00000001114e3f1d QWidget::event(QEvent) + 2141 5 org.qt-project.QtWidgets 0x000000011159a05d QFrame::event(QEvent) + 45 6 org.qt-project.QtWidgets 0x00000001115f706f QLabel::event(QEvent) + 255 7 org.qt-project.QtWidgets 0x00000001114abbad QApplicationPrivate::notify_helper(QObject, QEvent) + 269 8 org.qt-project.QtWidgets 0x00000001114ae47c QApplication::notify(QObject, QEvent) + 5852 9 org.qt-project.QtCore 0x000000011215da24 QCoreApplication::notifyInternal2(QObject, QEvent) + 164 10 org.qt-project.QtWidgets 0x00000001114dd926 QWidgetPrivate::drawWidget(QPaintDevice, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 3462 11 org.qt-project.QtWidgets 0x00000001114de118 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 1192 12 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 13 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 14 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 15 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 16 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 17 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 18 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 19 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 20 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 21 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 22 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 23 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 24 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 25 org.qt-project.QtWidgets 0x00000001114ddfa6 QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 822 26 org.qt-project.QtWidgets 0x00000001114ddba0 QWidgetPrivate::drawWidget(QPaintDevice, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) + 4096 27 org.qt-project.QtWidgets 0x00000001114b925e 0x11149a000 + 127582 28 org.qt-project.QtWidgets 0x00000001114b7cf0 0x11149a000 + 122096 29 org.qt-project.QtWidgets 0x00000001115060cb 0x11149a000 + 442571 30 org.qt-project.QtWidgets 0x00000001115037ed 0x11149a000 + 432109 31 org.qt-project.QtWidgets 0x00000001114abbad QApplicationPrivate::notify_helper(QObject, QEvent) + 269 32 org.qt-project.QtWidgets 0x00000001114ae47c QApplication::notify(QObject, QEvent) + 5852 33 org.qt-project.QtCore 0x000000011215da24 QCoreApplication::notifyInternal2(QObject, QEvent) + 164 34 org.qt-project.QtGui 0x0000000111a93314 QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent) + 308 35 org.qt-project.QtGui 0x0000000111a76fa0 QWindowSystemInterface::sendWindowSystemEvents(QFlags) + 384 36 org.qt-project.QtGui 0x0000000111a7322c QWindowSystemInterface::flushWindowSystemEvents(QFlags) + 572 37 libqcocoa.dylib 0x00000001144125ba 0x1143f7000 + 112058 38 org.qt-project.QtGui 0x0000000111a9b042 QWindow::setVisible(bool) + 1026 39 org.qt-project.QtWidgets 0x00000001114e194c QWidgetPrivate::show_sys() + 876 40 org.qt-project.QtWidgets 0x00000001114e2851 QWidgetPrivate::show_helper() + 417 41 org.qt-project.QtWidgets 0x00000001114e344c QWidget::setVisible(bool) + 956 42 org.qt-project.QtWidgets 0x00000001116aebfd QDialog::setVisible(bool) + 125 43 org.qt-project.QtWidgets 0x00000001116ae2e2 QDialog::exec() + 242 44 libQCC_IO_LIB.dylib 0x000000010cd81ed0 0x10cd79000 + 36560 45 libQCC_IO_LIB.dylib 0x000000010cdb8b8b 0x10cd79000 + 261003 46 libQCC_IO_LIB.dylib 0x000000010cdba087 0x10cd79000 + 266375 47 0x000000010ca450ce 0x10c89d000 + 1736910 48 0x000000010ca3eb6a 0x10c89d000 + 1710954 49 org.qt-project.QtCore 0x0000000112187b3c QObject::event(QEvent) + 156 50 org.qt-project.QtWidgets 0x00000001114e478c QWidget::event(QEvent) + 4300 51 org.qt-project.QtWidgets 0x000000011160fb2c QMainWindow::event(QEvent) + 1660 52 org.qt-project.QtWidgets 0x00000001114abbad QApplicationPrivate::notify_helper(QObject, QEvent) + 269 53 org.qt-project.QtWidgets 0x00000001114ae47c QApplication::notify(QObject, QEvent) + 5852 54 org.qt-project.QtCore 0x000000011215da24 QCoreApplication::notifyInternal2(QObject, QEvent) + 164 55 org.qt-project.QtCore 0x000000011215e770 QCoreApplicationPrivate::sendPostedEvents(QObject, int, QThreadData) + 560 56 libqcocoa.dylib 0x000000011442819e 0x1143f7000 + 201118 57 libqcocoa.dylib 0x0000000114428a61 0x1143f7000 + 203361 58 com.apple.CoreFoundation 0x00007fff4f591129 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 59 com.apple.CoreFoundation 0x00007fff4f5910cf CFRunLoopDoSource0 + 108 60 com.apple.CoreFoundation 0x00007fff4f574f70 CFRunLoopDoSources0 + 195 61 com.apple.CoreFoundation 0x00007fff4f574517 CFRunLoopRun + 1226 62 com.apple.CoreFoundation 0x00007fff4f573dfa CFRunLoopRunSpecific + 467 63 com.apple.Foundation 0x00007fff518f25da -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280 64 com.apple.Foundation 0x00007fff519c5684 -[NSRunLoop(NSRunLoop) runUntilDate:] + 104 65 com.apple.AppKit 0x00007fff4ce4af85 NSCoreDragReceiveMessageProc + 2221 66 com.apple.HIServices 0x00007fff4dd3602c CallReceiveMessageCollectionWithMessage + 103 67 com.apple.HIServices 0x00007fff4dd2fa88 DoMultipartDropMessage + 113 68 com.apple.HIServices 0x00007fff4dd2f86b DoDropMessage + 40 69 com.apple.HIServices 0x00007fff4dd33bff CoreDragMessageHandler + 841 70 com.apple.CoreFoundation 0x00007fff4f65316e CFMessagePortPerform + 514 71 com.apple.CoreFoundation 0x00007fff4f58ca2f CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 41 72 com.apple.CoreFoundation 0x00007fff4f58c98d CFRunLoopDoSource1 + 527 73 com.apple.CoreFoundation 0x00007fff4f574a66 CFRunLoopRun + 2585 74 com.apple.CoreFoundation 0x00007fff4f573dfa CFRunLoopRunSpecific + 467 75 com.apple.HIToolbox 0x00007fff4e7ff895 RunCurrentEventLoopInMode + 293 76 com.apple.HIToolbox 0x00007fff4e7ff5cb ReceiveNextEventCommon + 618 77 com.apple.HIToolbox 0x00007fff4e7ff348 _BlockUntilNextEventMatchingListInModeWithFilter + 64 78 com.apple.AppKit 0x00007fff4cabc95b _DPSNextEvent + 997 79 com.apple.AppKit 0x00007fff4cabb6fa -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362 80 com.apple.AppKit 0x00007fff4cab575d -[NSApplication run] + 699 81 libqcocoa.dylib 0x000000011442791a 0x1143f7000 + 198938 82 org.qt-project.QtCore 0x0000000112159661 QEventLoop::exec(QFlags) + 401 83 org.qt-project.QtCore 0x000000011215e0c9 QCoreApplication::exec() + 393 84 0x000000010c9f892e 0x10c89d000 + 1423662 85 libdyld.dylib 0x00007fff7c6a2085 start + 1

And when I try to open the files directly, i.e. click "open with" from the dropdown of the file, there's a warning says "[Load] Can't guess file format: unhandled file extension 'csv'".

I also tried to use previous versions of cloudcompare, they all gives the same thing.

Please help :/

Expected Behavior

It should be able to open the file.

Your Environment

asmaloney commented 6 years ago

That's an odd place to crash.

Can share one of the files with me to see if I can reproduce it? (email in profile)

asmaloney commented 6 years ago

Problem

Workaround

Proper Solution

nick-yfeng commented 6 years ago

Problem solved! Thank you so much! :)

asmaloney commented 6 years ago

Glad the workaround worked!

I'm going to leave this open because there are actions that could be taken to address this.

dgirardeau commented 6 years ago

Actually I realized that there's already a limit of 256 columns in the ASCII loading dialog (and I just extended it to 512 by the way :p).

WargodHernandez commented 4 years ago

Is this still an issue?

dgirardeau commented 4 years ago

I would say: no. Maybe @asmaloney thinks otherwise?

asmaloney commented 4 years ago

I would say it is still an issue in the sense that I don't think it's fixed (the line ending problem at least).

I don't think it's worth the resources to fix it properly since there is an easy workaround.

Maybe adding a warning dialog ("change your line endings!") would be the best solution so if it does happen again we don't get crash reports that take time to handle? Crashing is sub-optimal :-)

What happens right now if there are > 512 columns?