pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.61k stars 410 forks source link

v21.11.9 - Segfault on first launch when double-clicking highlighted file in note list #2309

Closed sahensley closed 2 years ago

sahensley commented 2 years ago

Expected behaviour

The content is opened in a new tab.

Actual behaviour

The application crashes. When launching from the CLI - the error which goes to the console is a segfault.

Steps to reproduce

This issue happens in very specific circumstances. I swear I'm not trying to model my workflow after this appropriate XKCD 😄

For reference, this screenshot has been taken immediately after launching 21.11.8. The last note I used - "_scratchpad" - loads into the main editor panel. QOwnNotes - 21 11 8

This is a screenshot immediately after launching 21.11.9. Notice how the main editor panel is blank. I can trigger a crash (no error dialog) by double-clicking on the note which is highlighted by default in the Note List panel, which is the _scratchpad note in this instance. I can completely avoid a crash by clicking on any other note, which then puts text into the editor panel. Once the panel has content in it, I can go back to the initial note of the session without issue.

QOwnNotes - version 21 11 9 - build 916

If QON has the option to "Restore open notes.." and tabs were open when the application was closed, QON will not crash when double-clicking the note highlighted upon launch.

So to summarize the very specific circumstances:

I verified this happens on both the Linux AppImage and Windows install of 21.11.9.

Let me know if you run into any issues replicating the crash, I can record a video of some sort. Thanks again! 😄

pbek commented 2 years ago

I can't reproduce a crash with 21.11.9 so far on Linux or macOS. So the application doesn't crash for you in 21.11.8? It could have something to do with #2303 (@Waqar144?).

Can you please post the output from the debug settings that you can copy when you get into the settings dialog in QOwnNotes and head over to the Debug section of it.

Do you have the same issue when running QOwnNotes in a new session (see cli-parameters)?

Waqar144 commented 2 years ago

I can't reproduce a crash with 21.11.9 so far on Linux or macOS. So the application doesn't crash for you in 21.11.8? It could have something to do with #2303 (@Waqar144?).

Most likely, yes. Maybe something we are not guarding against and it just surfaced now.

Can you try this on linux?

If that doesn't work, try running QON from the terminal? gdb ./QON and make it crash. Once it crashes (will freeze when in gdb), go back to the terminal and type bt. Copy paste the output here.

And if that doesn't help, I think we can just revert the PR till we can find what the cause is.

pbek commented 2 years ago

So far I didn't manage to start with an empty note edit panel in 21.11.9...

Waqar144 commented 2 years ago

Me too, but there are too many settings combinations so could be because of that.

sahensley commented 2 years ago

I'll create a new user on my personal laptop and grab that data tonight. The good news is, this bug is obscure enough that I don't think too many people will be impacted :grin:

pbek commented 2 years ago

And maybe it's just one person. 😉

Waqar144 commented 2 years ago

The good news is, this bug is obscure enough

That's very bad news to me as a developer 😂

sahensley commented 2 years ago

I created a new system user, downloaded QON, went through the settings with default options and I could not replicate the issue until I introduced a plugin.

Once I added the @tag tagging in note text (experimental) plugin and restarted, the blank note panel upon launch and crash when double-clicking the highlighted note as the first action appeared. The crash only started after 21.9.11 but it appears to be tied to this plugin.

I'll leave the issue open incase there is anything you want to test or investigate but feel free to close it as this appears to be isolated to the plugin.

