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

Hi Monks-

With your help (especially Zantara) I have developed a short perl script that acts like a midi playlist editor. It uses the Tk library for a gui, IO::socket to get messages, and spawns off the playmidi executable in the background with a system("playmidi songfile &") call.

It runs fine for a little while, then after playing a song and being idle, apparently it locks up my whole computer. (no display or ssh access, keyboard lights blink, and cpu gets very warm). I have been using VNC to test the program Its a debian knoppix system, kernel 2.4.26.

Anybody have any ideas about what might be locking it up? Is the latest Tk library or IO::Socket module not completely stable? I've been using this system for over a year, and have never seen it lock up like this, and unfortunately, it doesn't seem like tracking this down will be too easy.

Considered by PodMaster - EDIT - replace "creashes" with "freezes"
Unconsidered by castaway - Keep/Edit/Delete: 27/23/1

Replies are listed 'Best First'.
Re: Perl crashes linux
by eyepopslikeamosquito (Archbishop) on Feb 22, 2005 at 06:12 UTC

    If your kernel is locking up, it must be a fault with the kernel itself or (more likely) a device driver; a user-level program should not be able to do it. Though I'm not very familiar with the Tk or IO::Socket Perl libraries, I doubt that either has a device driver; therefore they cannot be the root cause of your kernel locking up.

Re: Perl crashes linux
by nerfherder (Monk) on Feb 22, 2005 at 06:40 UTC
    Post the code; it's likely that someone here can help if there is a problem with your Perl code.

    However:    Are you sure this only occurs when you run your Perl script? If your CPU is getting hot and the machine becomes unresponsive, it is most likely that this is not a Perl issue at all. Rather, you probably have a cooling issue; either a fan has failed, or the heatsink compound between the heatsink and processor has been baked to a crisp (common problems -- could be something else). Good luck!
      I found the problem. The lockup is apparently caused when I exec the system("playmidi -e midifile &") command.

      playmidi in fact does utilize a soundcard driver to send midi data through the midi out port of the soundcard.

      I can't duplicate this consistently though. But at least I see that this problem really isn't perl related.

Re: Perl crashes linux
by sh1tn (Priest) on Feb 22, 2005 at 08:50 UTC
    Another possible reason is hardware exhausting program.
    If this is the problem you can limit hardware resources usage with
    /etc/security/limits.conf. This is only possible if the program is not running
    with effctive user root.