Sublime Text on Ubuntu 14.04 - Keeps attempting to remove it
Asked Answered
C

4

41

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!

Colza answered 19/4, 2014 at 3:23 Comment(1)
My terminal is also throwing this error. Nothing is crashing or breaking (as far as I can tell), so it's more of a nuisance than anything. Please post here if you find a fix.Orthodontia
H
18

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.

Holmann answered 19/4, 2014 at 5:10 Comment(3)
Did search using the error code.. did not find the Ubuntu bug tracker page. Appreciate you taking the time. Thank you.Colza
Sorry for the late reply to this comment, but do you know whether this is going to fill up any log files? I just want to make sure that ignoring it won't cause some log file to grow to some ridiculous size over time.Revengeful
@Revengeful sorry, just saw your comment. This message is going to your standard error output, so unless your system is set up to log every single error message that any program puts out (and I don't believe a vanilla install of Ubuntu would do that), I wouldn't worry about anything. At any rate, most log files are compressed and rotated after a period of time, and depending on the setup the old files are likely to get deleted, so you should be OK. If you're like me, random downloads will fill up your disk faster than error messages :)Holmann
O
11

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"
Orthodontia answered 3/6, 2014 at 17:54 Comment(2)
You could also write alias sblm='sublime_text . &>/dev/null'.Eph
That was useful! :D But the problem now comes when you need to open multiple files using the command line. If you write sublime *.cpp& it just opens up the first .cpp file. How can you edit your function in order to accept arguments (file paths) afterwards?Loram
S
10

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

Soudan answered 4/8, 2014 at 19:43 Comment(3)
Do you have any idea what it was that actually caused the error?Transpacific
Not sure but like Jander mentioned it's most likely the improper use of the g_source_remove() function.Soudan
Did the same as Yeysides, solved the problem. I'm editing his answer to add a link to a tutorial on how to upgrade to Sublime 3.Eleanore
E
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().

Epiphragm answered 8/7, 2014 at 18:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.