Core dump - Expand Core dump: [qontest@moocow Downloads]$ ./QOwnNotes-x86_64.AppImage Info: "QOwnNotes server listening on port 22222" ((null):0, (null)) Segmentation fault (core dumped) [qontest@moocow Downloads]$ coredumpctl debug Hint: You are currently not seeing messages from other users and the system. Users in groups 'adm', 'systemd-journal', 'wheel' can see all messages. Pass -q to turn off this notice. PID: 12442 (AppRun) UID: 1002 (qontest) GID: 1003 (qontest) Signal: 11 (SEGV) Timestamp: Tue 2021-11-23 22:50:46 CST (8s ago) Command Line: ./QOwnNotes-x86_64.AppImage Executable: /tmp/.mount_QOwnNoW072Mq/usr/bin/QOwnNotes Control Group: /user.slice/user-1002.slice/user@1002.service/app.slice/app-org.kde.konsole-1ab1020d39094a569e10ee290f61cf43.scope Unit: user@1002.service User Unit: app-org.kde.konsole-1ab1020d39094a569e10ee290f61cf43.scope Slice: user-1002.slice Owner UID: 1002 (qontest) Boot ID: 9c9f52fd7f0a435980c4acd25570edf9 Machine ID: fbfb70d0d0c141b8bb55244cb847ece8 Hostname: moocow Storage: /var/lib/systemd/coredump/core.AppRun.1002.9c9f52fd7f0a435980c4acd25570edf9.12442.1637729446000000.zst (present) Disk Size: 4.5M Message: Process 12442 (AppRun) of user 1002 dumped core. Stack trace of thread 12442: #0 0x00007f299c90b0aa n/a (/tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Core.so.5 + 0x2ca0aa) #1 0x00007ffd2bec2930 n/a (n/a + 0x0) GNU gdb (GDB) Fedora 11.1-2.fc34 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... /tmp/.mount_QOwnNoW072Mq/usr/bin/QOwnNotes: No such file or directory. warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/bin/QOwnNotes during file-backed mapping note processing warning: Can't open file /memfd:xorg (deleted) during file-backed mapping note processing warning: Can't open file /memfd:JITCode:QtQml (deleted) during file-backed mapping note processing warning: Can't open file anon_inode:i915.gem which was expanded to anon_inode:i915.gem during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-glx.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so during file-backed mapping note processing warning: Can't open file /memfd:unknown-usage:QtQml (deleted) during file-backed mapping note processing warning: Can't open file /memfd:JSGCHeap:QtQml (deleted) during file-backed mapping note processing warning: Can't open file /memfd:JSVMStack:QtQml (deleted) during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqwebp.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqwbmp.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqtiff.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqtga.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqjpeg.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqico.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqicns.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqgif.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/imageformats/libqsvg.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Svg.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/iconengines/libqsvgicon.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/sqldrivers/libqsqlite.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libssl.so.1.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libcrypto.so.1.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/bearer/libqnmbearer.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/bearer/libqgenericbearer.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/bearer/libqconnmanbearer.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libgcrypt.so.20 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/liblz4.so.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libsystemd.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libdbus-1.so.3 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxkbcommon.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxkbcommon-x11.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-xkb.so.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-xinerama.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-xfixes.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-sync.so.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-shape.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-render.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-render-util.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-randr.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-keysyms.so.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-util.so.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-shm.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-image.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libxcb-icccm.so.4 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libX11-xcb.so.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5DBus.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5XcbQpa.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/plugins/platforms/libqxcb.so during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libkeyutils.so.1 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libkrb5support.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libk5crypto.so.3 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libkrb5.so.3 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libgthread-2.0.so.0 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libicudata.so.56 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libicuuc.so.56 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libicui18n.so.56 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libgssapi_krb5.so.2 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Core.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Xml.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Network.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5XmlPatterns.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5WebSockets.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Qml.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Sql.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Gui.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5X11Extras.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5Widgets.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/lib/libQt5PrintSupport.so.5 during file-backed mapping note processing warning: Can't open file /tmp/.mount_QOwnNoW072Mq/usr/translations/qt_en.qm during file-backed mapping note processing warning: Can't open file /SYSV512801f0 (deleted) during file-backed mapping note processing [New LWP 12442] [New LWP 12457] [New LWP 12456] [New LWP 12465] [New LWP 12463] [New LWP 12460] [New LWP 12451] [New LWP 12453] [New LWP 12458] [New LWP 12454] [New LWP 12464] [New LWP 12462] [New LWP 12459] [New LWP 12461] [New LWP 12455] Missing separate debuginfo for the main executable file Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/8f/6197506d6f49a50a9fccc469d475db72df3bc5 --Type for more, q to quit, c to continue without paging-- Core was generated by `./QOwnNotes-x86_64.AppImage'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f299c90b0aa in ?? () [Current thread is 1 (LWP 12442)] (gdb) q
Debug info - Expand Debug settings QOwnNotes Debug Information =========================== ## General Info **Current Date**: `Tue Nov 23 22:58:10 2021` **Version**: `21.9.13` **Build date**: `Oct 1 2021` **Build number**: `890` **Platform**: `linux` **Operating System**: `Fedora 34 (Workstation Edition)` **Build architecture**: `x86_64` **Current architecture**: `x86_64` **Release**: `Self-build` **Qt Version (build)**: `5.15.2` **Qt Version (runtime)**: `5.15.2` **Portable mode**: `no` **Settings path / key**: `/home/qontest/.config/PBE/QOwnNotes.conf` **Application database path**: `/home/qontest/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite` **Application arguments**: `/usr/bin/QOwnNotes` **Qt Debug**: `0` **Locale (system)**: `en_US` **Locale (interface)**: *empty* **Primary screen resolution**: `2560x1440` **Icon theme**: `breeze` **Notes in current note folder**: `2` **Calendar items**: `0` **Enabled scripts**: `1` ## Server Info **serverUrl**: *empty* **appIsValid**: `no` **notesPathExists**: *empty* **connectionErrorMessage**: *empty* ## Spellchecking **Enabled**: `true` **Selected language**: `auto` **Language codes**: `en_AG, en_AU, en_BS, en_BW, en_BZ, en_CA, en_DK, en_GB, en_GH, en_HK, en_IE, en_IN, en_JM, en_MW, en_NA, en_NG, en_NZ, en_PH, en_SG, en_TT, en_US, en_ZA, en_ZM, en_ZW` **Language names**: `English (Antigua & Barbuda), Australian English (Australia), English (Bahamas), English (Botswana), English (Belize), Canadian English (Canada), English (Denmark), British English (United Kingdom), English (Ghana), English (Hong Kong SAR China), English (Ireland), English (India), English (Jamaica), English (Malawi), English (Namibia), English (Nigeria), English (New Zealand), English (Philippines), English (Singapore), English (Trinidad & Tobago), American English (United States), English (South Africa), English (Zambia), English (Zimbabwe)` **Application dictionaries path**: `/home/qontest/.local/share/PBE/QOwnNotes/dicts` ## Note folders **currentNoteFolderId**: `1` ### Note folder `default` **id**: `1` **isCurrent**: `yes` **activeTagId**: `0` **localPath**: `/home/qontest/Notes` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `no` **isUseGit**: `no` **activeNoteSubFolder name**: *empty* **database file**: `/home/qontest/Notes/notes.sqlite` ## Cloud connections ### Cloud connection `Default` **id**: `1` **isCurrent**: `yes` **serverUrl**: *empty* **username**: *empty* ## Enabled scripts ### Script `@tag tagging in note text (experimental)` **id**: `2` **path**: `/home/qontest/.local/share/PBE/QOwnNotes/scripts/in-note-text-tagging/in-note-text-tagging.qml` **variablesJson**: ``` { "tagMarker": "@@" } ``` **identifier**: `in-note-text-tagging` **version**: `0.2.0` **minAppVersion**: `20.6.0` ## Settings **ActiveNoteHistoryItem** (NoteHistoryItem): `` **Debug/fakeOldVersionNumber** (QString): `false` **Debug/fileLogging** (QString): `false` **Editor/CurrentSchemaKey** (QString): `EditorColorSchema-6033d61b-cb96-46d5-a3a8-20d5172017eb` **Editor/autoBracketClosing** (QString): `true` **Editor/autoBracketRemoval** (QString): `true` **Editor/disableCursorBlinking** (QString): `false` **Editor/editorWidthInDFMOnly** (QString): `true` **Editor/highlightCurrentLine** (QString): `true` **Editor/indentSize** (QString): `4` **Editor/removeTrailingSpaces** (QString): `false` **Editor/showLineNumbers** (QString): `false` **Editor/useTabIndent** (QString): `false` **Editor/vimMode** (QString): `false` **LastUpdateCheck** (QDateTime): `2021-11-23T22:57:33.928` **MainWindow/geometry** (QByteArray): `` **MainWindow/mainToolBar.iconSize** (QString): `24` **MainWindow/menuBarGeometry** (QByteArray): `` **MainWindow/noteTextEdit.code.font** (QString): `Noto Sans Mono,10,-1,5,50,0,0,0,0,0` **MainWindow/noteTextEdit.font** (QString): `Noto Sans,10,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.code.font** (QString): `Noto Sans Mono,10,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.font** (QString): `Noto Sans,10,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.ignoreCodeFontSize** (QString): `true` **MainWindow/noteTextView.rtl** (QString): `false` **MainWindow/noteTextView.underline** (QString): `true` **MainWindow/noteTextView.useEditorStyles** (QString): `true` **MainWindow/noteTextView.useInternalExportStyling** (QString): `true` **MainWindow/showNotesFromAllNoteSubFolders** (QString): `false` **NoteFolder-1/NoteTabNameList**: *empty* **NoteFolder-1/NoteTabStickinessList**: *empty* **NoteFolder-1/NoteTabSubFolderPathDataList**: *empty* **NoteFolder-1/allowDifferentNoteFileName** (bool): `true` **NoteHistory-1** (QVariantList): `` **NoteHistoryCurrentIndex-1** (QString): `3` **PiwikClientId** (QString): `` **ScriptRepositoryDialog/geometry** (QByteArray): `` **ScriptRepositoryDialog/mainSplitterState** (QByteArray): `` **SearchEngineId** (QString): `2` **SettingsDialog/geometry** (QByteArray): `` **SettingsDialog/mainSplitterState** (QByteArray): `` **ShowSystemTray** (QString): `false` **StartHidden** (QString): `false` **UpdateDialog/geometry** (QByteArray): `` **WelcomeDialog/geometry** (QByteArray): `` **acceptAllExternalModifications** (QString): `false` **allowNoteEditing** (bool): `true` **allowOnlyOneAppInstance** (QString): `true` **appMetrics/disableAppHeartbeat** (QString): `false` **appMetrics/disableTracking** (QString): `false` **appMetrics/notificationShown** (QString): `true` **automaticNoteFolderDatabaseClosing** (QString): `false` **checkSpelling** (bool): `true` **closeTodoListAfterSave** (QString): `false` **cryptoKey** (QString): `` **currentNoteFolderId** (QString): `1` **currentWorkspace** (QString): `initial` **cursorWidth** (QString): `1` **customNoteFileExtensionList** (QStringList): `md, txt` **darkMode** (QString): `false` **darkModeColors** (QString): `false` **darkModeIconTheme** (QString): `false` **darkModeTrayIcon** (QString): `false` **defaultNoteFileExtension** (QString): `md` **demoNotesCreated** (QString): `true` **disableAutomaticUpdateDialog** (QString): `false` **disableSavedSearchesAutoCompletion** (QString): `false` **dockWasInitializedOnce** (QString): `true` **enableNoteTree** (QString): `false` **enableSocketServer** (QString): `true` **enableWebAppSupport** (QString): `false` **externalEditorPath** (QString): *empty* **fullyHighlightedBlockquotes** (QString): `false` **gitCommitInterval** (QString): `30` **gitExecutablePath** (QString): *empty* **gitLogCommand** (QString): *empty* **guiFirstRunInit** (bool): `true` **ignoreAllExternalModifications** (QString): `false` **ignoreAllExternalNoteFolderChanges** (QString): `false` **ignoreNoteSubFolders** (QString): `^\.` **imageScaleDown** (QString): `false` **imageScaleDownMaximumHeight** (QString): `1024` **imageScaleDownMaximumWidth** (QString): `1024` **initialLayoutIdentifier** (QString): `minimal` **insertTimeFormat** (QString): *empty* **interfaceFontSize** (QString): `11` **interfaceLanguage** (QString): *empty* **internalIconTheme** (QString): `false` **itemHeight** (QString): `18` **legacyLinking** (QString): `false` **localTrash/autoCleanupDays** (QString): `30` **localTrash/autoCleanupEnabled** (QString): `true` **localTrash/supportEnabled** (QString): `true` **markdownHighlightingEnabled** (QString): `true` **navigationPanelHideSearch** (QString): `false` **networking/ignoreSSLErrors** (QString): `true` **networking/proxyType** (QString): `2` **newNoteAskHeadline** (QString): `false` **noteEditIsCentralWidget** (QString): `true` **noteListPreview** (QString): `false` **noteSaveIntervalTime** (QString): `10` **noteSubfoldersPanelDisplayAsFullTree** (QString): `true` **noteSubfoldersPanelHideSearch** (QString): `false` **noteSubfoldersPanelOrder** (QString): `0` **noteSubfoldersPanelShowFullPath** (QString): `false` **noteSubfoldersPanelShowNotesRecursively** (QString): `false` **noteSubfoldersPanelShowRootFolderName** (QString): `true` **noteSubfoldersPanelSort** (QString): `0` **notesPanelOrder** (QString): `0` **notesPanelSort** (QString): `1` **notesPath** (QString): `/home/qontest/Notes` **notifyAllExternalModifications** (QString): `false` **overrideInterfaceFontSize** (QString): `false` **ownCloud/supportEnabled** (QString): `false` **ownCloud/todoCalendarBackend** (QString): `3` **ownCloud/todoCalendarCalDAVPassword** (QString): `` **ownCloud/todoCalendarCalDAVServerUrl** (QString): *empty* **ownCloud/todoCalendarCalDAVUsername** (QString): *empty* **ownCloud/todoCalendarCloudConnectionId** (QString): `1` **ownCloud/todoCalendarDisplayNameList**: *empty* **ownCloud/todoCalendarEnabledList**: *empty* **ownCloud/todoCalendarEnabledUrlList**: *empty* **ownCloud/todoCalendarUrlList**: *empty* **ownCloudInfo/appIsValid** (bool): `false` **ownCloudInfo/connectionErrorMessage** (QString): *empty* **ownCloudInfo/notesPathExistsText** (QString): *empty* **ownCloudInfo/serverVersion** (QString): *empty* **restoreCursorPosition** (QString): `true` **restoreLastNoteAtStartup** (QString): `true` **restoreNoteTabs** (QString): `true` **savedSearches/noteFolder-1** (QStringList): `Note 2021-11-23T22.29.25, Note 2021-11-23T22.29.20` **showMatches** (QString): `true` **showMenuBar** (bool): `true` **showStatusBar** (bool): `true` **spellCheckLanguage** (QString): `auto` **systemIconTheme** (QString): `false` **taggingShowNotesRecursively** (QString): `false` **tagsPanelHideNoteCount** (QString): `false` **tagsPanelHideSearch** (QString): `false` **tagsPanelOrder** (QString): `0` **tagsPanelSort** (QString): `0` **todoCalendarSupport** (QString): `true` **toolbar/1/items** (QStringList): `action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionShow_local_trash, actionAllow_note_editing, , action_Back_in_note_history, action_Forward_in_note_history, , action_Find_text_in_note, actionReplace_in_current_note, , actionShow_versions, actionShow_trash, actionShare_note, , actionShow_Todo_List` **toolbar/1/name** (QString): `mainToolBar` **toolbar/1/title** (QString): `main toolbar` **toolbar/2/items** (QStringList): `actionFormat_text_bold, actionFormat_text_italic, actionStrike_out_text, actionInsert_code_block, actionInsert_block_quote` **toolbar/2/name** (QString): `formattingToolbar` **toolbar/2/title** (QString): `formatting toolbar` **toolbar/3/items** (QStringList): `actionInsert_text_link, actionInsert_image, actionInsert_current_time` **toolbar/3/name** (QString): `insertingToolbar` **toolbar/3/title** (QString): `inserting toolbar` **toolbar/4/items** (QStringList): `action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note` **toolbar/4/name** (QString): `encryptionToolbar` **toolbar/4/title** (QString): `encryption toolbar` **toolbar/5/items** (QStringList): `actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size` **toolbar/5/name** (QString): `windowToolbar` **toolbar/5/title** (QString): `window toolbar` **toolbar/6/items** (QString): `action_Quit` **toolbar/6/name** (QString): `quitToolbar` **toolbar/6/title** (QString): `quit toolbar` **toolbar/size** (QString): `6` **useNoteFolderButtons** (QString): `false` **useUNIXNewline** (QString): `false` **webAppClientService/serverUrl** (QString): `wss://app.qownnotes.org` **webAppClientService/token** (QString): `` **webSocketServerService/bookmarksNoteName** (QString): `Commands` **webSocketServerService/bookmarksTag** (QString): `bookmarks` **webSocketServerService/commandSnippetsTag** (QString): `commands` **webSocketServerService/port** (QString): `22222` **workspace-initial/name** (QString): `Minimal` **workspace-initial/noteSubFolderDockWidgetVisible** (QString): `true` **workspace-initial/windowState** (QByteArray): `` **workspaces** (QString): `initial` ## System environment **HOME**: `/home/qontest` **LANG**: `en_US.UTF-8` **LOGNAME**: `qontest` **PATH**: `/home/qontest/.local/bin:/home/qontest/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin` **SHELL**: `/bin/bash` **SYSTEMD_EXEC_PID**: `8071` **USER**: `qontest` **XDG_RUNTIME_DIR**: `/run/user/1002` **XDG_DATA_DIRS**: `/home/qontest/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/` **DBUS_SESSION_BUS_ADDRESS**: `unix:path=/run/user/1002/bus` **DESKTOP_SESSION**: `plasmax11` **DISPLAY**: `:0` **EDITOR**: `/usr/bin/nano` **GDK_CORE_DEVICE_EVENTS**: `1` **GDMSESSION**: `plasmax11` **GDM_LANG**: `en_US.UTF-8` **GTK2_RC_FILES**: `/etc/gtk-2.0/gtkrc:/home/qontest/.gtkrc-2.0:/home/qontest/.gtkrc-2.0-kde4:/home/qontest/.config/gtkrc-2.0` **GTK_RC_FILES**: `/etc/gtk/gtkrc:/home/qontest/.gtkrc:/home/qontest/.config/gtkrc` **HISTCONTROL**: `ignoredups` **HISTSIZE**: `1000` **HOSTNAME**: `moocow` **KDEDIRS**: `/usr` **KDE_APPLICATIONS_AS_SCOPE**: `1` **KDE_FULL_SESSION**: `true` **KDE_SESSION_UID**: `1002` **KDE_SESSION_VERSION**: `5` **LESSOPEN**: `||/usr/bin/lesspipe.sh %s` **MAIL**: `/var/spool/mail/qontest` **MOZ_GMP_PATH**: `/usr/lib64/mozilla/plugins/gmp-gmpopenh264/system-installed` **PWD**: `/home/qontest` **QT_AUTO_SCREEN_SCALE_FACTOR**: `0` **SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS**: `0` **SESSION_MANAGER**: `local/unix:@/tmp/.ICE-unix/8014,unix/unix:/tmp/.ICE-unix/8014` **SHLVL**: `0` **SSH_AGENT_PID**: `7977` **SSH_ASKPASS**: `/usr/bin/ksshaskpass` **SSH_AUTH_SOCK**: `/tmp/ssh-XXXXXXvL5XXP/agent.7948` **STEAM_FRAME_FORCE_CLOSE**: `1` **USERNAME**: `qontest` **WINDOWPATH**: `4` **XAUTHORITY**: `/run/user/1002/gdm/Xauthority` **XCURSOR_SIZE**: `24` **XCURSOR_THEME**: `breeze_cursors` **XDG_CONFIG_DIRS**: `/home/qontest/.config/kdedefaults:/etc/xdg:/usr/share/kde-settings/kde-profile/default/xdg` **XDG_CURRENT_DESKTOP**: `KDE` **XDG_MENU_PREFIX**: `kf5-` **XDG_SEAT**: `seat0` **XDG_SESSION_CLASS**: `user` **XDG_SESSION_DESKTOP**: `plasmax11` **XDG_SESSION_ID**: `10` **XDG_SESSION_TYPE**: `x11` **XDG_VTNR**: `4` **_**: `/usr/bin/startplasma-x11` **which_declare**: `declare -f` **MANAGERPID**: `7856` **INVOCATION_ID**: `f645077e943c485289fec2d65b15b895` **JOURNAL_STREAM**: `8:133141`
pbek commented 2 years ago

