MacDownApp / macdown

Open source Markdown editor for macOS.
https://macdown.uranusjr.com/
9.43k stars 1.09k forks source link

Crash when scrolling on initial Markdown preview render (MacOS Sierra) #716

Open 16patsle opened 7 years ago

16patsle commented 7 years ago

I noticed today that when I opened a rather large Markdown file in Macdown, and tried to scroll down immediately, before the preview finished rendering, the application would crash. This happened a couple of times, also with some smaller files. I successfully managed to replicate it just before writing this report (to get the crash log). It seems to be an issue with the main view trying to scroll the preview view before it has any content. Here is an image of the crash log: image

Here is the full log: http://pastebin.com/EenjhawV

brunophilipe commented 7 years ago

@16patsle Do you think you can provide an example file? I tried with a random large markdown file I found online but that did not trigger any crash :/

16patsle commented 7 years ago

@brunophilipe I'll try to find the file I originally had problems with and link to it.

16patsle commented 7 years ago

I kind of forgot about this issue until today, but it happened again, this time on a file with around a thousand words. I am beginning to think it might have something to do with files including raw html, as that was the case this time, and I think that was the case last time too. Should I send over the file that seemingly caused the problem this time?

Also, this time the crash happened while saving (so unfortunately a paragraph of my blog post got lost) unlike the last time, when it happened during opening. I just had a random thought too. Is it a possibility it could be because of low ram available? At least I am notoriuosly known to eat up any that's available with my browser tabs, so it's mostly fairly full on my mac.

FranklinYu commented 7 years ago

Should I send over the file that seemingly caused the problem this time?

Yes, please. Any file that ever crashed MacDown may help.

Is it a possibility it could be because of low ram available?

I think it's possible. It may help to watch MacDown in Xcode when simulating such situation, but I'm not sure how. Maybe with a lot of browser tabs; maybe with a memory-eating mini program.

uranusjr commented 7 years ago

Also, MacDown now uses a forked version of Hoedown (many reasons), so you can try reproducing it with Hoedown directly. This would help pinpoint the problem.

16patsle commented 7 years ago

@franklinyu This should be the file the crash happened with last time: Hvordan virker nettsider? Del 3- Dynamiske sider (med PHP).md

@uranusjr If I have got some time this week, I'll try to reproduce it. Will keep you updated on eventual progress.

16patsle commented 7 years ago

@franklinyu Tried to simulate a low-memory low-cpu situation, but no crash yet. I will hopefully try directly with Hoedown next time.