Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When no text is selected the script ai-command.qml crashes the whole program on macOS #257

Closed
maxammann opened this issue Feb 6, 2025 · 5 comments

Comments

@maxammann
Copy link

The console shows:

libc++abi: terminating due to uncaught exception of type char const*

Full crash log

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c655c52 __pthread_kill + 10
2   libsystem_pthread.dylib       	    0x7ff80c68ff85 pthread_kill + 262
3   libsystem_c.dylib             	    0x7ff80c5b0b19 abort + 126
4   libc++abi.dylib               	    0x7ff80c647163 abort_message + 258
5   libc++abi.dylib               	    0x7ff80c6380ce demangling_terminate_handler() + 266
6   libobjc.A.dylib               	    0x7ff80c2d501b _objc_terminate() + 104
7   libc++abi.dylib               	    0x7ff80c64653b std::__terminate(void (*)()) + 6
8   libc++abi.dylib               	    0x7ff80c6493b4 __cxa_rethrow + 100
9   libobjc.A.dylib               	    0x7ff80c2e6d6b objc_exception_rethrow + 37
10  AppKit                        	    0x7ff810032af9 -[NSApplication run] + 690
11  libqcocoa.dylib               	       0x10ca7962f 0x10ca40000 + 235055
12  QtCore                        	       0x10d26aacf QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
13  QtCore                        	       0x10d26f042 QCoreApplication::exec() + 130
14  QOwnNotes                     	       0x10000cb65 main + 6229
15  dyld                          	       0x2007f72cd start + 1805

Thread 1:: com.apple.rosetta.exceptionserver
0   runtime                       	    0x7ff7fffbbea0 0x7ff7fffb8000 + 16032

Thread 2:: com.apple.rosetta.debugserver
0   runtime                       	    0x7ff7fffbbea0 0x7ff7fffb8000 + 16032

Thread 3:
0   runtime                       	    0x7ff7fffda954 0x7ff7fffb8000 + 141652

Thread 4:
0   runtime                       	    0x7ff7fffda954 0x7ff7fffb8000 + 141652

Thread 5:: Qt bearer thread
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c655cfe poll + 10
2   QtCore                        	       0x10d2d101a qt_safe_poll(pollfd*, unsigned int, timespec const*) + 90
3   QtCore                        	       0x10d2d2a21 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 849
4   QtCore                        	       0x10d26aacf QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
5   QtCore                        	       0x10d097603 QThread::exec() + 131
6   QtCore                        	       0x10d098619 0x10d076000 + 140825
7   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
8   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 6:: QNetworkAccessManager thread
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c655cfe poll + 10
2   QtCore                        	       0x10d2d1220 qt_safe_poll(pollfd*, unsigned int, timespec const*) + 608
3   QtCore                        	       0x10d2d2a21 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 849
4   QtCore                        	       0x10d26aacf QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
5   QtCore                        	       0x10d097603 QThread::exec() + 131
6   QtCore                        	       0x10d098619 0x10d076000 + 140825
7   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
8   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 7:: Thread (pooled)
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c651aaa __psynch_cvwait + 10
2   libsystem_pthread.dylib       	    0x7ff80c6907a8 _pthread_cond_wait + 1193
3   QtCore                        	       0x10d0a0aaf 0x10d076000 + 174767
4   QtCore                        	       0x10d0a077e 0x10d076000 + 173950
5   QtCore                        	       0x10d0a069d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
6   QtCore                        	       0x10d09cccd 0x10d076000 + 158925
7   QtCore                        	       0x10d098619 0x10d076000 + 140825
8   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
9   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 8:: QQmlThread
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c655cfe poll + 10
2   QtCore                        	       0x10d2d1220 qt_safe_poll(pollfd*, unsigned int, timespec const*) + 608
3   QtCore                        	       0x10d2d2a21 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 849
4   QtCore                        	       0x10d26aacf QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
5   QtCore                        	       0x10d097603 QThread::exec() + 131
6   QtQml                         	       0x10c2cf469 0x10c03c000 + 2700393
7   QtCore                        	       0x10d098619 0x10d076000 + 140825
8   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
9   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 9:
0   runtime                       	    0x7ff7fffda954 0x7ff7fffb8000 + 141652

