Re: seg faults when i use thread->new from a thread - am i using threads incorrectly?

[email protected] (Arthur Bergman)
Newsgroups perl.ithreads
Message-ID <[email protected]>
On onsdag, apr 2, 2003, at 16:56 Europe/Stockholm, Bradley W. Langhorst 
wrote:

> On Wed, 2003-04-02 at 08:47, Arthur Bergman wrote:
>> This has been known to be a bit wonky on Win32, but not under unix
>> (which I assume you are using because you like forks.pm)
>>
> that's correct - i'm using linux 2.4.20
>
>>
>> A backtrace would be nice,,
>>
>> gdb perl
>> run ./agent.pl
>> bt
>
> zoiks  - that is a long back trace...
> you may be wondering why so many calls sv_grp and mg_dup...
>
> Im sharing 4 variables between threads
> 1) fairly complex multi-d hash containing arrays
> 2) straighforward 2-d hash
> 3) an array of hashes
> 4) a hash of arrays
>

Because the cloning is recursive.

It is not helping us much except pointing out it is in new.

>
> use IO::Socket;
> use Carp; #could do without this...
> use threads;
> use threads::shared;
> #use forks;
> #use forks::shared;
> use Fcntl qw(:DEFAULT :flock); #for locking the log file
> use Data::Dumper; #for debugging - don't really need this.
>
>

my guess is that there is some problem cloning the IO::Socket,  could 
you please try again to get a backtrace with a perl recompiled with 
debugging

to get one -Doptimize='-g' -Dusethreads  should be enough!

Arthur
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.