i had this incident where after a bunch of emoticons and i believe it was ascii chars as well (not sure and i cant reproduce myselve) crashed eggdrop let me post the crash error:
and the tcl code :[23:30:10] * Last context: tclhash.c/728 [Tcl proc: ::repeatf::repeatpubm, param: $_pubm1 $_pubm2 $_pubm3 $_pubm4 $_pubm5]
[23:30:10] * Please REPORT this BUG!
[23:30:10] * Check doc/BUG-REPORT on how to do so.
[23:30:10] * Wrote DEBUG
[23:30:10] * SEGMENT VIOLATION -- CRASHING!
Code: Select all
proc string2pattern {str} { regsub -all -- {(\[|\]|\\|\?|\*)} $str {\\\1} }
namespace eval ::repeatf {
variable following
variable repeatf
set repeatf(wmsg) "Warning: You've triggered %type repeating protection, stop repeating."
setudef str ap:repeatl
variable defrepeatl {2:5 60 k:kb 2}
bind ctcp - ACTION [namespace current]::anti_char-repeat:action
proc anti_char-repeat:action {n u h d k t} {
if {![string match "#*" $d] || [isbotnick $n]} { return 0 }
if {[isbotnick $d] || [isop $n $d] || [ishalfop $n $d] || [matchattr [nick2hand $n] ofn|ofn $d]} { return 0 }
regsub -all -- {[\001ACTION]} $t "" rtt
[namespace current]::repeatpubm $n $u $h $d $rtt
}
bind pubm - * [namespace current]::repeatpubm
proc repeatpubm {nick uhost hand chan text} {
if {[string index $text 0] eq "\001"} { return }
if {[isbotnick $chan] || [isop $nick $chan] || [ishalfop $nick $chan] || [matchattr [nick2hand $nick] ofn|ofn $chan]} { return 0 }
set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]
set length [regexp -all -- {[^\s]} $text ""]
if {($length < 50)} { return 0 }
set users [list]
set umasks [list]
variable repeatf
variable defrepeatl
if {[string is space [channel get $chan ap:repeatl]]} {channel set $chan ap:repeatl $defrepeatl}
foreach {off btime pmeth btype} [set cgot [split [channel get $chan ap:repeatl]]] {break}
foreach {o s} [cgsplit $off] {break}
if {![invalid:apf $o $s]} {
if {[set ts [follow $s rpt:[md5 [string tolower $uhost:$text:$chan]] $o]] != -1} {
set kmsg "$o repeats in $ts secs"
set wmsg [string map {%type text} $repeatf(wmsg)] ; set reptype repeatl
}
}
if {[info exists kmsg]} {
if {[isvoice $nick $chan]} { [namespace current]::devoice:checker $chan $nick }
regsub -all -- ~ $uhost "" uhost
if {[string match -nocase "*@*irccloud*" [maskhost $nick!$uhost 2]]} {
set ident [lindex [split $uhost @] 0]
set xbmaskx [string map {sid id uid id} $ident]
set bmask *!*[string tolower $xbmaskx ]@*
if {![ischanban $bmask $chan]} { pushmode $chan +b $bmask }
} else {
set bmask [maskhost $nick!$uhost 4]
if {![ischanban $bmask $chan]} { pushmode $chan +b $bmask }
}
putserv "kick $chan $nick «-Text-Repeat-»"
}
return 1
}
proc devoice:checker {chan nick} {
global anti-repeat
set chost [getchanhost ${nick} $chan]
set hozt [maskhost $chost 2]
if {![info exists anti-repeat($hozt)]} {
set anti-repeat($hozt) 1
if {[isvoice ${nick} $chan]} { pushmode $chan -v ${nick} }
utimer 5 [list unset -nocomplain ::anti-repeat($hozt)]
}
}
proc ZXtimed:banXZ {chan banmask} {
if {[ischanban $banmask $chan]} {
pushmode $chan -b $banmask
} else { return }
}
proc cgsplit off {
foreach {o s} [split $off :] {break}
expr {([info exists o]&&[info exists s])?[list $o $s]:{0 0}}
}
proc invalid:apf {o s} {
expr {![string is integer -strict $o] || $o <= 0 || ![string is double -strict $s] || $s <= 0}
}
proc follow {s fv pun {v 1} {ty 0}} {
variable following
if {![info exists following($fv)]} {
set o $v
set t [clock clicks -milliseconds]
} {
foreach {o t} $following($fv) {break}
incr o $v
}
if {[set z [expr {([clock clicks -milliseconds]-$t)/1000.}]] >= $s} {
set o $v
set t [clock clicks -milliseconds]
}
set following($fv) [list $o $t]
if {$o >= $pun} {if {!$ty} {followrem following($fv)} ; return [expr {$z>=$s?0.0:$z}]}
return -1
}
proc followrem fv {
upvar [namespace current]::$fv f
if {[info exists f]} {unset f}
}
}