Thread 10:: QQmlThread
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c655cfe poll + 10
2   QtCore                        	       0x10d2d1220 qt_safe_poll(pollfd*, unsigned int, timespec const*) + 608
3   QtCore                        	       0x10d2d2a21 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 849
4   QtCore                        	       0x10d26aacf QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
5   QtCore                        	       0x10d097603 QThread::exec() + 131
6   QtQml                         	       0x10c2cf469 0x10c03c000 + 2700393
7   QtCore                        	       0x10d098619 0x10d076000 + 140825
8   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
9   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 11:: QNetworkAccessManager thread
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c655cfe poll + 10
2   QtCore                        	       0x10d2d101a qt_safe_poll(pollfd*, unsigned int, timespec const*) + 90
3   QtCore                        	       0x10d2d2a21 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 849
4   QtCore                        	       0x10d26aacf QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
5   QtCore                        	       0x10d097603 QThread::exec() + 131
6   QtCore                        	       0x10d098619 0x10d076000 + 140825
7   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
8   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 12:: Thread (pooled)
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c651aaa __psynch_cvwait + 10
2   libsystem_pthread.dylib       	    0x7ff80c6907a8 _pthread_cond_wait + 1193
3   QtCore                        	       0x10d0a0aaf 0x10d076000 + 174767
4   QtCore                        	       0x10d0a077e 0x10d076000 + 173950
5   QtCore                        	       0x10d0a069d QWaitCondition::wait(QMutex*, QDeadlineTimer) + 93
6   QtCore                        	       0x10d09cccd 0x10d076000 + 158925
7   QtCore                        	       0x10d098619 0x10d076000 + 140825
8   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
9   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 13:
0   runtime                       	    0x7ff7fffda954 0x7ff7fffb8000 + 141652

Thread 14:: com.apple.NSEventThread
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c64ef0e mach_msg2_trap + 10
2   libsystem_kernel.dylib        	    0x7ff80c65d5fa mach_msg2_internal + 84
3   libsystem_kernel.dylib        	    0x7ff80c656016 mach_msg_overwrite + 649
4   libsystem_kernel.dylib        	    0x7ff80c64f1ff mach_msg + 19
5   CoreFoundation                	    0x7ff80c7775bd __CFRunLoopServiceMachPort + 143
6   CoreFoundation                	    0x7ff80c775fcd __CFRunLoopRun + 1393
7   CoreFoundation                	    0x7ff80c77542c CFRunLoopRunSpecific + 550
8   AppKit                        	    0x7ff81019706d _NSEventThread + 127
9   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
10  libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 15:: com.apple.CFSocket.private
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c657dd2 __select + 10
2   CoreFoundation                	    0x7ff80c79c911 __CFSocketManager + 660
3   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
4   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15

Thread 16:: QNetworkAccessManager thread
0   ???                           	    0x7ff89cb5ea84 ???
1   libsystem_kernel.dylib        	    0x7ff80c655cfe poll + 10
2   QtCore                        	       0x10d2d101a qt_safe_poll(pollfd*, unsigned int, timespec const*) + 90
3   QtCore                        	       0x10d2d2a21 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 849
4   QtCore                        	       0x10d26aacf QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
5   QtCore                        	       0x10d097603 QThread::exec() + 131
6   QtCore                        	       0x10d098619 0x10d076000 + 140825
7   libsystem_pthread.dylib       	    0x7ff80c690253 _pthread_start + 99
8   libsystem_pthread.dylib       	    0x7ff80c68bbef thread_start + 15


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000000  rcx: 0x0000000000000000  rdx: 0x0000000000000000
  rdi: 0x00007ff84f5cea00  rsi: 0x0000000200886200  rbp: 0xffffffffffffffff  rsp: 0x00000003049174b0
   r8: 0x0000000304917628   r9: 0xffffffffffffffff  r10: 0x0000000000000000  r11: 0x00007ff80c64abc9
  r12: 0x00007ff84f5cea00  r13: 0x0000003000000008  r14: 0x0000000000000103  r15: 0x0000000000000016
  rip: <unavailable>       rfl: 0x0000000000000287
 tmp0: 0xffffffffffffffff tmp1: 0x00007ff89cb5ea58 tmp2: 0x00007ff80c655c48


