After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 661323 - GNOME Shell crashes when using the Weather extension
GNOME Shell crashes when using the Weather extension
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.2.x
Other Linux
: Normal blocker
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 662805 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-10-09 15:56 UTC by ppr
Modified: 2012-08-28 01:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xsession-errors (50.83 KB, text/plain)
2011-10-09 18:07 UTC, ppr
Details
backtrace (14.32 KB, text/plain)
2011-10-27 16:56 UTC, Martin Weinelt
Details
backtrace with specified dbgsym packages installed (4.32 KB, text/plain)
2011-10-31 17:45 UTC, Martin Weinelt
Details
backtrace with libgjs0c-dbgsym (21.53 KB, text/plain)
2011-10-31 18:51 UTC, Martin Weinelt
Details
backtrace+gjs_dumpstack (21.95 KB, text/plain)
2011-11-04 01:07 UTC, Martin Weinelt
Details

Description ppr 2011-10-09 15:56:13 UTC
When I have lots of windows open in different wordspaces and I change several time (and quick changes) of workspace, gnome-shell bug and restart. The first time, restart works and my windows appears again but after the second time, I have a error message which say the session must be close and show me my gnome-shell extensions. 

I have only one extension for the weather and it works fine.

Sorry I don't know where I can find relevant log file.
Comment 1 Milan Bouchet-Valat 2011-10-09 15:59:58 UTC
Please attach your ~/.xsession-errors file from after the first crash.
Comment 2 ppr 2011-10-09 18:07:35 UTC
Created attachment 198662 [details]
xsession-errors