Thank you, I can reproduce it now... I can fix the crash, but there are still things broken with the script on.

Waqar144 commented 2 years ago

Still doesn't crash for me even with the script enabled.

pbek commented 2 years ago

I get the empty note panel, there seems to be no current note... Then there is a crash in MainWindow::on_noteEditTabWidget_currentChanged(int index), but fixing the crash doesn't help with the empty note edit panel.

Waqar144 commented 2 years ago

the only way that could crash is if there is no currentWidget, so maybe we need to ensure we always have one during startup when we know that the notes are now available.

But besides that, enabling the script slows down the QON startup time by several second to a minute. And one reason for this is that our notes may contain images etc which are also grepped for tags by the script. We can atleast ignore those.

pbek commented 2 years ago

I don't think the issue is the crash (it can be fixed easily), it's more like the issue is that no current note is assigned.

pbek commented 2 years ago

21.11.10

Of course that doesn't fix the underlying issue.

pbek commented 2 years ago

There now is a new release, could you please test it and report if it works for you?

Waqar144 commented 2 years ago

Can it be that the notes weren't loaded yet and so there was no current note?

pbek commented 2 years ago

Yes, that maybe could be the issue. But it's still a timing problem. Because the there has to be a currentNote when the notes are finally loaded and shown. I also (like above) get an empty note edit with all notes loaded.

