eteran / nedit-ng

a Qt5 port of the NEdit using modern C++14
GNU General Public License v2.0
95 stars 26 forks source link

crashes with version 2020.1-135-g78752b2 #249

Closed marilmanen closed 3 years ago

marilmanen commented 3 years ago

Unfortunately it's me again. I have started getting daily crashes (yesterday and today), but I have not yet figured out what triggers the crash. I have removed some of the files that are open in nedit-ng, so maybe there's still something wrong in that area.... This crash happened when I tried to run a macro.

#0  0x00002ae97806f22c in QtSharedPointer::ExternalRefCountData::getAndRef(QObject const*) () at /lib64/libQt5Core.so.5
#1  0x00002ae9775ee44c in QWidgetWindow::handleMouseEvent(QMouseEvent*) () at /lib64/libQt5Widgets.so.5
#2  0x00002ae9775f0d65 in QWidgetWindow::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#3  0x00002ae977596d8c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#4  0x00002ae97759df68 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#5  0x00002ae9781afbe6 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#6  0x00002ae977ba51ed in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /lib64/libQt5Gui.so.5
#7  0x00002ae977ba6f25 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /lib64/libQt5Gui.so.5
#8  0x00002ae977b848db in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Gui.so.5
#9  0x00002ae9805d2950 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5XcbQpa.so.5
#10 0x00002ae97cab8099 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#11 0x00002ae97cab83f8 in g_main_context_iterate.isra.19 () at /lib64/libglib-2.0.so.0
#12 0x00002ae97cab84ac in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#13 0x00002ae9781fe45c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#14 0x00002ae9781ae6db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#15 0x00002ae97771527d in QMenu::exec(QPoint const&, QAction*) () at /lib64/libQt5Widgets.so.5
#16 0x00002ae9781d8273 in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#17 0x00002ae9775bb7f5 in QWidget::customContextMenuRequested(QPoint const&) () at /lib64/libQt5Widgets.so.5
#18 0x0000000000586d49 in TextArea::contextMenuEvent(QContextMenuEvent*) (this=0x1d982c0, event=<optimized out>)
    at /tools/ext/free/downloads/nedit-ng/src/TextArea.cpp:1100
#19 0x00002ae9775d553e in QWidget::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#20 0x00002ae97767b70e in QFrame::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#21 0x00002ae9781af9dd in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#22 0x00002ae977596d65 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#23 0x00002ae97759f42a in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#24 0x00002ae9781afbe6 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#25 0x00002ae9775ee87d in QWidgetWindow::handleMouseEvent(QMouseEvent*) () at /lib64/libQt5Widgets.so.5
#26 0x00002ae9775f0d65 in QWidgetWindow::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#27 0x00002ae977596d8c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#28 0x00002ae97759df68 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#29 0x00002ae9781afbe6 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#30 0x00002ae977ba51ed in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /lib64/libQt5Gui.so.5
#31 0x00002ae977ba6f25 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /lib64/libQt5Gui.so.5
#32 0x00002ae977b848db in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Gui.so.5
#33 0x00002ae9805d2950 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5XcbQpa.so.5
#34 0x00002ae97cab8099 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#35 0x00002ae97cab83f8 in g_main_context_iterate.isra.19 () at /lib64/libglib-2.0.so.0
#36 0x00002ae97cab84ac in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#37 0x00002ae9781fe45c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#38 0x00002ae9781ae6db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#39 0x00002ae9781b6c04 in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#40 0x00000000004978c2 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /tools/ext/free/downloads/nedit-ng/src/nedit.cpp:149
anjohnson commented 3 years ago

Getting warmer, but that doesn't fully explain this:

woz$ ls src/*.h | wc -l
     104
woz$ nc-ng src/*.h       # Just "Untitled"
Socket Error State: 1
Socket Error String: QLocalSocket: Remote closed

woz$ ls src/*.cpp | wc -l
      69
woz$ nc-ng src/*.cpp     # Just "Untitled"
Socket Error State: -1
Socket Error String: Unknown error

woz$ nc-ng client/nc.cpp # Opened properly
Socket Error State: -1
NEdit: client request packet received:
[
    {
        "create": 0,
        "geometry": "",
        "iconic": 0,
        "is_tabbed": -1,
        "langMode": "",
        "line_number": 0,
        "path": "/Users/anj/Software/other/nedit-ng/client/nc.cpp",
        "read": 0,
        "toDoCommand": "",
        "wait": false
    }
]

Socket Error String: Unknown error

I did just trigger these too, which are a bit different:

woz$ nc-ng src/*.h
QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
Socket Error State: 1
Socket Error String: QLocalSocket: Remote closed
woz$ nc-ng src/*.cpp
QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
Socket Error State: 1
Socket Error String: QLocalSocket: Remote closed
eteran commented 3 years ago

@anjohnson I think/hope that my next push to master will address the "just seeing Untitled" issue when opening large sets of files. It also will fix the fact that release builds had all log output effectively disabled. That wasn't intentional :-P.

eteran commented 3 years ago

OK, @anjohnson pushed to master. I believe that this will fix half of your issue :-). And you should see better feedback when something goes wrong ;-P

eteran commented 3 years ago

@marilmanen reproduced! XFce does indeed seem to be a factor, I'll do my best to resolve this ASAP!

eteran commented 3 years ago

@marilmanen perhaps fixed in master?!?

~NOTE, now that I've fixed debug logging, on some platforms we get "Warning: QCoreApplication::postEvent messages".~

I am going to look into that, but it seems mostly harmless for now aside from cluttering the console.|

EDIT: Fixed that in master too!

marilmanen commented 3 years ago

Great, it seems to work or at least no more crashes with the simple ways I had previously.

eteran commented 3 years ago

@marilmanen FANTASTIC!

I can say that I snuck in a quick context menu fix after my last comment. So if you're not QUITE up to date, it is recommended to update (sorry for the rapid-fire commits, but when I'm in a groove I tend to just bang out code).

I'm going to close this issue! Please re-open/open a new issue if a similar problem occurs.

@anjohnson I think we should track your issue with a new issue. I'll create it and tag you in it!