Here is my xsession-errors taked just after a first crash (so gnome-shell had restart properly).
Comment 3 ppr 2011-10-09 18:26:26 UTC
There is quodlibet (a music player) working during these crashs and I see some information about music on the xsession-errors, maybe there is a link ...
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-10-09 18:28:09 UTC
(In reply to comment #3)
> There is quodlibet (a music player) working during these crashs and I see some
> information about music on the xsession-errors, maybe there is a link ...

No.

> ERROR:gi/object.c:671:gjs_object_instance_constructor: assertion failed: (unthreadsafe_template_for_constructor.info == NULL || strcmp(g_base_info_get_name( (GIBaseInfo*) priv->info), g_base_info_get_name( (GIBaseInfo*) unthreadsafe_template_for_constructor.info)) == 0)

is the crash.
Comment 5 Jasper St. Pierre (not reading bugmail) 2011-10-10 11:13:31 UTC
Can you get a backtrace?
Comment 6 Milan Bouchet-Valat 2011-10-10 12:34:21 UTC
(See http://live.gnome.org/GettingTraces for that)
Comment 7 ppr 2011-10-11 18:39:22 UTC
Sorry but for now, I can't repeat this bug.

If it happens again I will post a backtrace.
Comment 8 Milan Bouchet-Valat 2011-10-11 19:13:53 UTC
OK.
Comment 9 Martin Weinelt 2011-10-27 16:56:28 UTC
Created attachment 200118 [details]
backtrace
Comment 10 Martin Weinelt 2011-10-27 16:57:26 UTC
I attached a backtrace I made just now. In case I missed some dbgsym packages I can try again. :)
Comment 11 Jasper St. Pierre (not reading bugmail) 2011-10-27 18:00:39 UTC
This is a crash in gjs/gobject-introspection. CCing walters.
Comment 12 Jasper St. Pierre (not reading bugmail) 2011-10-31 15:21:45 UTC
*** Bug 662805 has been marked as a duplicate of this bug. ***
Comment 13 Jasper St. Pierre (not reading bugmail) 2011-10-31 16:32:21 UTC
Anybody who is getting this crash, please install debug symbols for:

  gnome-shell
  gobject-introspection
  gjs

and attach a new backtrace. If you use Arch Linux, there are patches provided by ioni in http://pkgbuild.com/~ioni/debug/
Comment 14 Martin Weinelt 2011-10-31 17:45:07 UTC
Created attachment 200353 [details]
backtrace with specified dbgsym packages installed
Comment 15 Milan Bouchet-Valat 2011-10-31 18:26:17 UTC
Are you sure you have installed gjs debug symbols? The trace is still almost empty. And it could help to install libmozjs/xulrunner symbols too.
Comment 16 Martin Weinelt 2011-10-31 18:37:12 UTC
$ dpkg -l | grep gjs
ii  gjs                                           1.30.0-0ubuntu1                            Mozilla-based javascript bindings for the GNOME platform
ii  gjs-dbgsym                                    1.30.0-0ubuntu1                            debug symbols for package gjs
ii  libgjs0c                                      1.30.0-0ubuntu1                            Mozilla-based javascript bindings for the GNOME platform

will install the other dbgsyms too...will take me some time. However: gjs was not installed on the system at all before installing gjs-dbgsym.

I'm using ubuntu oneiric.
Comment 17 Martin Weinelt 2011-10-31 18:45:58 UTC
nvm, it was libgjs0c-dbgsym. sorry for the spam :X
Comment 18 Martin Weinelt 2011-10-31 18:51:45 UTC
Created attachment 200361 [details]
backtrace with libgjs0c-dbgsym
Comment 19 Jasper St. Pierre (not reading bugmail) 2011-10-31 18:56:07 UTC
When it happens, can you try:

 (gdb) f 4
 (gdb) p g_base_info_get_name(priv->info)
 (gdb) p g_base_info_get_name(unthreadsafe_template_for_constructor.info)

I think I have a basic idea of what's happening here...
Comment 20 Martin Weinelt 2011-11-01 02:09:13 UTC
> (gdb) f 4
  • #4 gjs_object_instance_constructor
    at gi/object.c line 668

> (gdb) p g_base_info_get_name(priv->info)
$1 = -584980272

> (gdb) p g_base_info_get_name(unthreadsafe_template_for_constructor.info)
$2 = -592703020
Comment 21 Damien Alexandre 2011-11-03 13:52:47 UTC
I also suffer from this bug. If you need any information.
Comment 22 Janvitus 2011-11-03 14:30:56 UTC
Same errors here.
Comment 23 Justin Wang 2011-11-03 17:53:56 UTC
same error here... using Gnome-shell from Oneiric
Comment 24 Jasper St. Pierre (not reading bugmail) 2011-11-03 19:15:59 UTC
OK, I'm confused. I was expecting a string value for the output of g_base_info_get_name. Did I gdb wrong? Try:

    (gdb) f 4
    (gdb) p (char*) g_base_info_get_name(priv->info)
    (gdb) p (char*) g_base_info_get_name(unthreadsafe_template_for_constructor.info)
Comment 25 Martin Weinelt 2011-11-03 21:04:41 UTC


  • #4 gjs_object_instance_constructor
    at gi/object.c line 668

$1 = 0xffffffffe1a2c8d0 <Address 0xffffffffe1a2c8d0 out of bounds>

$2 = 0xffffffffe1a1a1d4 <Address 0xffffffffe1a1a1d4 out of bounds>
Comment 26 Jasper St. Pierre (not reading bugmail) 2011-11-03 21:35:06 UTC
OK, something's stomping on memory here. Is everyone that is seeing this bug on Ubuntu?
Comment 27 Omri Har-Shemesh 2011-11-03 21:41:15 UTC
I think I have the same bug (or similar) and I'm also on Ubuntu.
Comment 28 Jasper St. Pierre (not reading bugmail) 2011-11-03 23:47:14 UTC
Does anyone have a way to get this crash reliably? If so, please give clear directions to see if it's repeatable on my machine here, as well as posting both a backtrace and gjs_dumpstack.
Comment 29 Martin Weinelt 2011-11-03 23:56:25 UTC
It often happens to me when I'm alt+tab changing windows, can't really say any more, because I cant determine a pattern here.
Comment 30 Omri Har-Shemesh 2011-11-03 23:58:52 UTC
To me it hadn't happened in a few days, but usually it happens when there are many programs open and I use the Top-Left activities button or maybe Alt-Tab as well. I will try to reproduce it more reliably and see if I can find some pattern.
Comment 31 Martin Weinelt 2011-11-04 01:07:24 UTC
Created attachment 200656 [details]
backtrace+gjs_dumpstack
Comment 32 Martin Weinelt 2011-11-04 01:10:41 UTC
Comment on attachment 200656 [details]
backtrace+gjs_dumpstack

ok,somehow the gjs_dumpstack is missing, I'll try and get a new one. Basically it was s.th. in AltTab.js.
Comment 33 Martin Weinelt 2011-11-04 02:26:42 UTC
ERROR:gi/object.c:671:gjs_object_instance_constructor: assertion failed: (unthreadsafe_template_for_constructor.info == NULL || strcmp(g_base_info_get_name( (GIBaseInfo*) priv->info), g_base_info_get_name( (GIBaseInfo*) unthreadsafe_template_for_constructor.info)) == 0)

Program received signal SIGABRT, Aborted.
0x00007ffff57173a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) call gjs_dumpstack()
== Stack trace for context 0x923140 ==
0 anonymous() ["/usr/share/gnome-shell/js/ui/altTab.js":54]
1 AltTabPopup() ["/usr/share/gnome-shell/js/ui/altTab.js":47]
2 anonymous("backwards" = false, "window" = null, "mask" = 8, "binding" = ""switch_windows"", "shellwm" = [object instance proxy GIName:Shell.WM jsobj@0x7fffd7a62480 native@0xa6d040]) ["/usr/share/gnome-shell/js/ui/windowManager.js":542]