pbek commented 2 years ago

I just bisected the issue... It was introduced with #2303, @Waqar144 😉

pbek commented 2 years ago

And it's:

    QTimer::singleShot(10, this, [this]{
        updatePanelsSortOrder();
    });

That was not my first suspect... just my 2nd

pbek commented 2 years ago

updatePanelsSortOrder() does a loadNoteDirectoryList();. If I put that above below the singleshot it works... but I don't think it's worth to do that twice in that place... I'll look more into it.

pbek commented 2 years ago

If I just disable the handleScriptingNotesTagUpdating() call in MainWindow::reloadTagTree() it also works with the single shot...

Waqar144 commented 2 years ago

If I just disable the handleScriptingNotesTagUpdating() call in MainWindow::reloadTagTree() it also works with the single shot...

it doesn't in reality. That just makes things faster so you have a lower chance of hitting the issue ;)

pbek commented 2 years ago

Uhhh, it's the directoryWatcherWorkaround in handleScriptingNotesTagUpdating... It's veeeerrry bad idea to call directoryWatcherWorkaround asynchronously, because it blocks the directory watcher at some random time (and not at some predefined time).

pbek commented 2 years ago

We shouldn't call anything with directoryWatcherWorkaround in it (like updatePanelsSortOrder()) with singleshot during the "boot up process"... 😅

