Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: How to find perl line after segfault.

by Steve_BZ (Chaplain)
on Feb 14, 2015 at 18:43 UTC ( [id://1116712]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to find perl line after segfault.
in thread How to find perl line after segfault.

Hi Browser UK,

perl -d:CallTrace i-Mage.pl 2> trace.txt

absolutely did the job and found the problem immediately. It was a Wx::Timer process that I had forgotten about starting off a little early. There seemed to be very little performance overhead, maybe the program loaded a bit slower but after that it seemed about the same as always.

Now I'd like to call it from open3 like this:

my @array = qw(perl -d:CallTrace i-Mage.pl); my $child_pid = open3( '<&STDIN', ">trace.txt", *CHILD_ERROR, @array );

The code starts, but there is no sign of "trace.txt".

Not sure where I'vwe gone wrong.

Regards

Steve.

Replies are listed 'Best First'.
Re^5: How to find perl line after segfault.
by BrowserUk (Patriarch) on Feb 14, 2015 at 20:32 UTC

    Sorry, but I never had any luck at all with open3() when I first tried it, as a consequence I never use it. You'll need help from someone who does.

    As an aside; I wasn't aware that open3(), accepted strings for the file handles. Nor does anything in the documentation lead me to believe it does.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

      Ok, maybe that's it.

      Actually, I notice now that CallTrace outputs to STDERR not STDOUT, so it wouldn't work for that reason either.

      Thanks for your help.

        As you're sending the output to a file, why not just?:

        system q[perl -d:CallTrace i-Mage.pl 2> trace.txt];

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
        In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-16 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found