This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Crash!

General support and discussion of Eggdrop bots.
Post Reply
Online
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Crash!

Post by simo »

greetz folkz,

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:
[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!
and the tcl code :

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}
	}
}

User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

And why don't you add the bug report as instructed by the message?
Once the game is over, the king and the pawn go back in the same box.
Online
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

Thanks for the reply Caesar Let me try that.
User avatar
NewzNZ
Halfop
Posts: 68
Joined: Thu Mar 05, 2009 5:15 am
Contact:

Post by NewzNZ »

...had the same crash today...have logged it as per the report message.
Post Reply