pbek commented 2 years ago

Of course I could make a workaround by testing if tagging is handled by a script with ScriptingService::instance()->noteTaggingHookExists() and decide whether to use singleshot or not... (along with adding a lot of explanation 😅 )

Waqar144 commented 2 years ago

How about we create a postInit() method and handle all delayed stuff there in one singleshot just. that way we can ensure some order between things and get the benefits as well. In the constructor itself we can do the bare minimum to get up and running.

pbek commented 2 years ago

Yeah, in this case I didn't have the issue when I just moved the singleshot code block a bit down... But I guess at the end of the initializer is the safest place

pbek commented 2 years ago

Meh, it was a fluke, it also doesn't work at the end of the initializer with singleShot.

pbek commented 2 years ago

It only works if I increase the delay time to 1 sec, that's long... maybe I really check for the tagging hooks.

Waqar144 commented 2 years ago

yep, proper solution is only to ensure we load notes before doing anything.

pbek commented 2 years ago

21.11.11

Waqar144 commented 2 years ago

https://github.com/pbek/QOwnNotes/commit/722b00a98d102a7aa1390fbae710d7387a8e7ac4 I don't think this is a good solution really. Its complexity for no reason and doesn't fix the underlying issue.

pbek commented 2 years ago

Suggestions?

pbek commented 2 years ago

