bugFreeciv - Bugs: bug #21896, "double free or...

 
 
Show feedback again

bug #21896: "double free or corruption" after "Connect to network game"

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sat 05 Apr 2014 11:32:03 PM UTC  
 
Category: client-gtk-2.0Severity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: NoneOpen/Closed: Closed
Release: trunk r24748Operating System: GNU/Linux
Planned Release: 2.5.0, 2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 18 May 2014 12:19:27 PM UTC, comment #7:

On the other hand, I managed to reproduce other trouble in this area while trying to break this, so there might be more work to do here.

However, the trigger and symptom is sufficiently different that I raised a new ticket, bug #22048.

Jacob Nevins <jtn>
Project Administrator
Sun 18 May 2014 11:44:09 AM UTC, comment #6:

I was able to reproduce this particular crash symptom before the fix (r24891) but not afterwards (r24892) in 17 attempts. I'm content to declare this fixed.

(Complicated by there being a much more frequent crash symptom now whose backtrace looks different and not obviously related. I'll raise another bug for that.)

Jacob Nevins <jtn>
Project Administrator
Sun 18 May 2014 08:05:24 AM UTC, comment #5:

output window thread safety pacth committed, but as I have not reproduced the crash with any version, leaving ticket open for jtn to confirm if it helped.

Marko Lindqvist <cazfi>
Project Administrator
Sun 18 May 2014 08:03:55 AM UTC, SVN revision 24893:

Made writes to output window thread-safe

Reported by Jacob Nevins

See bug #21896

(Browse SVN revision 24893)

Marko Lindqvist <cazfi>
Project Administrator
Sun 18 May 2014 08:03:49 AM UTC, SVN revision 24892:

Made writes to output window thread-safe

Reported by Jacob Nevins

See bug #21896

(Browse SVN revision 24892)

Marko Lindqvist <cazfi>
Project Administrator
Tue 13 May 2014 08:52:26 PM UTC, comment #2:

Patch to add mutex protection to output window writes.

(file #20732)

Marko Lindqvist <cazfi>
Project Administrator
Sat 05 Apr 2014 11:43:10 PM UTC, comment #1:

> I wonder if it's insufficient thread safety around the message
> window writing?


Almost certainly. Metaserver thread was created with the idea that it would not do anything else than build the server lists (which is the only mutex-protected thing in client/ code). It certainly was not meant to do any direct output except maybe logging (protected in utility/ code). My bad that I didn't realize that the check of newer versions went to the metaserver thread when I added it (it was tested mainly in S2_4 where there is no separate metaserver thread)

Marko Lindqvist <cazfi>
Project Administrator
Sat 05 Apr 2014 11:32:03 PM UTC, original submission:

Crash occurred on starting client and then activating the "Connect to network game" button (by pressing Alt-O rather than clicking, if it makes a difference).

It crashed once when I didn't catch a coredump. I was able to reproduce a crash fairly readily, although it didn't happen every time.

The crash is in the metaserver thread, when it's writing "There is no newer stable release of Freeciv available." to the 'message window' (which at this point is I think a single status line). I wonder if it's insufficient thread safety around the message window writing?

Crashing thread backtrace:

Here's what the other (main) thread is doing (this might shed light on the state of the message window and its GtkTextBuffer, perhaps):

Jacob Nevins <jtn>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #20732:  ProtectOutputWindow.patch added by cazfi (4kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 18 May 2014 11:44:09 AM UTCjtnStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 13 May 2014 08:52:26 PM UTCcazfiAttached File-=>Added ProtectOutputWindow.patch, #20732
      StatusNone=>Ready For Test
    Sat 05 Apr 2014 11:43:10 PM UTCcazfiPlanned Release2.6.0=>2.5.0, 2.6.0
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup