Hi Elizabeth,
Thanks for the suggestion. I went ahead and ran it with Valgrind and it
appears that most of the complaints have to do with DBI and DBD::Oracle. I
didn't mention the DB connectivity before because I didn't think it was
relevant, but apparently it is an issue. DB handles are not needed by the
child threads, so I tried changing the code to destroy the handle before
launching the threads (and subsequently recreating it afterwards). I now
get different errors, which are too numerous to paste completely, but it's
along these lines:
Attempt to free unreferenced scalar during global destruction.
Unbalanced string table refcount: (1) for "DESTROY" during global
destruction.
Use of uninitialized value in null operation during global destruction.
Attempt to free unreferenced scalar during global destruction.
Attempt to free unreferenced scalar during global destruction.
Use of uninitialized value in null operation during global destruction.
(in cleanup) Can't upgrade that kind of scalar during global
destruction.
Use of uninitialized value in subroutine entry at
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/DBI.pm line
491.
Use of uninitialized value in null operation at
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/DBI.pm line
533.
Segmentation fault
The Valgrind output shows even more complaints about DBI, so I'm wondering
now if DBI is not completely thread safe. I thought the fact that I
destroyed the db handle beforehand would fix it, but maybe things being
exported from the "use DBI;" are still messing things up? I'm really out of
my element with threads, so I'm really not sure...
Do you have any other ideas?
Thanks much,
-Allen
-----Original Message-----
From: Elizabeth Mattijsen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 3:57 AM
To: Chen, Allen; '[EMAIL PROTECTED]'
Subject: Re: Segmentation fault when joining
At 06:31 PM 8/26/02 -0400, Chen, Allen wrote:
>I'm not sure this is the right list to be posting this too, but it seems to
>be the most appropriate one that I can find. I'm having a problem with the
>new ithreads in 5.8. Actually, it sounds similar to the problem mentioned
>in the previous thread about the simple program that segfaults when trying
>to join 200 trivial threads.
>
>In my application, I launch off a variable number of threads running the
>same subroutine. At some point in the program, I loop through and join all
>of these threads. Regardless of the number of threads spawned, the program
>segfaults when it gets to the very last thread. I've tried changing the
>order by which I join them and I still have the same problem--it doesn't
>segfault until I get to the last remaining thread. Here's a dump of the
>errors I get:
>
>Attempt to free non-existent shared string ':p5' during global destruction.
>Attempt to free non-existent shared string ':p3' during global destruction.
>Attempt to free non-existent shared string ':p1' during global destruction.
>Attempt to free non-existent shared string ':p4' during global destruction.
>Attempt to free non-existent shared string ':p2' during global destruction.
>Unbalanced string table refcount: (1) for "DESTROY" during global
>destruction.
>Scalars leaked: -11
>Segmentation fault
>
>Do any of you have any insight on these errors and what I might do to
>prevent them? There's very little documentation that I can find on the new
>threads, so I'm really at a loss. Any help would be greatly appreciated.
>
>If this is the wrong list to be posting to, I apologize. If you could
point
>me to a more appropriate one, I would appreciate that, too.
If you are running on a x86 system, have you tried installing valgrind and
running this test through it, preferably with a version of perl that has
debugging enabled?
Valgrind is an open source memory checker, available from:
http://developer.kde.org/~sewardj/
If you can't or don't want to do this, you could send me the code off-list
and have me run it to see what is going wrong.
Liz