Hi Monks!

I am facing a typical problem in XS programming with multiple interpreter on Linux 2.1 advanced server. If any one please give me any pointers it will be very helpful to me. I have built perl with following options.
config_args='-des -Dcc=cc -Dcf_email=PerlDirect@ActiveState.com -Dusethreads -Duseithreads -Dcf_by=ActiveState -Uinstallusrbinperl -Ud_sigsetjmp -Dinc_version_list=5.6.0/i686-linux-thread-multi 5.6.0 -Dprefix=/home/pijush/project/Testing/Perl and gccversion is '2.95.2 20000220 (Debian GNU/Linux)', libc is 'libc-2.1.3.so'.
In xs(say test.xs) file I have written following code

....... MODULE=TestModule::TestAPI PACKAGE=TestModule:Test1 int TestMethod1(.......) ....... ..... MODULE=TestModule::TestAPI PACKAGE=TestModule:Test2 int TestMethod2(........) ........ .......
I have built a shared library from this xs file and place it in my perl location. After that I have written a test script (say test.pl) to test the code.
use TestModule::TestAPI; my $testbase = TestModule::TestAPI->New(); my $var1 = $testbase->TestMethod1(...); my $var2 = $testbase->TestMethod2(...);
But the test script is generatting an error on TestMethod2. To debug the error what I have done, I put an infinite loop on TestMethod2 and built so file without optimization and -g option. Then I started the script and to start debugging I have attached the main process (since I have built my perl with MULTIPLICITY USE_ITHREADS, so there is 4-5 process running simultaneously)with gdb. At my surprise I observerved that although the script stopped at infinite loop but after stepping (using step command) gdb showing code which is present in TestMethod1.
I have tried with perl -d test.pl without modifying test.xs(i.e. without placing infinite loop), but the programme hangs during the execution of TestMethod2.
Can any one please give me any pointers how can I check why this strange thing is happening on Linux?
Thanks in advance.
Regards
-Pijush

In reply to A query on XS programing with multiple interpreter on Linux!!! by pijush

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.