MarkEdit icon indicating copy to clipboard operation
MarkEdit copied to clipboard

[Bug] App Freezes From Time to Time

Open April-June-August opened this issue 4 months ago • 47 comments

This app sometimes just freezes and refuse to respond when I have unsaved changes. I had to force-quit the app, losing all my progress.

I didn’t find a consistent way to reproduce but as I remember they don’t happen while I was typing. Probably when the app is not frontmost.

I’m using MarkEdit 1.26.0 (76), MarkEdit-preview 1.1.0, on macOS 15.6 (24G84).

I would be happy to assist if there’s a way I can provide logs or other useful info to pinpoint this issue.

April-June-August avatar Aug 05 '25 11:08 April-June-August

Thanks for reporting.

The first thing you can try is restarting the system.

If the app hangs again, right-click on the dock icon to force quite. A dialog box will appear, displaying the stack trace, which can be helpful for troubleshooting.

Have you changed any app settings? I use the app frequently and haven’t noticed any hangs recently. I’m curious to know if app settings could be a factor in this issue.

Thanks!

cyanzhong avatar Aug 05 '25 11:08 cyanzhong

@April-June-August While I prefer to understand and fix this issue first, you could try this option if we really cannot identify the root cause: https://github.com/MarkEdit-app/MarkEdit/wiki/Customization#editorautosavewhenidle

This saves the file automatically to prevent data loss.

cyanzhong avatar Aug 05 '25 11:08 cyanzhong

I encountered with once freeze when running the app with Xcode. I killed the app and IDE showed it stopped at MarkEdit/MarkEditMac/Sources/Editor/Models/EditorDocument.swift:125 (saveContent).

hysonger avatar Aug 23 '25 15:08 hysonger

@hysonger Thanks. It seems there isn’t much we can do if it just hangs at super.save(sender).

Can you consistently reproduce this and share more details from the call stack?

cyanzhong avatar Aug 24 '25 00:08 cyanzhong

Encountered with another once system crash report https://gist.github.com/hysonger/388192fb4f202dc14f023f26589bd95c

hysonger avatar Sep 01 '25 12:09 hysonger

Thanks. Do you recall whether you saved (or closed) the document manually? Also, could you tell me the size of the file you were editing?

cyanzhong avatar Sep 01 '25 13:09 cyanzhong

Thanks. Do you recall whether you saved (or closed) the document manually? Also, could you tell me the size of the file you were editing?

I typed some paragraphs in a new window for a while, and when I pressed command + s and tried to save the content to the disk, it hanged.

By the way I mounted some samba directories in my local network, that might be a suspicious point. I also set up Open In Terminal (tool for fast opening terminal in current folder)

hysonger avatar Sep 02 '25 14:09 hysonger

I've made some changes in v1.26.1.

Since I haven't been able to reproduce the issue in-house, I'm not fully confident in the fix.

Please give it a try and let me know whether it resolves the problem or makes things worse.

Thank you!

cyanzhong avatar Sep 07 '25 06:09 cyanzhong

Just +1-ing in here to say I also have this issue from time to time. I often swap in out of MarkEdit while writing, building and referencing other materials, and I'd say about 5% of the time I get this exact hang at the point of saving, after cmd-S is typed but before anything is written to disk. I habitually save every sentence or so so I never lose much on the rare occasion it happens. (Though on one occasion I used Preview to extract text from a screenshot of the hanging window to recover some edits 😅)

I'll try and include any traces I find next time.

caiw avatar Sep 10 '25 19:09 caiw

@caiw Please share stacktrace when you reproduce this issue with the latest build, thanks.

cyanzhong avatar Sep 10 '25 23:09 cyanzhong

Same here since I think version 1.26 - I currently have 1.26.1 with MacOS Sequoia. I type a few things, maybe I can save once or twice. But the app hangs with a spinny ball and I loose my latest edits because I have to force quit.

adegans avatar Sep 13 '25 06:09 adegans

@adegans I am a bit confused, do you mean you reproduced this with 1.26 or 1.26.1?

cyanzhong avatar Sep 13 '25 06:09 cyanzhong

@adegans I am a bit confused, do you mean you reproduced this with 1.26 or 1.26.1?

It happened a few times today on 1.26.1. I think once on 1.26, but apps sometimes crash... So I didn't pay attention to that really.

I didn't have crashes on macOS Sonoma, which I used until 5 days ago. Maybe the issue is with (or related to) Sequoia.

adegans avatar Sep 13 '25 06:09 adegans

@adegans I am a bit confused, do you mean you reproduced this with 1.26 or 1.26.1?

It happened a few times today on 1.26.1. I think once on 1.26, but apps sometimes crash... So I didn't pay attention to that really.

