Mezomish / juffed

JuffEd text editor
GNU General Public License v2.0
56 stars 19 forks source link

Segfault when saving .go #67

Closed kokizzu closed 2 years ago

kokizzu commented 10 years ago

version: juffEd v0.10

How to reproduce:

  1. new file with only one space character inside
  2. ctrl+s
  3. name it test2.go, press enter

then it would crash:

libpng warning: iCCP: known incorrect sRGB profile
"[15:38:39]" "--- Plugin 'Autosave' is disabled in Settings." 
"[15:38:39]" "--- Plugin 'Color Picker' is disabled in Settings." 
"[15:38:39]" "+++ Plugin 'Documents List' was loaded successfully." 
"[15:38:39]" "+++ Plugin 'Favorites' was loaded successfully." 
"[15:38:39]" "+++ Plugin 'Find In Files' was loaded successfully." 
"[15:38:39]" "+++ Plugin 'File manager' was loaded successfully." 
"[15:38:39]" "+++ Plugin 'Keybindings' was loaded successfully." 
"[15:38:39]" "+++ Plugin 'Sort Document' was loaded successfully." 
"[15:38:39]" "+++ Plugin 'Symbol_browser' was loaded successfully." 
"[15:38:39]" "+++ Plugin 'XML Formatter' was loaded successfully." 
"[15:38:39]" "Session '/home/kyz/.config/juff/sessions/_empty_session_' opened successfully" 
"[15:38:39]" "Session '/home/kyz/.config/juff/sessions/_empty_session_' was parsed successfully" 
Cannot allocate ENCA analyzer for C 
libpng warning: iCCP: known incorrect sRGB profile
"[15:38:47]" "  Entering tabRemoved (TabWidget.cpp:113)" 
"[15:38:47]" "    Entering onTabRemoved (DocViewer.cpp:431)" 
"[15:38:47]" "    Leaving  onTabRemoved (DocViewer.cpp)" 
"[15:38:47]" "  Leaving  tabRemoved (TabWidget.cpp)" 
Segmentation fault (core dumped)
pvanek commented 10 years ago

cannot reproduce (0.10 on linux/Qt4, 0.10/Qt4 and git master/Qt5 on mac). Can you run it under debugger, please?

gdb path/to/juffed

type "run", wait for crash, type "bt"

with installed debug symbols ideally...

pierretom commented 8 years ago

Hello,

Commit: 54b9cb4 Date: Tue Nov 17 07:29:30 2015 +0100 Qt version: 5.5.1

I can reproduce something similar:

Here a backtrace:

(gdb) r
Starting program: /usr/local/bin/juffed 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeb835700 (LWP 4149)]
"[15:13:29]" "--- Plugin 'Autosave' is disabled in Settings."
"[15:13:29]" "--- Plugin 'Color Picker' is disabled in Settings."
"[15:13:29]" "+++ Plugin 'Documents List' was loaded successfully."
"[15:13:29]" "+++ Plugin 'Favorites' was loaded successfully."
QObject::connect: No such signal FindWorker::terminated()
"[15:13:29]" "+++ Plugin 'Find In Files' was loaded successfully."
[New Thread 0x7fffe28d8700 (LWP 4150)]
"[15:13:29]" "+++ Plugin 'File manager' was loaded successfully."
"[15:13:29]" "+++ Plugin 'Keybindings' was loaded successfully."
"[15:13:29]" "+++ Plugin 'Sort Document' was loaded successfully."
"[15:13:29]" "+++ Plugin 'Symbol_browser' was loaded successfully."
"[15:13:29]" "+++ Plugin 'XML Formatter' was loaded successfully."
"[15:13:29]" "Session '/home/pierre/.config/juff/sessions/_empty_session_' opened successfully"
"[15:13:29]" "Session '/home/pierre/.config/juff/sessions/_empty_session_' was parsed successfully"
[New Thread 0x7fffd967c700 (LWP 4151)]
[Thread 0x7fffd967c700 (LWP 4151) exited]
[New Thread 0x7fffd967c700 (LWP 4152)]
[Thread 0x7fffd967c700 (LWP 4152) exited]
[New Thread 0x7fffd967c700 (LWP 4157)]
[Thread 0x7fffd967c700 (LWP 4157) exited]
"[15:13:59]" "  Entering tabRemoved (TabWidget.cpp:113)"
"[15:13:59]" "    Entering onTabRemoved (DocViewer.cpp:434)"
"[15:13:59]" "    Leaving  onTabRemoved (DocViewer.cpp)"
"[15:13:59]" "  Leaving  tabRemoved (TabWidget.cpp)"
[New Thread 0x7fffd967c700 (LWP 4158)]
[New Thread 0x7fffd3fff700 (LWP 4159)]
[New Thread 0x7fffd37fe700 (LWP 4160)]
[Thread 0x7fffd967c700 (LWP 4158) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6901980 in QString::operator=(QString const&) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
(gdb) bt
#0  0x00007ffff6901980 in QString::operator=(QString const&) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x00007fffe1a8b939 in DocSymbols::setDocName (this=0x0, value=...) at /home/pierre/git/juffed/plugins/symbolbrowser/symbols/docsymbols.cpp:135
#2  0x00007fffe1a8f7cf in SymbolTreeView::docRenamed (this=0xab2af0, oldDocName=..., newDocName=...)
    at /home/pierre/git/juffed/plugins/symbolbrowser/symbols/symboltreeview.cpp:186
#3  0x00007fffe1a9e88f in SymbolBrowser::onDocRenamed (this=0xab1b30, document=0xab00f0, oldName=...) at /home/pierre/git/juffed/plugins/symbolbrowser/SymbolBrowser.cpp:218
#4  0x00007fffe1a9fcfb in SymbolBrowser::qt_static_metacall (_o=0xab1b30, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffffffd180)
    at /home/pierre/git/juffed/build/plugins/symbolbrowser/moc_SymbolBrowser.cpp:172
#5  0x00007ffff6a826ca in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff792f7b1 in JuffAPI::docRenamed (this=0xa23de0, _t1=0xab00f0, _t2=...) at /home/pierre/git/juffed/build/moc_JuffAPI.cpp:427
#7  0x00007ffff792ec70 in JuffAPI::qt_static_metacall (_o=0xa23de0, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fffffffd330)
    at /home/pierre/git/juffed/build/moc_JuffAPI.cpp:138
#8  0x00007ffff6a826ca in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff7930477 in Juff::PluginNotifier::docRenamed (this=0x7fffffffe650, _t1=0xab00f0, _t2=...) at /home/pierre/git/juffed/build/moc_PluginNotifier.cpp:311
#10 0x0000000000444a20 in JuffEd::onDocRenamed (this=0x7fffffffe650, oldName=...) at /home/pierre/git/juffed/src/app/JuffEd.cpp:887
#11 0x000000000047ff99 in JuffEd::qt_static_metacall (_o=0x7fffffffe650, _c=QMetaObject::InvokeMetaMethod, _id=42, _a=0x7fffffffd4e0)
    at /home/pierre/git/juffed/build/moc_JuffEd.cpp:271
#12 0x00007ffff6a826ca in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff792eb7b in Juff::Document::renamed (this=0xab00f0, _t1=...) at /home/pierre/git/juffed/build/moc_Document.cpp:252
#14 0x00007ffff7921fa4 in Juff::Document::saveAs (this=0xab00f0, fileName=..., error=...) at /home/pierre/git/juffed/src/lib/Document.cpp:306
#15 0x00007ffff7baba66 in Juff::SciDoc::saveAs (this=0xab00f0, fileName=..., error=...) at /home/pierre/git/juffed/src/app/qsci/SciDoc.cpp:1230
#16 0x00000000004460b9 in JuffEd::saveDocAs (this=0x7fffffffe650, doc=0xab00f0) at /home/pierre/git/juffed/src/app/JuffEd.cpp:1109
#17 0x0000000000443705 in JuffEd::slotFileSaveAs (this=0x7fffffffe650) at /home/pierre/git/juffed/src/app/JuffEd.cpp:562
#18 0x000000000047fca0 in JuffEd::qt_static_metacall (_o=0x7fffffffe650, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffffffd7e0)
---Type <return> to continue, or q <return> to quit---
    at /home/pierre/git/juffed/build/moc_JuffEd.cpp:233
#19 0x00007ffff6a826ca in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff733d3b2 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff733f838 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff74c21b2 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff74c846c in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff74cc3b0 in QMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ffff7389ff8 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007ffff74ccdf3 in QMenu::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007ffff7346ffc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007ffff734cbc9 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#29 0x00007ffff6a53b6b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007ffff734bad2 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007ffff73a48cd in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007ffff73a6b2b in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#33 0x00007ffff7346ffc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#34 0x00007ffff734c4c6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#35 0x00007ffff6a53b6b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#36 0x00007ffff6d96201 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#37 0x00007ffff6d97ec5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#38 0x00007ffff6d7be38 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#39 0x00007fffee223dc0 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
---Type <return> to continue, or q <return> to quit---
#40 0x00007ffff4abcfd7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007ffff4abd230 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#42 0x00007ffff4abd2dc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#43 0x00007ffff6aaa2df in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#44 0x00007ffff6a512fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#45 0x00007ffff6a593dc in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#46 0x0000000000450ea4 in runSingle (argc=1, argv=0x7fffffffe8f8) at /home/pierre/git/juffed/src/app/main.cpp:164
#47 0x0000000000451177 in main (argc=1, argv=0x7fffffffe8f8) at /home/pierre/git/juffed/src/app/main.cpp:186
pmattern commented 8 years ago

I can confirm the findings of @pierretom but would like to add two notes.

The steps to reproduce can be put more general:

The problem seems to be rather long-standing as crashes like that can be seen with 0.10 compiled against Qt 4.8.7 and 5ba17f9 compiled against Qt 5.6.0 or 4.8.7 on Arch Linux. Traces corresponding with these crashes can be found in this GIST.

@kokizzu, @pvanek Any chance you can try and verify this? And if so, could you eventually adjust this issue's title such that it reflects the problem is more general and not limited to a distinct file type?

pvanek commented 8 years ago

aaha, aha, confirmed. The crash is after you prees/click OK button in the save dialog

q4a commented 2 years ago

This should be fixed with: https://github.com/Mezomish/juffed/commit/69c6a305555a1059696c68a74add70b3c7466dd0