Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: print() function hang for long time

by soonix (Monsignor)
on Feb 19, 2013 at 09:23 UTC ( #1019492=note: print w/replies, xml ) Need Help??

in reply to print() function hang for long time

To me it looks as if the line from print might be hanging in the output buffer. Perhaps try
$| = 1
at the start of your script and see if that helps.

Replies are listed 'Best First'.
Re^2: print() function hang for long time
by dengguochen2003 (Initiate) on Feb 19, 2013 at 09:35 UTC
    Hi, soonix, thank you for the comments.

    Could you explain more? What output buffer do you mean? A buffer allocated by print() function?

    Wired thing is that I monitor the execution of the script through a putty terminal and find it hangs there for a long while on 2/14 and leave it there. When I am back to it on 2/15 I find it still hangs. So I connect to the machine through the console. When I am in the console it resumes suddenly. The machine configuration is: IBM server -> InReach TTY -> terminal.

        Hi, everybody, thank you for your attention on this problem. Finally I got the root cause. The reason is that the Linux kernel is configure to use console as standard output. And at the time when the perl is running the serial port is stuck. So the perl script hangs.
        Hi, vinoth.ree, soonix, thank you for pointing out the perl buffer. While this issue might not apply. I execute this script on various machines and it always goes ok. Only on this IBM machine with TTY console configured this problem shows up. So I am confused a lot. What is more, the script resumes when I login console and hit "return" next day.
        Hi, soonix, thanks for monitoring this issue. Will have a try on your idea. One question is whether the buffer can stuck the process. From the time stamp the process hangs on the print() line for more than 20 hours because code line 23 is executed on 2/15 and gives below time stamp in log line 21(2013/02/15 12:33:27).

        2013/02/15 12:33:27 2013/02/14 16:50:12:Audit:event(2)::SYSTEM

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019492]
[1nickt]: Ya gotta love the google. If you set accept=".txt" in a form input field where type="file", Chrome will allow you to select local files with extensions like .pl, .pm, .yaml, .ini etc. Nice!

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2017-07-22 18:19 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (340 votes). Check out past polls.