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 781433 - g_strdup(0x08) in _gweather_location_update_weather_location
g_strdup(0x08) in _gweather_location_update_weather_location
Status: RESOLVED DUPLICATE of bug 782761
Product: libgweather
Classification: Core
Component: general
3.24.x
Other Linux
: Normal normal
: future
Assigned To: libgweather-maint
libgweather-maint
Depends on:
Blocks:
 
 
Reported: 2017-04-18 07:08 UTC by Hristo Venev
Modified: 2017-06-05 04:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hristo Venev 2017-04-18 07:08:44 UTC
GNOME Shell crashes because _gweather_location_update_weather_location calls g_strdup(NULL). Looking at the code, it seems that yahoo_id might remain NULL even if it's specified in one of the parent locations.

I'll try to collect more information from another crash but it only happens once every few hours.
Comment 1 Hristo Venev 2017-04-18 07:19:15 UTC
It's on the line calling g_strdup on yahoo_id, but it's probably 0x08 as strlen() crashes on 0x08. The location is Sofia, Bulgaria. Should I compile an unoptimized version in order to get more data?
Comment 2 Giovanni Campagna 2017-04-18 16:56:13 UTC
It would be awesome even just to have a backtrace with debug symbols, as a start.

I'm surprised g_strdup(NULL) crashes as, at least from memory, it is NULL-safe and returns NULL. But 0x08 is not NULL so it could still be a problem.

I'm not aware of any libgweather crash occurring often, but few locations have yahoo_id's so it's probably high location specific.
Comment 3 Hristo Venev 2017-04-18 20:14:56 UTC
(gdb) bt
  • #0 _gweather_location_update_weather_location
    at gweather-location.c line 1095
  • #1 gweather_info_set_location_internal
    at gweather-weather.c line 2026
  • #2 object_set_property
    at gobject.c line 1423
  • #3 g_object_new_internal
    at gobject.c line 1817
  • #4 g_object_new_valist
    at gobject.c line 2042
  • #5 g_object_new
    at gobject.c line 1626
  • #6 _gweather_info_new_clone
    at gweather-weather.c line 2205
  • #7 parse_forecast_xml_new
    at weather-yrno.c line 475
  • #8 yrno_finish_new
    at weather-yrno.c line 572
  • #9 soup_session_process_queue_item
  • #10 async_run_queue
  • #11 idle_run_queue
  • #12 g_idle_dispatch
    at gmain.c line 5554
  • #13 g_main_dispatch
    at gmain.c line 3212
  • #14 g_main_context_dispatch
    at gmain.c line 3865
  • #15 g_main_context_iterate
    at gmain.c line 3938
  • #16 g_main_loop_run
    at gmain.c line 4134
  • #17 meta_run
    at core/main.c line 646
  • #18 main
    at main.c line 454
code = <error reading variable code (Cannot access memory at address 0x71)>
zone = 0x5654c93dfcb0 "x+\303\375\315\177"
yahoo_id = 0x8 <error: Cannot access memory at address 0x8>
radar = 0x5654c9cb12f0 "8-\303\375\315\177"
tz_hint = 0x31 <error: Cannot access memory at address 0x31>
country = 0x5654c8696800 ",\001"
latlon_valid = 1
lat = 4.689777965393999e-310
lon = 4.6897779654192952e-310
l = 0x21

gweather-location.c:1095: if (!code && l->station_code)

gloc = 0x5654c8de5370
gloc->english_name = "Sofia"
gloc->parent = 0x5654c8de4660
gloc->parent->english_name = Bulgaria
gloc->parent->parent->parent->parent = NULL and everything's OK.
gloc->children[0] = 0x5654c8de5420
gloc->children[1] = NULL

So gloc->children is NULL terminated and has 1 element. But:

gloc->children[0]->english_name = "\a"
gloc->children[0]->yahoo_id = 0x8
gloc->children[0]->parent = 0x5654c8218b90 != gloc
gloc->children[0]->parent->parent = 0x21 = l
Comment 4 Peter Y. Chuang 2017-04-24 16:36:10 UTC
Not sure if this is related. I've encountered frequent crashes with gnome shell gnome weather is installed:

https://bugzilla.gnome.org/show_bug.cgi?id=781509
Comment 5 gnome.org 2017-05-19 09:22:27 UTC
Are these all not the same bug?

I've had to solely use my work Mac for two weeks now (yuck) because my Gnome has been unusable.  I thought I fixed it by changing my location slightly but no.  Now, I've uninstalled gnome-weather and haven't crashed for about an hour but it's intermittent so, I'm not sure.

Let me know if I help in any way.

https://bugzilla.gnome.org/show_bug.cgi?id=781433
https://bugzilla.gnome.org/show_bug.cgi?id=781509
https://bugzilla.gnome.org/show_bug.cgi?id=781828
https://bugzilla.gnome.org/show_bug.cgi?id=782458
https://bugzilla.gnome.org/show_bug.cgi?id=782463
https://bugzilla.gnome.org/show_bug.cgi?id=782465
https://bugzilla.gnome.org/show_bug.cgi?id=782760
https://bugzilla.gnome.org/show_bug.cgi?id=782761
Comment 6 Giovanni Campagna 2017-06-05 04:41:44 UTC
Thanks for taking the time to report this.
This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed in the code repository.

*** This bug has been marked as a duplicate of bug 782761 ***