Returning from External Editor results in blank screen

When I click on the external editor button (or use shortcut keys) my editor opens fine, but when I try to return to Joplin I just see a white screen. There’s seems no way of getting Joplin to display anything so I end up Force Quitting and then reopening it. The note will have been updated fine from the changes I made in the external editor, but it is no good if it ends up with a blank screen for Joplin each time.

I’ve tried using three different external editors but it is the same problem for all three. I have also tried using the system default and also setting up the path on Joplin’s options, but still the same problem.

Hope someone get help. My reason for needing an external editor is that when I am writing I like to have a full, uncluttered screen and Joplin does quite give me that total blank full screen look.

Does it do it every single time, or randomly? Is it always on the same note?

Also what OS are you using?

Maybe a bit more info that could help narrowing down the problem:

I could not reproduce this behavior consistently with git master on macOS. At least not every time. It seems to be a timing issue or a race condition. It can happen after clicking to unwatch the file. But mostly nothing happens, but when I then open general options, change a value, click Apply and then Cancel -> Boom - White Screen.
Only one out of 10 times I got a white screen right after clicking the unwatch button.

This is what I get in the console when the white screen happens:

[68121:0329/213333.842995:ERROR:gles2_cmd_decoder.cc(18047)] [.BrowserCompositor-0x7ff64c851a00]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[68121:0329/213333.843060:ERROR:gles2_cmd_decoder.cc(12520)] [.BrowserCompositor-0x7ff64c851a00]GL ERROR :GL_INVALID_VALUE : glScheduleCALayerCHROMIUM: unsupported texture format

I’m on a Mac running Mojave.

It happens every time. I think there may have been the odd time when it didn’t, but I think that was when I didn’t actually edit the file in the external editor. If I even add a full stop and then exit/save out of the other editor then I end up at a blank Joplin.

I tried with three different editors (Mweb, FocusWriter, and Focused) and get same result with each.

Hope that helps Laurent. TBH I’m only using the external editors for the full screen mode. Maybe at some point a full screen editor feature could be added to Joplin. It is already an amazing app, but for me that would make it my go to app not just for notes, but for all my writing.

It happens with all notes.

Steps to reproduce:

  • edit note in external editor
  • save note, close editor
  • click on Watching... (to stop external editing)

Forrce quit is the only way to fix the white screen of death.

(1.0.142 on macOS 10.14.4)

I think it might be an issue with either chokidar or fsevents, which don’t work properly with latest Electron. The problem is that when the bug happens it kills the debug window so it’s not possible to see any error message, and that makes me think it’s a lower level crash, somewhere in the native code.

Do any of you know how to get a stacktrace from the Joplin processes when the crash happens? I think it would help understand what is happening. Or maybe the macOS console would have some info?

The only thing I could think of right now is using Sample process, or maybe creating a spindump.

The issue is that you can't really create a stacktrace automatically when it happens, because it's no crash. It's just

fsevents seems to have issues with Node, so it’s possible the Node process is actually crashing, while the Chrome one stays open. That would explain why there’s a blank window that doesn’t do anything. So I guess if we could somehow listen to this Node process and, if it does crash, print a stracktrace we could get some info.

Just wanted to add to this that I’m experiencing the same issue, using Typora as my external editor on macOS. It’s pretty much the only problem I’m having with Joplin, so if there’s any way I can help solve it, I’d be delighted to. Thanks!

Unfortunately there's no information anywhere how to create coredumps on Mojave. (There's not even any useful info on the Apple dev forums - there hardly is.) All the information is for previous versions of macOS and don't work on Mojave. My /cores directory is empty after the process crashed. But there was a .crash file available, although I'm pretty sure you've seen that already. If not, here's the part that pertains to the crashing thread:

(scroll in the area below)

Process:               Electron Helper [46524]
Path:                  /Users/USER/*/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper
Identifier:            com.github.Electron.helper
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        Electron [46522]
Responsible:           Electron Helper [46524]
User ID:               501

Date/Time:             2019-04-11 20:22:07.263 -0400
OS Version:            Mac OS X 10.14.4 (18E226)
Report Version:        12
Bridge OS Version:     3.4 (16P4507)
Anonymous UUID:        REMOVED

Sleep/Wake UUID:       REMOVED

Time Awake Since Boot: 320000 seconds
Time Since Wake:       1100 seconds

System Integrity Protection: disabled

Crashed Thread:        0  CrRendererMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000000000003e8
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [46524]

VM Regions Near 0x3e8:
--> 
    __TEXT                 000000010d44e000-000000010d44f000 [    4K] r-x/rwx SM=COW  /Users/USER/*/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper

Thread 0 Crashed:: CrRendererMain  Dispatch queue: com.apple.main-thread
0   com.github.Electron.framework 	0x00000001121ea3a0 0x10d451000 + 81367968
1   fse.node                      	0x0000000118800f8b fse::FSEvents::~FSEvents() + 93 (fsevents.cc:65)
2   fse.node                      	0x000000011880101e fse::FSEvents::~FSEvents() + 14 (fsevents.cc:62)
3   com.github.Electron.framework 	0x000000010e831c11 0x10d451000 + 20843537
4   com.github.Electron.framework 	0x000000010e831fca 0x10d451000 + 20844490
5   com.github.Electron.framework 	0x000000010ec922a3 0x10d451000 + 25432739
6   com.github.Electron.framework 	0x000000010ec90341 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) + 1585
7   com.github.Electron.framework 	0x000000010ec992a1 0x10d451000 + 25461409
8   com.github.Electron.framework 	0x000000010e85929f 0x10d451000 + 21004959
9   com.github.Electron.framework 	0x000000010f2031ab 0x10d451000 + 31138219
10  com.github.Electron.framework 	0x000000010f264572 0x10d451000 + 31536498
11  com.github.Electron.framework 	0x000000010f2031ab 0x10d451000 + 31138219
12  com.github.Electron.framework 	0x000000010f21d5ff 0x10d451000 + 31245823
13  com.github.Electron.framework 	0x000000010f21dab8 0x10d451000 + 31247032
14  com.github.Electron.framework 	0x000000010f2c205a 0x10d451000 + 31920218
15  com.github.Electron.framework 	0x000000010f2c531a 0x10d451000 + 31933210
16  com.github.Electron.framework 	0x000000010f2c197f 0x10d451000 + 31918463
17  com.apple.CoreFoundation      	0x00007fff46c185e3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18  com.apple.CoreFoundation      	0x00007fff46c18589 __CFRunLoopDoSource0 + 108
19  com.apple.CoreFoundation      	0x00007fff46bfbf3b __CFRunLoopDoSources0 + 195
20  com.apple.CoreFoundation      	0x00007fff46bfb505 __CFRunLoopRun + 1189
21  com.apple.CoreFoundation      	0x00007fff46bfae0e CFRunLoopRunSpecific + 455
22  com.apple.Foundation          	0x00007fff48e51a9f -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280
23  com.github.Electron.framework 	0x000000010f2c255d 0x10d451000 + 31921501
24  com.github.Electron.framework 	0x000000010f2c149e 0x10d451000 + 31917214
25  com.github.Electron.framework 	0x000000010f23f465 0x10d451000 + 31384677
26  com.github.Electron.framework 	0x00000001121104f6 0x10d451000 + 80475382
27  com.github.Electron.framework 	0x000000010f0b5f29 0x10d451000 + 29773609
28  com.github.Electron.framework 	0x00000001104a9aad 0x10d451000 + 50694829
29  com.github.Electron.framework 	0x000000010f0b5154 0x10d451000 + 29770068
30  com.github.Electron.framework 	0x000000010d453f14 AtomMain + 84
31  com.github.Electron.helper    	0x000000010d44ef10 0x10d44e000 + 3856
32  libdyld.dylib                 	0x00007fff730743d5 start + 1

Also noticed that if I don’t quit Typora, just close the window, it works fine and Joplin reflects any changes I made. I can click the ‘Watching’ button again and it seems to return to normal. As soon as I then quit Typora, even if no note is open, then Jopling goes to the white screen.

Thanks for the crash dump @tessus, it would indeed confirm it’s something to do with fsevent as this is the last call before getting to the Electron framework. I’ll file a bug report with them if possible and see if it helps. Hopefully a future version of either Electron or fsevent will fix this.

Great, please let me know the link to the issue when you have created one. I might be able to help them by collecting a core dump. (That is, if they tell me how to do that on Mojave.)

While we’re at it, I think Electron and react-native should be updated. I believe I read that certain things were fixed that could help with a few problems that occured after the last migration of both components.

fsevent bug report: https://github.com/fsevents/fsevents/issues

Someone posted a related bug report on Chokidar: https://github.com/paulmillr/chokidar/issues/837

@Yorkshireman this will be fixed in the next release.

Hey there,

I am still new to Joplin (which I love so far) and have also just started to use Linux Mint after many years, so please forgive me my possible lack of knowledge.

I am experiencing a similar problem: after editing a note in an external editor (emacs in my case), saving the note and closing the external editor, when I come back to Joplin, its main window is unresponsive and after a while turns white. The window and the main menu are still responsive (the menus open, you get the visual feedback that you press for instance the "close window" button), but do nothing.
I do not even see any "Watching" element, neither while the external editor is still open nor after closing it.
I am using:

Joplin for Desktop
Joplin 1.2.6 (prod, linux)
Sync Version: 2
Profile Version: 34
Keychain Supported: No
Revision: f5f117c (master)

Here is the beginning of the output of inxi -Fxxxrz :

System:    Kernel: 5.4.0-48-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 
    Desktop: Xfce 4.14.2 tk: Gtk 3.24.13 info: xfce4-panel wm: xfwm4
    dm: LightDM 1.30.0 Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal

and there the end:

Info:      Processes: 198 Uptime: 25m Memory: 15.50 GiB used: 1.22 GiB (7.8%) 
    Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash v: 5.0.17 
    running in: xfce4-terminal inxi: 3.0.38 

I close Joplin with "killall joplin"

Has the bug been discovered, and solved? What can I do to solve it this time?

Thanks in advance!

If you open the console while it's happening, are there any errors? https://joplinapp.org/debugging

Thanks for answering, Laurent!

It took a while until I found the folder where to place the flags.txt file, as I could not find the menu point Open Profile Directory in the Help menu. (It has to go to ~/.config/joplin-desktop under (Ubuntu) Linux.)
The following happens:

  • I open the external editor with Ctrl+E. In the console:

    CommandService::execute: startExternalEditing 
    {noteId: "847107c49b094371b13d6e5d16efedb7", routeName: "Main"}
    noteId: "847107c49b094371b13d6e5d16efedb7"
    routeName: "Main"
    __proto__: Object
    
    
  • I edit the note and Save the changed version. No events in the console.

  • I close the external editor. No events in the console.

  • The main window is not responsive anymore.

  • I took a screenshot of Joplin, after that the console window changed to the Sources-Tab, to line 600, and on the main window appears the small element "paused in debugger".

  • The window does not turn white/blank this time.

  • I press the "resume"-butten on the small element, no effect on the console.

  • The window remains irresponsive, although the top menus open. The little element "paused in debugger" remains there. The cursor in the Sources-tab remains in line 600.

  • When I press the close-window button (top right corner of the window), nothing happens.

Please see the screenshots here: https://e.pcloud.link/publink/show?code=kZEVcZtIzbLaqPkYLtSbNqlAAfAHM32bMX

I hope that helps.

Thanks in advance!