Sublime Forum

Build 3200 Crashing on MacOS (Assertion failure in NSCGLSurface flushRect)

#1

I updated Sublime Text 3 to version 3200 today and it worked briefly before crashing. When I try to open the app again, it crashes immediately (no window is drawn).

I tried removing the Cache and Application Support folders but had no luck. When I try to launch the app from Terminal, I get the following error:

> x:~$ /Applications/Sublime\ Text.app/Contents/MacOS/Sublime\ Text
> 2019-03-26 11:46:27.572 Sublime Text[1622:52277] *** Assertion failure in -[NSCGLSurface flushRect:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.40.119/OpenGL.subproj/NSCGLSurface.m:569
2 Likes

Sublime 3.2 wont open after update running Moave
#2

More info:
This appears to only happen when I have my external DisplayLink displays connected. I was able to open the application without it crashing when the laptop was disconnected.

0 Likes

#3

you’ve tried with different values of this setting in your ST user preferences?

// Mac only. Valid values are true, false, and "auto". Auto will enable
// the setting when running on a screen 2560 pixels or wider (i.e., a
// Retina display). When this setting is enabled, OpenGL is used to
// accelerate drawing. Sublime Text must be restarted for changes to take
// effect.
"gpu_window_buffer": "auto",
1 Like

Assertion failure
#4

This is happening for me also

0 Likes

#5

Hmm, I wonder if the OpenGL driver for the DisplayLink has an issue.

As @kingkeith noted, we only use OpenGL if at least one of the displays is above a certain resolution and gpu_window_buffer is "auto" or true.

3 Likes

#6

Confirmed, setting “gpu_window_buffer” to “false” fixed the issue. Thank you @kingkeith and @wbond

1 Like

#7

I can confirm I had the same issue with a display link dock with a couple 2560x1440 displays. Disabling the gpu_window_buffer resolved it. Any thoughts on a fix so we can use the gpu again? Let me know if you need any further info.

0 Likes

#8

Thanks for the help all. Adding "gpu_window_buffer": "false" to my user preferences is an effective workaround.

0 Likes

#9

Of note - I’ve ordered a DisplayLink adapter to use to try and debug this. It’ll be a couple of days until it arrives, and after that I’ll have to see if it is a bug in our end or in the driver.

0 Likes

#10

Thanks @wbond It certainly wouldn’t surprise me if it was the driver. I’ve had all manner of problems with the dock. It’s behaving relatively well now but for a long time after I upgraded to Mojave it didn’t work at all.

0 Likes

#11

2019-03-29 14:49:32.278 Sublime Text[26359:5137433] *** Assertion failure in -[NSCGLSurface flushRect:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.40.119/OpenGL.subproj/NSCGLSurface.m:569

Adding a user preference file and adding that option didn’t do the trick for me.
However, Sublime does open if I disconnect the external monitors (even without the pref file, obviously).
In case I did something wrong:

  • added Preferences.sublime-settings into /Users/csc017/Library/Application Support/Sublime Text 3/Packages/User
  • wrote "gpu_window_buffer": false into it. Also tried "gpu_window_buffer": "false".
  • application still doesn’t launch :frowning:
0 Likes

#12

Well, we definitely don’t utilize NSCGLSurface if gpu_window_buffer is false.

The contents of your preferences file should look like the following, assuming no other settings:

{
    "gpu_window_buffer": false,
}

The file path in your case would be:

/Users/csc017/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings

From your comment, it sounds like you’ve done this, I just wanted to make sure the Preferences JSON formatting was correct.

1 Like

Using Sublime Text/Merge often crashes my MacBook while using an EGPU
#13

Hmm, apparently, I had missed a weird invisible character next to the first ‘{’, which rendered the Json invalid.

Sublime does start now. Thank you for your support.

0 Likes

#14

Build 3204 now automatically detects if a DisplayLink adapter is plugged in and will disable using the GPU window buffer, without the user having to change any settings.

2 Likes

#15

As described in this thread, it seems that a similar issue exists when using Sublime Text in combination with an eGPU.
Setting the gpu_window_buffer option manually to false solved the problem for now. :wink:

1 Like

#16

Even with that preference manually set, I can’t seem to do much without Sublime crashing on me.

0 Likes

#17

I also have a similar issue with a Blackmagic eGPU, Sublime Text build 3207, and Mojave 10.14.4. When a Sublime Text window is on a display being run through the eGPU, just clicking on a tab would crash Sublime Text. Windows on the MacBook Pro display (integrated GPU) work fine.

Setting gpu_window_buffer to false seems to stop the crashing.

0 Likes

#18

I am running Sublime version 3.2.1 build 3207 on Mojave 10.14.4 - and it just started crashing on me today. Pretty disruptive. I could try monkeying with the settings if it keeps recurring but do we expect a fix to be forthcoming?

0 Likes

#19

Well, Apple is in control of when 10.14.5 comes out. Until then you can change the setting, or wait for our next dev build which will automatically set the setting to disable all usage of NSOpenGLView for 10.14.4.

1 Like

#20

Ah great, thanks - I was thinking it was more of a Sublime issue but I see your point. At least it forced me to rethink my open project files and reorganized them a bit so I don’t get lost :wink:

1 Like