kvirc / KVIrc

The KVIrc IRC Client
http://www.kvirc.net/
GNU General Public License v2.0
244 stars 74 forks source link

Crash when using perl script #521

Closed DarthGandalf closed 9 years ago

DarthGandalf commented 9 years ago

Reported by Somebody on 12 Aug 2009 18:37:45 UTC I wrote script

perl.begin
use strict;
use warnings;
eval{

sub getamarok ($) {
    my $x=`dcop amarok player $_[0]`;
    $x=~s/\n//;
    $x
}
my $title=getamarok "title";
my $album=getamarok "albom";
my $artist=getamarok "artist";
my $year=getamarok "year";
my $genre=getamarok "genre";
my $type=getamarok "type";
my $bitrate=getamarok "bitrate";
my $totaltime=getamarok "totalTime";
my $curtime=getamarok "currentTime";
my $status=getamarok "status";
my $nowplaying=getamarok "nowPlaying";

sub color ($){
    KVIrc::eval('return $k('.$_[0].')')
}
my $vivod;

if($status eq ""){$vivod="listens nothing: Amarok not runs"}
elsif($status eq "0"){$vivod="listens nothing: Amarok stopped"}
else{
    my $nazvanie=$title?$title:$nowplaying;
    if($nazvanie){
        $vivod=$nazvanie;
        $vivod="$artist - $vivod" if $artist;
        $vivod.=" - $album" if $album;
        $vivod.=" ($year)" if $year;
        $vivod="слушает: ".color(4).$vivod;
    }else{
        $vivod="listens something"
    }
    $vivod.=color(5)." [$curtime/$totaltime] ".color(10)."[$type, $bitrate kbps]";
    $vivod.=color(6)." (Paused)" if $status eq "1";
}
KVIrc::eval("me \"$vivod\"")
};
KVIrc::eval("echo $@") if $@
perl.end

Sometimes it crashes kvirc when using. Last lines of stdout/stderr:

panic: MUTEX_LOCK (22) [op.c:453] at (eval 1) line 3.                                      
panic: MUTEX_LOCK (22) [op.c:453].                                                         
Callback called exit.

Migrated from: https://svn.kvirc.de/kvirc/ticket/521

DarthGandalf commented 9 years ago

Comment by Somebody on 13 Aug 2009 03:10:06 Ah, I forgot my specs... :(

r3409

$ kvirc --version
KVIrc 4.0.0 'Insomnia'
Sources date: 20090703

$ uname -a
Linux H71N222 2.6.26-2-amd64 #1 SMP Sun Jun 21 04:47:08 UTC 2009 x86_64 GNU/Linux

$ perl --version
This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi

$ cat /etc/issue
Debian GNU/Linux squeeze/sid \n \l
DarthGandalf commented 9 years ago

Comment by ctrlaltca on 23 Aug 2009 10:51:28 A patch have been committed in r3424 to address this issue; please have a look at perl #64326 , debian #522099


Resolution: none → fixed Status: new → closed