Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I agree with tirwhan. I've seen that error quite often when doing initial prototypes of scripts using threads. You have to remember, that when you create a thread, it gets a complete copy of the parent, at the time of it's birth. So if you have a script that loads alot of modules, and creates a bunch of objects, THEN creates the threads, when the thread runs, there will be confusion between the parent's object, and the thread's copy. That's where the "double free" comes from, I believe, when the script tries to clean up an object when the thread exits, but a second copy exists. See threads: spawn early to avoid the crush. and Use thread with good care, but definitely keep using it

The Glib module tries to keep track of extra objects, to improve thread safety, with

#this line causes the warning, but dosn't die die "Glib::Object thread safetly failed" unless Glib::Object->set_threadsafe (TRUE);
so you may want to look into GLib, (which is the base object class for Gtk2, and works without X ).

The other thing to do, is try to keep your objects in the thread code block, don't create objects in the parent thread before the threads are created.


I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re: glibc error in linux by zentara
in thread glibc error in linux by srinivas_rocks

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found