(gdb) quit
A debugging session is active.

        Inferior 1 [process 2691] will be killed.

Quit anyway? (y or n) y
Comment 34 Jasper St. Pierre (not reading bugmail) 2011-11-05 03:02:31 UTC
I filed bug #663441, which has patches to remove the "unthreadsafe_constructor" stuff, but I'm still unsure why the memory is junk here.
Comment 35 Janvitus 2011-11-05 09:50:12 UTC
This bug (Gnome Shell crash) happens to me many times also when to show the notification on track change of Rhythmbox.
Comment 36 Doug Ballance 2011-11-08 06:16:50 UTC
I also have had this crash several times in the last week, but cannot recreate.  Running Arch.
Comment 37 Jeremy Nickurak 2011-11-08 22:57:11 UTC
Hitting this playing with pynotify, not sure why/how exactly.
Comment 38 Omri Har-Shemesh 2011-11-08 23:11:38 UTC
Hi,
I'm sorry if this is not the right place to ask, but since it comes probably related to this bug I will ask anyway - to me what happens is that sometimes gnome-shell restarts spontaneously (just as if I would do Alt+F2 and run "r") but sometimes it only manages to half-restart - everything from gnome-shell closes but does not restart again and I get left only with the windows that were open. 
I can then use Synapse to log out and then log in again, but I don't know of a way to fix this. 
Is there a way to run "r" in terminal or to restart gnome-shell somehow?
I'm on Oneiric.
Comment 39 Martin Weinelt 2011-11-09 02:32:01 UTC
Change to a terminal (Strg+Alt+F1...F6) and start the gnome shell from there

$ DISPLAY=:0 gnome-shell --replace

then switch back to the terminal your xserver runs in (usually F7, F8).
Comment 40 Tsu Jan 2011-11-17 07:00:12 UTC
I installed gnome-shell 3.2.1 in Debian several hours ago and see no restarting or session closing. I use a few extensions and a custom shell theme.

I remember that with weather extension, even gnome-shell 3.0.2 restarted randomly. Two weeks ago, I installed gnome-shell 3.2.1 for the first time and experienced shell restarting and session closing so often that I reverted to v3.0.2. I don't remember if I had any weather extension. But this time, the shell is running smoothly without weather extension.

Does anyone experience this bug WITHOUT weather extension?
Comment 41 Omri Har-Shemesh 2011-11-17 08:42:40 UTC
I still have the weather extension installed, but it is disabled. I think that since I disabled it the number of restarts decreased dramatically, but it still happens now and again, especially when the computer has a lot to think about.

What happens on my computer is that sometimes the shell restarts but does not complete the restart, leaving me without the top black panel, without Alt+F2 and without the ability to switch between the open applications (Alt+Tab). Luckily synapse still works fine and I am able to open a terminal and restart the shell manually. When this happens, and the shell crashes again, I can see a message that has to do with the calendar. I don't remember it exactly but I will copy it and paste it here when it happens again.
Comment 42 أحمد المحمودي (Ahmed El-Mahmoudy) 2011-11-17 13:24:37 UTC
You mean this error:

ERROR:gi/object.c:671:gjs_object_instance_constructor: assertion failed: (unthreadsafe_template_for_constructor.info == NULL || strcmp(g_base_info_get_name( (GIBaseInfo*) priv->info), g_base_info_get_name( (GIBaseInfo*) unthreadsafe_template_for_constructor.info)) == 0)
gnome-shell-calendar-server[8856]: Got HUP on stdin - exiting
Comment 43 Omri Har-Shemesh 2011-11-17 13:25:50 UTC
yes, something like that, even though I think some of the messages before are different.
Comment 44 Omri Har-Shemesh 2011-11-17 13:58:53 UTC
Here is an example (I ran gnome-shell --replace and after a few seconds it crashed again):


      JS LOG: GNOME Shell started at Thu Nov 17 2011 14:57:03 GMT+0100 (CET)

(gnome-shell:7688): Clutter-CRITICAL **: clutter_text_get_editable: assertion `CLUTTER_IS_TEXT (self)' failed

(gnome-shell:7688): Clutter-CRITICAL **: clutter_text_get_text: assertion `CLUTTER_IS_TEXT (self)' failed

