[Freeciv-Dev] [bug #19064] g_object_ref: assertion `object-ref_count 0' failed

2011-11-27 Thread Jacob Nevins

URL:
  http://gna.org/bugs/?19064

 Summary: g_object_ref: assertion `object-ref_count  0'
failed
 Project: Freeciv
Submitted by: jtn
Submitted on: Sun Nov 27 21:22:23 2011
Category: client-gtk-2.0
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: S2_3 r20613
 Discussion Lock: Any
Operating System: GNU/Linux
 Planned Release: 

___

Details:

Getting some Gtk warnings from the client (S2_3 r20613, circa 2.3.1) on
initial connection to the server freeciv-debian.ns0.it (which can be found
on the metaserver at the moment).

This server sends some funky featured text on connect with a colour ASCII-art
picture of a soldier; I suspect this is implicated, but I haven't investigated
further.

The warnings from a normal run:


(freeciv-gtk2:5626): GLib-GObject-CRITICAL **: g_object_ref: assertion
`object-ref_count  0' failed

(freeciv-gtk2:5626): GLib-GObject-CRITICAL **: g_object_unref: assertion
`object-ref_count  0' failed

(freeciv-gtk2:5626): GLib-GObject-CRITICAL **: g_object_unref: assertion
`object-ref_count  0' failed


With -d 3 -l file -- --g-fatal-warnings, it dies at the first of these,
with the following backtrace:


#0  0x7f95448caa75 in *__GI_raise (sig=value optimised out)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
pid = value optimised out
selftid = value optimised out
#1  0x7f95448ce5c0 in *__GI_abort () at abort.c:92
act = {__sigaction_handler = {sa_handler = 0, sa_sigaction = 0},
  sa_mask = {__val = {33844864, 2, 140279080377920, 2, 171540480,
  140279076739848, 140279153072528, 140279085612640, 4294967295,
  2, 5, 2998376, 0, 140734672850160, 140279085612640,
  140279082610688}}, sa_flags = 1224238993,
  sa_restorer = 0x7fff0005}
sigs = {__val = {32, 0 repeats 15 times}}
#2  0x7f9544e8033a in g_logv () from /lib/libglib-2.0.so.0
No symbol table info available.
#3  0x7f9544e803d3 in g_log () from /lib/libglib-2.0.so.0
No symbol table info available.
#4  0x7f954573573a in g_object_ref () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#5  0x7f95474b1707 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#6  0x7f95474b1f0f in ?? () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#7  0x7f95474d348c in gtk_text_tag_table_remove ()
   from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#8  0x7f95474d1512 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#9  0x7f95457355a4 in g_object_unref () from
/usr/lib/libgobject-2.0.so.0
No symbol table info available.
#10 0x00496bf1 in apply_text_tag (astring=0x7fff582ed760 , 
tags=value optimised out, conn_id=value optimised out)
at chatline.c:829
tag = 0xa38b480
foreground = {pixel = 1536, red = 0, green = 0, blue = 0}
background = {pixel = 1, red = 65535, green = 65535, blue = 65535}
start = {dummy1 = 0x2badc00, dummy2 = 0xa3a9000, dummy3 = -1, 
  dummy4 = 0, dummy5 = 724, dummy6 = -1, dummy7 = -829544620, 
  dummy8 = -1052114181, dummy9 = 0x2bb07a0, dummy10 = 0xa37bf60, 
  dummy11 = -1, dummy12 = 0, dummy13 = -1650614882, 
  dummy14 = 0xa381f60}
stop = {dummy1 = 0x2badc00, dummy2 = 0xa3a9000, dummy3 = -1, 
  dummy4 = 0, dummy5 = 724, dummy6 = -1, dummy7 = -829544620, 
  dummy8 = -1052114181, dummy9 = 0x2bb07a0, dummy10 = 0xa37bf60, 
  dummy11 = -1, dummy12 = 0, dummy13 = 1158755856, dummy14 =
0x565425}
initalized = true
#11 real_output_window_append (astring=0x7fff582ed760 , 
tags=value optimised out, conn_id=value optimised out)
at chatline.c:903
ptag_iter = value optimised out
ptag = value optimised out
buf = 0x20cd1b0
iter = {dummy1 = 0x2badc00, dummy2 = 0xa3a9000, dummy3 = 0, 
  dummy4 = 0, dummy5 = 724, dummy6 = -1, dummy7 = -829544620, 
  dummy8 = -1052114183, dummy9 = 0x0, dummy10 = 0x0, dummy11 =
-1, 
  dummy12 = -1, dummy13 = 175, dummy14 = 0x7f954574d4f8}
mark = 0x5615d80
text_start_offset = 724
__FUNCTION__ = real_output_window_append
#12 0x004211f3 in handle_event (featured_text=value optimised out,

ptile=value optimised out, event=E_SETTING, 
conn_id=value optimised out) at climisc.c:1021
plain_text =

[Freeciv-Dev] [bug #19064] g_object_ref: assertion `object-ref_count 0' failed

2011-11-27 Thread Jacob Nevins

Follow-up Comment #1, bug #19064 (project freeciv):

Should have said, I'm connected as a global observer.

___

Reply to this item at:

  http://gna.org/bugs/?19064

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19064] g_object_ref: assertion `object-ref_count 0' failed

2011-11-27 Thread Jacob Nevins

Follow-up Comment #2, bug #19064 (project freeciv):

I don't have a complete picture of what's going on yet, but I'm a little
dubious about this code in gui-gtk-2.0/chatline.c:apply_text_tag():


  GtkTextBuffer *buf;
  /* ... */
  case TTT_COLOR:
{
  /* We have to make a new tag every time. */
  GtkTextTag *tag = NULL;
  /* ... */
  tag = gtk_text_buffer_create_tag(buf, NULL, /* ... */);
  /* ... */
  gtk_text_buffer_apply_tag(buf, tag, /* ... */);
  g_object_unref(G_OBJECT(tag)); /* Bad? */
}


Looking at the gtk_text_buffer_create_tag() docs
http://developer.gnome.org/gtk/2.24/GtkTextBuffer.html#gtk-text-buffer-create-tag,
I _think_ that the ownership of the created tag is passed to a structure
inside 'buf', so the caller doesn't have to free it. The annotation transfer
none apparently
http://developer.gnome.org/gtk/2.24/annotation-glossary.html#glsT means
Don't free data after the code is done, which I think may corroborate my
argument.

The same applies to case TTT_LINK.

This server uses loads of colours, though, so I'm not sure why we're not
seeing loads of these warnings. Perhaps the reference count only drops below
zero in unusual circumstances. Or perhaps this possible thing I've found has
nothing to do with these warnings.

___

Reply to this item at:

  http://gna.org/bugs/?19064

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19064] g_object_ref: assertion `object-ref_count 0' failed

2011-11-27 Thread Jacob Nevins

Follow-up Comment #3, bug #19064 (project freeciv):

Well, I commented out the g_object_unref() and connected to that server a few
times and didn't get warnings, but I'm not sure that proves anything; I could
just be quietly leaking resources, and when I saw this behaviour on this
server once before, it didn't seem reproducible (although it seems so now).

Attached a screenshot of the featured text in question, partly to give some
idea about reproducing and partly because it's cute. ;)

(file #14610)
___

Additional Item Attachment:

File name: freeciv-debian.ns0.it.png  Size:169 KB


___

Reply to this item at:

  http://gna.org/bugs/?19064

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev