Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

segmentation faults

by Anonymous Monk
on Aug 21, 2002 at 12:54 UTC ( #191714=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello perlmonks !
I'm new here ( no account yet, waiting for the pass .... :) anyways, I have a question concerning segmentation faults. I have a process that regularly segfault , in various king of places ( most of the time while parsing a document with XML::Parser, some times while doing this : $msg{response} = delete $msg{operation}; # segfaulted here. before segfaulting, it gave me a nice bunch of : Attempt to free unreferenced scalar stuff... Any ideas of why I get this ? how I can trace it? ( i'm using sigtrap but it doesn't really give me info) I'm running everything with use strict, on a linux Mandrake 8.1 with perl 5.6.1 and no debugger compiled.

Thanks a lot...

Edit by tye

Replies are listed 'Best First'.
Re: segmentation faults
by RMGir (Prior) on Aug 21, 2002 at 13:12 UTC
    Interesting; looking at the docs for delete, that should certainly work, as long as %msg is a regular hash.

    Is %msg a tied hash of some kind? Where did it come from? If it's a tied hash, you'd have to look at how the tied class implements DELETE...
    --
    Mike

      ain't got no password to login still, sorry ;) well, this exerpt of code isn't supposed to segfault, it is perfectly valid, but it did a certain number of times .... ( according to sigtrap ). The hash was a perfectly normal hash, no tying or whatsoever. What about XML::Parser ? Is it likely to segfault ?
        here is a portion of the stacktrace
        Caught a SIGSEGV at /usr/lib/perl5/site_perl/5.6.1/i386-linux/XML/Pars +er/Expat.pm line 469 $ = XML::Parser::Expat::parse('XML::Parser::Expat=HASH(0x81cc7bc)', *Q +MM_MOD::emi::DATA) called from file `/usr/lib/perl5/site_perl/5.6.1/i +386-linux/XML/Parser.pm' line 185 $ = eval {...} called from file `/usr/lib/perl5/site_perl/5.6.1/i386-l +inux/XML/Parser.pm' line 184 $ = XML::Parser::parse('XML::Parser=HASH(0x4040b97c)', *QMM_MOD::emi:: +DATA) called from file `/usr/lib/perl5/site_perl/5.6.1/i386-linux/QMM +_MOD/emi.pm' line 33

        It's not clear why XML::Parser is segfaulting if no calls are being made to it by that code. Segfaults usually indicate serious problems with external libraries, and aren't usually thrown by (stable) versions of perl unless it invokes them. I'm afraid diagnosis of this problem requires looking at more than just the code.

        One possiblity that pops to my mind is that your version of XML::Parser was compiled with a particular version of the expat C libraries, and that the version of expat installed on your system is a different one.

        HTH

        If not P, what? Q maybe?
        "Sidney Morgenbesser"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://191714]
Approved by RMGir
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2023-09-22 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?