Sublime Text on Ubuntu 14.04 - Keeps attempting to

2020-05-16 21:37发布

问题:

Sublime & from Terminal, opens a Sublime Text window, but keep getting this message:

(sublime: 6476): GLib-CRITICAL **; Source ID 1982 was not found when attempting to remove it. 

The Source ID keeps changing. Using Ubuntu 14.04.

Any ideas what could be going on? Thanks!

回答1:

This page in Ubuntu's bug tracker describes this particular situation. Apparently this is a known bug with 14.04, possibly because of a regression with GLib, or a mismatch between GLib and GTK (so says one of the commenters).

Nothing is trying to remove Sublime, it's just an error in a programming library. If nothing is crashing on you, or becoming unusable, just ignore it...

EDIT This issue has been fixed in 14.10 and onwards. You can upgrade your distribution, or simply upgrade glib and the error should go away. Upgrading to Sublime Text 3 (which is highly recommended anyway) will also fix the problem.



回答2:

This ended up being way too annoying to ignore so I have a pretty sloppy solution. Here is a function which runs sublime inside nohup. At first I tried just creating an alias for running sublime with nohup, but it would produce a log file .output and leave it in whatever directory I'm working in. To get around this the function sblmruns sublime in nohup which hides the errors from the terminal, and then it sends the output log to /dev/null

Now that I have a function sblm I simply use the alias sublime to override the normal sublime function.

Paste all of this into your .bash_aliases file.

#Function to deal with the annoying sublime errors
#Send annoying .output logs to /dev/null
function sblm
{
    nohup sublime $1 >/dev/null 2>&1 &
} 

#Call my sublime function
alias sublime="sblm"


回答3:

I upgraded to sublime 3 and I stopped receiving those messages. Hope it works for you too.

[EDIT] You can follow this quick tutorial to upgrade to sublime text 3: Tutorial from WebUpd8



回答4:

It looks like there is a double-free bug in ConsoleKit.

This has been showing up in a lot of Gnome programs lately, but ConsoleKit users are particularly affected since (in my experience) the warning happens on every keypress. The source of the message is Glib's g_source_remove(), but what it means is that the caller is trying to use g_source_remove() improperly. g_source_remove() is a resource-freeing function much like libc's free(), so the most likely cause is calling it twice on the same object.

From https://bugzilla.gnome.org/show_bug.cgi?id=721369#c7:

GLib recently started throwing a warning when g_source_remove() is passed garbage (as per warning). Your applications have probably been broken for a while, and there's no telling what could actually have happened in the past when g_source_remove() would happily close any random source because the programmer got the wrong argument to g_source_remove().