I didn't have crashes on macOS Sonoma, which I used until 5 days ago. Maybe the issue is with (or related to) Sequoia.

Trying to understand which path is used in your save workflow. When you close a document with unsaved changes ("Edited"), do you see an alert?

Also, please share a crash log with v1.26.1, thank you!

cyanzhong avatar Sep 13 '25 06:09 cyanzhong

I just hit cmd S and the app crashes. The spinny ball appears and I have to force quit the app.

There is no 'crash' popup to pull a log from, I see nothing in console either. But if it's somewhere, please let me know and I'll see if I can find it.

adegans avatar Sep 13 '25 06:09 adegans

Hi @adegans, since you can reproduce this quite often, can you please try this debug build and let me know if the issue persists? MarkEdit.zip

You may need to bypass the gatekeeper as the app is not signed.

Thanks!

cyanzhong avatar Sep 13 '25 07:09 cyanzhong

I've just tried the attached zip. And typed random crap in a 20000 word document for 10 minutes. Alt-tabbed out and back in. Saved my edits every few seconds.

No crashes.

Not sure if that's just lucky, but yesterday it crashed every 2 minutes or so. And now not 👍

adegans avatar Sep 13 '25 17:09 adegans

Thank you for testing. Will tag a release along with a few other fixes.

cyanzhong avatar Sep 14 '25 01:09 cyanzhong

I’ve been getting freezes in 1.26.1, and have reverted to 1.26.0 for now. It happened many times a day with 1.26.1. I don’t know specific steps to reproduce the issue.

If I can be any help tracking this down, please let me know!

marcedwards avatar Sep 14 '25 07:09 marcedwards

Yes @marcedwards you can really help. Just check out v1.26.2 😂 and let me know if you still have the repro.

If so, please share a stacktrace.

cyanzhong avatar Sep 14 '25 07:09 cyanzhong

Yes @marcedwards you can really help. Just check out v1.26.2 😂 and let me know if you still have the repro.

Thank you! Just installed it. I’ll let you know how it goes.

marcedwards avatar Sep 14 '25 07:09 marcedwards

1.26.2 has been flawless so far.

marcedwards avatar Sep 15 '25 00:09 marcedwards

Yep, so far so good.

adegans avatar Sep 15 '25 05:09 adegans

1.26.2 froze today, and I think I may have some additional info on reproducing it:

  1. MarkEdit was left open with unsaved documents.
  2. Mac was put to sleep.
  3. After waking the Mac up, I tried to close one of the unsaved MarkEdit documents. That triggered the beachball.
  4. The only step I could take from here was to force quit.

When MarkEdit was reopened, it looks like the documents tried to restore, but all were empty. I didn’t lose any important data, because the unsaved documents were unimportant.

I will try to intentionally reproduce the issue again. Thanks!

marcedwards avatar Sep 25 '25 00:09 marcedwards

Thanks @marcedwards, you tried closing instead of saving, right?

cyanzhong avatar Sep 25 '25 03:09 cyanzhong

Modern macOS auto-saves on close, right? So the issue is still with saving the document (probably). Hence the overlap...

I haven't had any crashes since the .2 update, but also didn't use the app much.

adegans avatar Sep 25 '25 03:09 adegans

It depends on the user settings, macOS document apps can ask for save explicitly, there is a system setting for that.

However I believe this is still a save problem, I recently have been able to reproduce it with another app.

cyanzhong avatar Sep 25 '25 03:09 cyanzhong

Thanks @marcedwards, you tried closing instead of saving, right?

Yes, I think it’s when I try to close via ⌘W, which would normally trigger the “do you want to save?” alert. I’ll try to pay attention to when it happens. It does seem a lot rarer than it was with 1.26.1.

marcedwards avatar Sep 30 '25 11:09 marcedwards

FWIW, I also get regular MarkEdit hangs (hence lost data), as recently as this morning on 1.26.2. I haven't found a way to reliably reproduce, but for me it seems to occur when I haven't saved an edited document in a while (hour+), and then I hit ⌘s. Then it spins forever on save. I just updated to 1.27 so we'll see how that goes.

[Edit]: I believe all my hangs have occurred on notes containing code blocks. Not sure if that's relevant or just coincident.

[Edit 2]: I just got the hang on Version 1.27.0 (79). Somewhat supporting my earlier note, I've been editing and saving this particular file dozens of times without any problem. I recently added in a ts code block and then tried to Save and got the rainbow spinning wheel of death. Hopefully this helps with debug.

apg-dev avatar Oct 04 '25 15:10 apg-dev

Hi @apg-dev thanks for the info.

When you close a doc without saving, do you see a dialog? This determines which path is used.

Also, did you upgrade to macOS Tahoe recently?

cyanzhong avatar Oct 04 '25 22:10 cyanzhong