egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Crash!

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop Help
View previous topic :: View next topic  
Author Message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Mon May 22, 2023 3:45 pm    Post subject: Crash! Reply with quote

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:

Quote:

[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:


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

Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3767
Location: Mint Factory

PostPosted: Tue May 23, 2023 12:18 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Tue May 23, 2023 6:45 pm    Post subject: Reply with quote

Thanks for the reply Caesar Let me try that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber