The following perl script causes segmentation fault. Is there a way to fix or work around?

use Net::ADNS qw(ADNS_R_A ADNS_R_A); $adns = Net::ADNS->new; use Data::Dumper; my $query = $adns->submit("pwarez.6x.to", ADNS_R_A) or die "$!"; $query->{user} = 'my data'; my ($r, $w, $e, $t) = $adns->before_select; if (select($r, $w, $e, $t)) { if (my $answer = $adns->check) { print "resolved query: ", Dumper $answer; } }

perl version: perl-5.8.8-38.el5

perl adns: Net-ADNS-0.03.tar.gz

The script works perfect if the host is www.google.com Ran valgrind perl SCRIPT:

==8942== Process terminating with default action of signal 11 (SIGSEGV +) ==8942== Access not within mapped region at address 0x8 ==8942== at 0x4097D17: Perl_sv_unmagic (in /usr/lib/perl5/5.8.8/i38 +6-linux-thread-multi/CORE/libperl.so) ==8942== by 0x413FD9A: XS_Net__ADNS_DESTROY (ADNS.xs:346) ==8942== by 0x409258C: Perl_pp_entersub (in /usr/lib/perl5/5.8.8/i3 +86-linux-thread-multi/CORE/libperl.so) ==8942== by 0x402C0A0: ??? (in /usr/lib/perl5/5.8.8/i386-linux-thre +ad-multi/CORE/libperl.so) ==8942== by 0x4030945: Perl_call_sv (in /usr/lib/perl5/5.8.8/i386-l +inux-thread-multi/CORE/libperl.so) ==8942== by 0x4097153: Perl_sv_clear (in /usr/lib/perl5/5.8.8/i386- +linux-thread-multi/CORE/libperl.so) ==8942== by 0x40979B4: Perl_sv_free (in /usr/lib/perl5/5.8.8/i386-l +inux-thread-multi/CORE/libperl.so) ==8942== by 0x4097F5D: ??? (in /usr/lib/perl5/5.8.8/i386-linux-thre +ad-multi/CORE/libperl.so) ==8942== by 0x4094D7F: ??? (in /usr/lib/perl5/5.8.8/i386-linux-thre +ad-multi/CORE/libperl.so) ==8942== by 0x4094DE9: Perl_sv_clean_objs (in /usr/lib/perl5/5.8.8/ +i386-linux-thread-multi/CORE/libperl.so) ==8942== by 0x403297A: perl_destruct (in /usr/lib/perl5/5.8.8/i386- +linux-thread-multi/CORE/libperl.so) ==8942== by 0x80491C6: main (in /usr/bin/perl)

In reply to Net::ADNS Segmentation fault by jihong.cai

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.