(gnome-shell:7688): Clutter-CRITICAL **: clutter_text_set_text: assertion `CLUTTER_IS_TEXT (self)' failed

St-ERROR **: st_widget_get_theme_node called on the widget [0x9963558 StButton.status-chooser-user-icon] which is not in the stage.
gnome-shell-calendar-server[7696]: Got HUP on stdin - exiting
Trace/breakpoint trap

Makes sense?
Comment 45 Damien Alexandre 2011-11-17 16:30:55 UTC
I always have the same trace than Ahmed on Comment #42

ERROR:gi/object.c:671:gjs_object_instance_constructor: assertion failed:
(unthreadsafe_template_for_constructor.info == NULL ||
strcmp(g_base_info_get_name( (GIBaseInfo*) priv->info), g_base_info_get_name(
(GIBaseInfo*) unthreadsafe_template_for_constructor.info)) == 0)
gnome-shell-calendar-server[8856]: Got HUP on stdin - exiting
Comment 46 Tsu Jan 2011-11-17 21:14:27 UTC
Here, the shell has worked smoothly for more than a day without a single restarting.

I don't know if this is of any help but there's no "gi/object.c" or "st_widget_get_theme_node" message in my .xsession-errors but there are "Clutter-CRITICAL" messages in it, I haven't installed Evolution (I use Icedove), and I've purged (not just disabled) the weather extension and its schema file.
Comment 47 Berend De Schouwer 2011-11-24 12:51:40 UTC
So far, I can only crash gnome-shell when Epiphany is running and the load is high.

I've run for more than a week with Chromium and Firefox, and when I start Epiphany and up the load, gnome-shell dies.

"up the load" in this case means lots of browsers or tabs, or one browser with lots of stuff.  Enough to visibly slow down the machine.  I haven't confirmed RAM or X11 pixmap usage yet.  Epiphany isn't configured to even find flash.  Gnash is installed, though.

I've succesfully "up-ed the load" with the other browsers, and I've not been able to crash gnome-shell.  I've also increased the more traditional load average by compiling stuff, and I haven't crashed gnome-shell.

This is with 3.2.1 (Ubuntu version.)


I used to think it was Ubuntu's menu override; but I've since uninstalled that and a number of other unity hacks (scrollbars, unity itself, etc.) and it's still happening.

I've never used the weather extension.

(sorry this information isn't more specific.)
Comment 48 أحمد المحمودي (Ahmed El-Mahmoudy) 2011-11-24 13:31:40 UTC
GNOME Shell stopped crashing since I disabled the weather applet (yet it is still installed on the system)
I'm using Ubuntu 11.10 (Oneiric)
Comment 49 Damien Alexandre 2011-11-25 15:16:06 UTC
I followed the Ahmed advice since yesterday and it seems to work
No Gnome-shell crash without weather extension. I still have X freezing, but I suppose it's not related
Comment 50 Justin Wang 2011-11-25 15:56:57 UTC
me too... disabled the weather extension and no crash since the day before yesterday
Comment 51 Michael Cronenworth 2011-11-29 19:51:23 UTC
There's a Fedora bug report with plenty of affected users and all the backtraces you could dream of. No Gnome/Red Hat developer seems to be investigating this AFAIK though.

https://bugzilla.redhat.com/show_bug.cgi?id=725165
Comment 52 Jasper St. Pierre (not reading bugmail) 2011-11-29 20:41:45 UTC
Where's the source for the weather extension? I can't seem to find it.
Comment 53 Tsu Jan 2011-11-29 20:42:54 UTC
I emphasize what I said earlier: Weather extension even made GNOME-Shell 3.0.2 crash sometimes. Now it's about two weeks that I use shell 3.2.1 whithout any crash.
Comment 54 Michael Cronenworth 2011-11-29 20:49:18 UTC
(In reply to comment #52)
> Where's the source for the weather extension? I can't seem to find it.

It's on github.

https://github.com/simon04/gnome-shell-extension-weather
Comment 55 Jasper St. Pierre (not reading bugmail) 2011-11-29 21:22:02 UTC
I've been unable to reproduce this (if anybody has a set of steps, please let me know) but I have a guess:

    http://magcius.mecheye.net/shell/use-native-json.patch

Patch the weather extension with this patch. If you still get a crash, please let me know if it's the same one (unthreadsafe_template_for_constructor). If it appears to go away, please let me know. This means that json-glib is stomping on memory.
Comment 56 Michael Cronenworth 2011-11-29 22:14:06 UTC
Jasper, the crash doesn't happen on the loading of the extension. It happens at random times. I would try your patch, but it doesn't apply against the Gnome 3.2 branch.
Comment 57 Jasper St. Pierre (not reading bugmail) 2011-11-29 22:21:44 UTC
The "master" branch should be runnable with 3.2. Try that.
Comment 58 Michael Cronenworth 2011-11-29 22:23:59 UTC
(In reply to comment #57)
> The "master" branch should be runnable with 3.2. Try that.

OK. It's running. I'll update you if it crashes. Thanks!
Comment 59 Jasper St. Pierre (not reading bugmail) 2011-11-29 22:25:42 UTC
If it doesn't crash, try reverting the patch and running under valgrind's memcheck to see if it can spit out anything relevant to json-glib so we can catch the culprit and fix json-glib. See https://live.gnome.org/Valgrind for more information.
Comment 60 Michael Cronenworth 2011-12-03 03:15:49 UTC
Jasper, it still crashes. It crashed just one minute ago with this written to my .xsession-errors:

ERROR:gi/function.c:898:gjs_invoke_c_function: assertion failed (c_arg_pos == processed_c_args): (1 == 0)
Comment 61 Jasper St. Pierre (not reading bugmail) 2011-12-03 03:41:31 UTC
Hm. At least that's a different error. Is this with my JSON patch, or not?
Comment 62 Michael Cronenworth 2011-12-03 03:42:13 UTC
(In reply to comment #61)
> Hm. At least that's a different error. Is this with my JSON patch, or not?

With your patch.
Comment 63 Jasper St. Pierre (not reading bugmail) 2011-12-15 16:24:20 UTC
*** Bug 664026 has been marked as a duplicate of this bug. ***
Comment 64 Owen Taylor 2012-01-12 23:22:51 UTC
The problem is the code in the weather extension:

    load_json_async: function(url, fun) {
        let here = this;
        let session = new Soup.SessionAsync();

        if (Soup.Session.prototype.add_feature != null)
            Soup.Session.prototype.add_feature.call(session, new Soup.ProxyResolverDefault());

        let message = Soup.Message.new('GET', url);
        session.queue_message(message, function(session, message) {
            let jp = new Json.Parser();
            jp.load_from_data(message.response_body.data, -1);
            fun.call(here, jp.get_root().get_object());
        });
    },

because session is only pointed to by a local variable, it can get garbage collected before the request completes. If this happens and the session is finalized, libsoup will call the callback with a status of 
SOUP_STATUS_CANCELLED. This will cause GJS to attempt to allocate a new proxy object for 'session'. But allocating an object during GC is forbidden and fails, and when that happens, GJS doesn't properly clean up unthreadsafe_template_for_constructor.

So, two fixes are needed:

 * For GJS - do the cleanup properly
 * For the weather applet - use a singleton session object - like extensionSystem.js it should do:

  const _httpSession = new Soup.SessionAsync();
  Soup.Session.prototype.add_feature.call(_httpSession, new Soup.ProxyResolverDefault());

at file scope.
Comment 65 Tsu Jan 2012-01-26 11:20:19 UTC
It seems that the crash is fixed with the latest weather extension :)
Comment 66 Ildar 2012-01-26 14:50:17 UTC
(In reply to comment #65)
> It seems that the crash is fixed with the latest weather extension :)

Plz point out where's "the latest weather extension".
simon04's is not it.
Comment 67 Michael Cronenworth 2012-01-26 14:52:02 UTC
(In reply to comment #66)
> Plz point out where's "the latest weather extension".
> simon04's is not it.

gjs 1.30.1 fixes the issue without any changes required with the extension.
Comment 68 Tsu Jan 2012-01-26 15:00:33 UTC
> Plz point out where's "the latest weather extension"....

Because of the crash, I didn't use the weather extension since gnome-shell 3.2 came out. Yesterday I got simon04's from github and I haven't encountered any crash.

> gjs 1.30.1 fixes the issue...

I still have gjs 1.30.0.
Comment 69 Jasper St. Pierre (not reading bugmail) 2012-01-26 15:08:59 UTC
gjs 1.30.1 just masks the issue.

https://github.com/simon04/gnome-shell-extension-weather/commit/7b9d2edb5ac7170b23e60b59b901f65546b6b6df

should fix the crash for real.
Comment 70 Giovanni Campagna 2012-08-27 19:51:33 UTC
Ok, this is fixed right?
Comment 71 Michael Cronenworth 2012-08-28 01:55:36 UTC
(In reply to comment #70)
> Ok, this is fixed right?

Yes.