doesn't fix the underlying issue

which issue? there are multiple 😅 e.g. that QSignalBlocker blocker(this->noteDirectoryWatcher) doesn't seem to block all file system events... thus the need for directoryWatcherWorkaround

Waqar144 commented 2 years ago

We need to ensure proper order between things as I understand it. So either we do that, which will require carefully checking things/function calls. Or we can just do the loadNotes() directly, no need to delay it and then the current note will be there.

pbek commented 2 years ago

The order was (most probably) proper before doing things asynchronously... I guess we never can be sure...

Waqar144 commented 2 years ago

So, imo it would be best to just revert that change or that part of change.

pbek commented 2 years ago

You mean not loading updatePanelsSortOrder() with singleShot at all?

pbek commented 2 years ago

Meanwhile, @sahensley... There now is a new release, could you please test it and report if it works for you?

sahensley commented 2 years ago

Oh wow, I certainly uncovered something with this issue :sweat_smile:

With 21.11.10, the issue still occurred. With 21.11.11, the issue has been resolved :tada:

I have the "tag in note" plugin enabled without any problems AND startup seems faster as well.

Thank you both @pbek and @Waqar144 !!

pbek commented 2 years ago

Great, thank you for testing!

With 21.11.10, the issue still occurred.

But no Segfault, right?

sahensley commented 2 years ago

Ah yes, good point.

No segfault on 21.11.10, the note editor panel would appear blank like the second screenshot in the initial issue. Then if the default highlighted note was double-clicked, the panel would go grey. Then double-clicking again would go back to the blank appearance. Clicking any other note than the one highlighted by default would solve that problem in 21.11.10 but it's great to see how 21.11.11 that isn't required at all.

pbek commented 2 years ago

Ok, thank you. 😉