Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Producing minimal examples for crashers

by Anonymous Monk
on Jun 10, 2013 at 06:55 UTC ( [id://1038002]=note: print w/replies, xml ) Need Help??


in reply to Producing minimal examples for crashers

Replies are listed 'Best First'.
Re^2: Producing minimal examples for crashers
by wumpus (Sexton) on Jun 10, 2013 at 08:04 UTC
    I don't have a windoze box. On Linux with 5.8.8 I do see the warn "Insecure dependency in kill while running with -T switch at /usr/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 2446." I do not see a crash, but valgrind (which is a utility that interprets machine code and checks all memory accesses carefully) says that there just after that warn, there are some reads of memory that was free()ed, which is a bug that could easily cause a crash.

    On Linux with 5.16.0 that warn is not there and valgrind's report is clean. So you'll probably find it's fixed if you upgrade. (I remember this valgrind-complains-under-taint symptom coming up on perl5-porters, in fact, and it was fixed.)

    I set my tool to look for the message and it was confused by the fact that either "warn;" can cause the message to appear. This causes the message under 5.8.8:

    #!/usr/bin/env perl -T use strict; use WWW::Mechanize; my $ua = WWW::Mechanize->new(); my $url = shift; $ua->get($url); warn;
    But this code does not cause valgrind to complain. So I made the tool use valgrind (much slower) and it says the invalid memory access has this shortest script:
    #!/usr/bin/env perl -T use strict; use WWW::Mechanize; my $ua = WWW::Mechanize->new(); my $url = shift; $ua->get($url); my $pager = parsepage($ua); sub parsepage { my $so = join "\n", $ua->content =~/(so\.addVariable\(\s*'.+?'\s*, +\s*'.+?'\s*\)\s*;)/mg; while($so =~/so\.addVariable\('([^']+)','([^']+)'\);/mg) { } }
    And, interestingly enough, whether it shows the bug depends on the name of the script! So it's very sensitive to memory layout.

    Anyway, thanks, now I've figured out how to add valgrind and taint, and hopefully I'll release this script to the public in a few days.

      You keep talking about your tool, but have you published any version of it? If so, link man, link

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-20 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found