Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi,

I am new in perl programming. I have used perl5.8.8 on solaris 8 with threaded options. I have written an application which has forked a child. And child is spawning several perl-threads. Each thread is doing following task independently:

1. creating a file & writing some data in proper manner. Every variable thats need to be get modified, I have used with my directive in thread function. The rest of the vaiable thats are read-only in child threads kept as thread::shared

2. then each thread forking a C++ application which is in turn parsing the perepared file & forming packet & firing packet through socket & receiving response from remote server. All modifiable variables are kept local as mentioned before & read-only vaiables are kept shared.

3. the output of this C++ apllication is analysed in my perl application & it is updating the database. I have used DBI module to intereact with database. In-order to maintain thread-safe manner( as DBI is not safe) I have made local to thread function wataever DBI object I am creating.

i am joing all threads to the child process.When all threads completes its work it is exting using thr->exit().When all threads are exiting child process is exiting automatically. I am stoping the parent process(my application which is forking child process) to stop forking one more child until previous child is exited properly using some unix command( combination of ps -ef & grep).

This application is working fine with 10000 data but when we are increasing the data it is throwing core dump. I have analized core dump with the help of gdb. I have got following stack trace:

/opt/radius/sql/scripts/DMCoA>gdb /opt/radius/perl588/bin/perl ./core GNU gdb 6.0 Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and y +ou are welcome to change it and/or distribute copies of it under certain cond +itions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for det +ails. This GDB was configured as "sparc-sun-solaris2.8"... warning: core file may not match specified executable file. Core was generated by `/opt/radius/perl588/bin/perl /opt/radius/sql/sc +ripts/DMCo A/Monitor.pl 1'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/lib/libsocket.so.1...done. Loaded symbols for /usr/lib/libsocket.so.1 Reading symbols from /usr/lib/libnsl.so.1...done. Loaded symbols for /usr/lib/libnsl.so.1 Reading symbols from /usr/lib/libdl.so.1...done. Loaded symbols for /usr/lib/libdl.so.1 Reading symbols from /usr/lib/libm.so.1...done. Loaded symbols for /usr/lib/libm.so.1 Reading symbols from /usr/lib/libpthread.so.1...done. Loaded symbols for /usr/lib/libpthread.so.1 Reading symbols from /usr/lib/libc.so.1...done. Loaded symbols for /usr/lib/libc.so.1 Reading symbols from /usr/lib/libmp.so.2...done. Loaded symbols for /usr/lib/libmp.so.2 Reading symbols from /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1... +done. Loaded symbols for /usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1 Reading symbols from /usr/lib/libthread.so.1...done. Loaded symbols for /usr/lib/libthread.so.1 Reading symbols from /usr/lib/locale/en_GB.ISO8859-1/en_GB.ISO8859-1.s +o.2... done. Loaded symbols for /usr/lib/locale/en_GB.ISO8859-1/en_GB.ISO8859-1.so. +2 Reading symbols from /opt/radius/perl588/lib/perl5/site_perl/5.8.8/sun +4-solaris- thread-multi/auto/DBI/DBI.so...done. Loaded symbols for /opt/radius/perl588/lib/perl5/site_perl/5.8.8/sun4- +solaris-th read-multi/auto/DBI/DBI.so ---Type <return> to continue, or q <return> to quit--- Reading symbols from /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris- +thread-mul ti/auto/POSIX/POSIX.so...done. Loaded symbols for /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris-th +read-multi /auto/POSIX/POSIX.so Reading symbols from /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris- +thread-mul ti/auto/IO/IO.so...done. Loaded symbols for /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris-th +read-multi /auto/IO/IO.so Reading symbols from /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris- +thread-mul ti/auto/Fcntl/Fcntl.so...done. Loaded symbols for /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris-th +read-multi /auto/Fcntl/Fcntl.so Reading symbols from /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris- +thread-mul ti/auto/threads/threads.so...done. Loaded symbols for /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris-th +read-multi /auto/threads/threads.so Reading symbols from /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris- +thread-mul ti/auto/threads/shared/shared.so...done. Loaded symbols for /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris-th +read-multi /auto/threads/shared/shared.so Reading symbols from /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris- +thread-mul ti/auto/Filter/Util/Call/Call.so...done. Loaded symbols for /opt/radius/perl588/lib/perl5/5.8.8/sun4-solaris-th +read-multi /auto/Filter/Util/Call/Call.so Reading symbols from /opt/radius/perl588/lib/perl5/site_perl/5.8.8/sun +4-solaris- thread-multi/auto/DBD/Oracle/Oracle.so...done. Loaded symbols for /opt/radius/perl588/lib/perl5/site_perl/5.8.8/sun4- +solaris-th read-multi/auto/DBD/Oracle/Oracle.so Reading symbols from /raid1/oracle9b/lib/libclntsh.so.9.0...done. Loaded symbols for /raid1/oracle9b/lib/libclntsh.so.9.0 Reading symbols from /usr/lib/libgen.so.1...done. Loaded symbols for /usr/lib/libgen.so.1 Reading symbols from /usr/lib/libsched.so.1...done. Loaded symbols for /usr/lib/libsched.so.1 Reading symbols from /usr/lib/libaio.so.1...done. Loaded symbols for /usr/lib/libaio.so.1 Reading symbols from /usr/lib/librt.so.1...done. Loaded symbols for /usr/lib/librt.so.1 Reading symbols from /usr/lib/libkstat.so.1...done. Loaded symbols for /usr/lib/libkstat.so.1 Reading symbols from /raid1/oracle9b/lib/libwtc9.so...done. Loaded symbols for /raid1/oracle9b/lib/libwtc9.so #0 0x0007a944 in S_raise_signal () (gdb) bt full #0 0x0007a944 in S_raise_signal () No symbol table info available. #1 0x0007a994 in Perl_csighandler () No symbol table info available. #2 0xff0db220 in __sighndlr () from /usr/lib/libthread.so.1 No symbol table info available. #3 <signal handler called> No symbol table info available.

I am looking for suggestion from monks to identify the problem behind it.

With Regards,

Kaustuv

In reply to perl ithread issue by elf_firein

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 contemplating the Monastery: (5)
As of 2024-04-25 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found