Bug 466571 - Kate crashes on MacOS when using the "Save Copy As..." menu option
Summary: Kate crashes on MacOS when using the "Save Copy As..." menu option
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 22.12.2
Platform: macOS (DMG) macOS
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-28 00:03 UTC by Kristen
Modified: 2023-03-03 06:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Full-length crash report, generated by macOS (34.32 KB, text/plain)
2023-02-28 00:03 UTC, Kristen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kristen 2023-02-28 00:03:38 UTC
Created attachment 156813 [details]
Full-length crash report, generated by macOS

SUMMARY
***
When using "Save Copy As..." under the "File" menu, Kate first prompts for a location to save the copy, then crashes once a location to save to has been provided. (On MacOS)
***


STEPS TO REPRODUCE
1. Create or open a file with some code in Kate
2. Click "Save Copy As..." under the "File" menu
3. Enter a location to save the file and click "Save"

OBSERVED RESULT

Kate crashes

EXPECTED RESULT

A copy of the file being created in the specified location.

SOFTWARE/OS VERSIONS

macOS: MacOS Monterey 12.2.1
The "Components" tab under "About Kate" says:
* KDE Frameworks Version 5.103.0
* Qt Version 5.15.8 (built against 5.15.8)
* The cocoa windowing system
Kate installed from a .dmg file of the most recent stable build

ADDITIONAL INFORMATION

This crash appears to be specific to the "Save Copy As..." option - taking the same steps with the "Save As..." option does not cause a crash.

The crash report generated by macOS included the following (full length crash report included as an attachment):
Crashed Thread:        8  KIO::WorkerThread

Exception Type:        EXC_BAD_ACCESS (SIGBUS)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x000000030a196ff8
Exception Codes:       0x0000000000000002, 0x000000030a196ff8
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 10 Bus error: 10
Terminating Process:   exc handler [38847]

VM Region Info: 0x30a196ff8 is in 0x30a196000-0x30a197000;  bytes after start: 4088  bytes before end: 7
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      Stack                       30a111000-30a196000    [  532K] rw-/rwx SM=PRV  thread 5
--->  Stack Guard                 30a196000-30a197000    [    4K] ---/rwx SM=NUL  
      Stack                       30a197000-30a219000    [  520K] rw-/rwx SM=PRV
Comment 1 Bug Janitor Service 2023-03-01 15:53:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/490
Comment 2 Christoph Cullmann 2023-03-02 21:02:04 UTC
Git commit 7f2dd9de8e2a70496de8275a4c16067942926620 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 02/03/2023 at 20:42.
Pushed by cullmann into branch 'master'.

documentSaveCopyAs: Use async job api

exec can have unintended and hard to understand side effects, and in this
case we can just the async api easily as there is no need for blocking

M  +17   -16   src/document/katedocument.cpp
M  +1    -1    src/document/katedocument.h

https://invent.kde.org/frameworks/ktexteditor/commit/7f2dd9de8e2a70496de8275a4c16067942926620
Comment 3 Waqar Ahmed 2023-03-03 06:42:37 UTC
Git commit cbec4b03ebd467a98f1dff44ad1ce0ee11088950 by Waqar Ahmed.
Committed on 03/03/2023 at 06:42.
Pushed by waqar into branch 'kf5'.

documentSaveCopyAs: Use async job api

exec can have unintended and hard to understand side effects, and in this
case we can just the async api easily as there is no need for blocking

M  +17   -16   src/document/katedocument.cpp
M  +1    -1    src/document/katedocument.h

https://invent.kde.org/frameworks/ktexteditor/commit/cbec4b03ebd467a98f1dff44ad1ce0ee11088950