Binary Images:
       0x2007f1000 -        0x20087cfff dyld (*) <f2913392-361a-304f-b30d-486be5639e2d> /usr/lib/dyld
    0x7ff7fffb8000 -     0x7ff7fffe7fff runtime (*) <11b18945-107e-3e0d-91fa-b5d5ada3c0c4> /usr/libexec/rosetta/runtime
       0x10909b000 -        0x109102fff libRosettaRuntime (*) <4cb71c5f-4e41-3ce6-a65a-b283bc4bfab5> /Library/Apple/*/libRosettaRuntime
       0x100000000 -        0x100673fff com.PBE.QOwnNotes (25.2.1) <290fbcd1-eebd-3f73-b720-04baef5edc54> /Applications/QOwnNotes.app/Contents/MacOS/QOwnNotes
       0x1096aa000 -        0x1096defff org.qt-project.QtSvg (5.15) <11f2f083-b281-39fc-9b0a-081f047a6c85> /Applications/QOwnNotes.app/Contents/Frameworks/QtSvg.framework/Versions/5/QtSvg
       0x109770000 -        0x10979bfff org.qt-project.QtPrintSupport (5.15) <be399b08-503c-39e3-acac-268a9d866624> /Applications/QOwnNotes.app/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport
       0x109dc0000 -        0x10a206fff org.qt-project.QtWidgets (5.15) <b432d666-dcab-320a-8496-78a67f554c0e> /Applications/QOwnNotes.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
       0x10b174000 -        0x10b65dfff org.qt-project.QtGui (5.15) <cbcec35a-ee54-354f-9c2b-188ac6b2790d> /Applications/QOwnNotes.app/Contents/Frameworks/QtGui.framework/Versions/5/QtGui
       0x109813000 -        0x109834fff org.qt-project.QtSql (5.15) <c1b050dd-83c0-33f7-983b-b6d2cf6ef178> /Applications/QOwnNotes.app/Contents/Frameworks/QtSql.framework/Versions/5/QtSql
       0x10c03c000 -        0x10c394fff org.qt-project.QtQml (5.15) <8d7b72bf-f1f8-35c9-88ac-c4b1bcac7127> /Applications/QOwnNotes.app/Contents/Frameworks/QtQml.framework/Versions/5/QtQml
       0x109899000 -        0x1098b4fff org.qt-project.QtWebSockets (5.15) <ab8b8687-10f7-392d-81fb-0c38aff81a5f> /Applications/QOwnNotes.app/Contents/Frameworks/QtWebSockets.framework/Versions/5/QtWebSockets
       0x10ab79000 -        0x10ac89fff org.qt-project.QtNetwork (5.15) <c09a61c8-678f-339b-ad2e-b2a4a9b16bab> /Applications/QOwnNotes.app/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork
       0x109902000 -        0x109936fff org.qt-project.QtXml (5.15) <4264985f-0dcb-3e0c-9a9a-6af5de67e86c> /Applications/QOwnNotes.app/Contents/Frameworks/QtXml.framework/Versions/5/QtXml
       0x109637000 -        0x10963bfff org.qt-project.QtConcurrent (5.15) <a34ac906-5474-33bb-aec2-138e4edde70e> /Applications/QOwnNotes.app/Contents/Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent
       0x10d076000 -        0x10d5e6fff org.qt-project.QtCore (5.15) <c723812a-f7a5-3001-98d5-e60e8daa6ffb> /Applications/QOwnNotes.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
       0x10ca40000 -        0x10cbaefff libqcocoa.dylib (*) <d4ab240b-4535-3aec-b72b-5ffc4750e4e5> /Applications/QOwnNotes.app/Contents/PlugIns/platforms/libqcocoa.dylib
       0x109c1c000 -        0x109c7bfff org.qt-project.QtDBus (5.15) <f6c498cb-9925-350d-b597-6c3f102e09d5> /Applications/QOwnNotes.app/Contents/Frameworks/QtDBus.framework/Versions/5/QtDBus
       0x10cee5000 -        0x10cf0afff libqmacstyle.dylib (*) <5b9adb30-04ac-325f-bb42-6e40df6d7e6a> /Applications/QOwnNotes.app/Contents/PlugIns/styles/libqmacstyle.dylib
       0x109d89000 -        0x109d90fff libqgenericbearer.dylib (*) <8f60002d-17c7-31a6-81cf-51db475dff5c> /Applications/QOwnNotes.app/Contents/PlugIns/bearer/libqgenericbearer.dylib
       0x11a793000 -        0x11a909fff libqsqlite.dylib (*) <81097bb9-6c61-3a3c-8fef-daf952d1e351> /Applications/QOwnNotes.app/Contents/PlugIns/sqldrivers/libqsqlite.dylib
       0x10cec0000 -        0x10cec7fff libqgif.dylib (*) <bd1de7f5-eacb-304c-b93c-79a6f06a9ec6> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqgif.dylib
       0x10cf6c000 -        0x10cf73fff libqicns.dylib (*) <87d3521f-7d97-3b63-b928-0c60e87dca21> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqicns.dylib
       0x10cf88000 -        0x10cf8dfff libqico.dylib (*) <6a858a22-8e2e-3f6d-b9ac-438c4749c8b7> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqico.dylib
       0x11a60e000 -        0x11a672fff libqjpeg.dylib (*) <18b65be7-2104-3d96-9a0c-95dc8839ae72> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqjpeg.dylib
       0x10cfa0000 -        0x10cfa6fff libqmacheif.dylib (*) <f878d1f1-c295-3e94-b5ea-d53a00776427> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqmacheif.dylib
       0x10cfb8000 -        0x10cfbdfff libqmacjp2.dylib (*) <6ebf7c32-c2dc-32ab-bd6f-e79f35b8095f> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqmacjp2.dylib
       0x10cfcf000 -        0x10cfd4fff libqsvg.dylib (*) <9d916600-e6be-32be-97c7-6659a6b8af46> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqsvg.dylib
       0x10cfe5000 -        0x10cfe9fff libqtga.dylib (*) <d8f0bcf5-90d7-3025-8af5-f959dbb2d68b> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqtga.dylib
       0x11ab95000 -        0x11abfbfff libqtiff.dylib (*) <4a7c57bc-ce03-315d-a828-80b3502f75cc> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqtiff.dylib
       0x10cff9000 -        0x10cffdfff libqwbmp.dylib (*) <75d3fbd1-5eea-3c2e-b14e-822a265afa67> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqwbmp.dylib
       0x11ac7c000 -        0x11ad12fff libqwebp.dylib (*) <e5bd754e-c8cf-3788-b2d6-347527b2aade> /Applications/QOwnNotes.app/Contents/PlugIns/imageformats/libqwebp.dylib
       0x10d019000 -        0x10d020fff libqsvgicon.dylib (*) <e01eac79-3264-37d8-a886-dd3c862a0ef9> /Applications/QOwnNotes.app/Contents/PlugIns/iconengines/libqsvgicon.dylib
       0x12cb09000 -        0x12cb15fff libobjc-trampolines.dylib (*) <6db6943b-4158-37b9-8727-c91bbcfbb2aa> /usr/lib/libobjc-trampolines.dylib
       0x12decf000 -        0x12e73afff com.apple.AGXMetalG16X (324.6) <f0bbe34c-1e0b-3f5b-a172-a924cb9f5d0b> /System/Library/Extensions/AGXMetalG16X.bundle/Contents/MacOS/AGXMetalG16X
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
    0x7ff80c64e000 -     0x7ff80c689fff libsystem_kernel.dylib (*) <c214d771-f6a3-30be-b657-b4e0cb81c9df> /usr/lib/system/libsystem_kernel.dylib
    0x7ff80c68a000 -     0x7ff80c695fff libsystem_pthread.dylib (*) <2b452c39-67e1-3f73-87ca-5e07d5f1e90d> /usr/lib/system/libsystem_pthread.dylib
    0x7ff80c530000 -     0x7ff80c5b8ff7 libsystem_c.dylib (*) <12e8dc9e-ee00-37e7-8830-dc84a6de23b1> /usr/lib/system/libsystem_c.dylib
    0x7ff80c636000 -     0x7ff80c64dfff libc++abi.dylib (*) <772cbc4b-017a-3016-815a-35bc9b8ad230> /usr/lib/libc++abi.dylib
    0x7ff80c2b8000 -     0x7ff80c2fafdb libobjc.A.dylib (*) <a68afe60-6ec2-319a-8cba-70df5d8853a0> /usr/lib/libobjc.A.dylib
    0x7ff810001000 -     0x7ff8114fbff7 com.apple.AppKit (6.9) <e3f76bb8-4950-3c7a-8aa7-8516a93aeeb9> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    0x7ff80c6fb000 -     0x7ff80cb97ff2 com.apple.CoreFoundation (6.9) <8b4f51ea-b62c-3344-9fce-36ae59d6d2d1> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 1
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 1

Script name

ai-command.qml

@pbek
Copy link
Member

pbek commented Feb 6, 2025

Nice find! Thank you!

@pbek
Copy link
Member

pbek commented Feb 6, 2025

I wasn't able to reproduce your exact issue, but I have a crash when I do create random text with 200 character. Have to look into that!

pbek added a commit to pbek/QOwnNotes that referenced this issue Feb 6, 2025
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
@pbek
Copy link
Member

pbek commented Feb 6, 2025

25.2.2

  • An issue with the script.textDiffDialog() scripting command was fixed, where a null string
    could crash the application (for #257)

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

pbek added a commit to pbek/QOwnNotes that referenced this issue Feb 6, 2025
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
@maxammann
Copy link
Author

ty that works!

I really like the app btw! Not yet integrated into my workflow, but I'm close :)

@pbek
Copy link
Member

pbek commented Feb 7, 2025

Great, thank you for testing! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants