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 

Bogustrivia issues with Eggdrop 1.6.21
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
starr
Voice


Joined: 18 Mar 2007
Posts: 26
Location: Tennessee

PostPosted: Fri Dec 16, 2011 10:19 am    Post subject: Bogustrivia issues with Eggdrop 1.6.21 Reply with quote

It has recently come to our attention that users are seeing timer errors when running Bogustrivia on Eggdrop 1.6.21.
Quote:

[07:52] <User> [10:06:30] <bot> [10:07:08] Tcl error in script for 'timer66':
[07:52] <User> [10:06:30] <bot> [10:07:08] no such binding
[07:52] <User> [10:06:42] <bot> [10:07:20] Tcl error in script for 'timer71':
[07:52] <User> [10:06:42] <bot> [10:07:20] can not find channel named "file9"
[07:52] <User> [10:07:11] <bot> [10:07:50] Tcl error in script for 'timer75':
[10:16:29] <bot> [10:17:07] Tcl error in script for 'timer127':
[07:55] <User> [10:16:29] <bot> [10:17:07] can't read "t2(-ison)": no such variable

We are looking into this error but quite frankly not sure where to start.

Far as I can tell this is only happening on the eggdrop 1.6.21

If you get errors please post them here so we can track down and patch the script asap, and if any of you have an idea where the error could be orginating from all help is welcome.

At this time the work around would be to run Bogustrivia on eggdrop 1.6.15-1.6.20

We'll keep ya posted.

Thanks
_________________
Starr
www.dcs-computer-services.net
Back to top
View user's profile Send private message Visit poster's website
Rynet
Voice


Joined: 12 Jun 2007
Posts: 4

PostPosted: Wed Dec 28, 2011 10:50 pm    Post subject: Reply with quote

perhaps it has something to do with how they changed malloc to work.. in .21 they fixed something that we had to use a workout for.

export MALLOC_CHECK_=4
Back to top
View user's profile Send private message
aditaa
Voice


Joined: 25 Jan 2012
Posts: 1
Location: texas

PostPosted: Wed Jan 25, 2012 4:44 pm    Post subject: i am getting the same thing Reply with quote

i am getting the same thing please let my know any information that i can provide to help with this issue

Code:
root@server-31315:/eggdrop# tail -25  logs/eggdrop.log
[20:34:02] Tcl error in script for 'timer3919':
[20:34:02] no such binding
[20:34:32] Tcl error in script for 'timer3921':
[20:34:32] no such binding
[20:35:02] Tcl error in script for 'timer3923':
[20:35:02] no such binding
[20:35:32] Tcl error in script for 'timer3925':
[20:35:32] no such binding
[20:36:03] Tcl error in script for 'timer3927':
[20:36:03] no such binding
[20:36:33] Tcl error in script for 'timer3929':
[20:36:33] no such binding
[20:37:04] Tcl error in script for 'timer3931':
[20:37:04] no such binding
[20:37:34] Tcl error in script for 'timer3933':
[20:37:34] no such binding
[20:38:03] #aditaa# help
[20:38:04] Tcl error in script for 'timer3935':
[20:38:04] no such binding
[20:38:34] Tcl error in script for 'timer3937':
[20:38:34] no such binding
[20:39:04] Tcl error in script for 'timer3939':
[20:39:04] no such binding
[20:39:34] Tcl error in script for 'timer3941':
[20:39:34] no such binding
Back to top
View user's profile Send private message Visit poster's website
frustro
Voice


Joined: 11 Dec 2010
Posts: 3

PostPosted: Sun Feb 12, 2012 10:01 pm    Post subject: get the error as we.. Reply with quote

Eggdrop v1.6.21 (C) 1997 Robey Pointer (C) 2011 Eggheads
[18:26:23] --- Loading eggdrop v1.6.21 (Sun Feb 12 2012)

nookster> [01:00:16] Tcl error [TJoin]: can't read "t2(-als)": no such element in array
<nookster> [01:04:07] Tcl error in script for 'timer21':
<nookster> [01:04:07] can't read "t2(-ison)": no such variable
Back to top
View user's profile Send private message
achilles1900
Voice


Joined: 21 Apr 2008
Posts: 30

PostPosted: Sun Feb 26, 2012 10:31 am    Post subject: Reply with quote

Hi everyone,

im getting these issues too. Definitely an 1.6.21 issue, its happening on two bots i have on 2 different servers, running 1.6.21 and the BogusTrivia 2.06.4.4 by SpiKe^^.

What happens is the questions and answers and hints gets mixed up and the trivia basically goes haywire. Stopping and restarting doesnt help. We stop it and try to run it about an hour later and its fine again. But this error keeps cropping up.

Thanks for looking into it guys, find below the error.

Achilles

[19:29:07] Tcl error in script for 'timer12179':
[19:29:07] can't read "t2(-ison)": no such variable
[20:53:07] Tcl error in script for 'timer12224':
[20:53:07] can't read "t2(-ison)": no such variable
Back to top
View user's profile Send private message
frustro
Voice


Joined: 11 Dec 2010
Posts: 3

PostPosted: Thu Mar 01, 2012 1:27 pm    Post subject: same problem, different script. Reply with quote

Not sure where I should put this, OP, please move if you need to, placed it here because it seems to be related more to timer in eggdrop than script, but that's just my naive interpretation.

Using the !quick from lolstoolz. this uses a timer for 7 seconds on the ban before removal.

From Channel:
<frustro> !quick nook-test
* nookster sets ban on *!*4329244c@gateway/web/freenode/ip.67.41.36.76
* nookster has kicked nook-test from #nook-tablet (frustro: requested)

From Partyline:

[16:55:26] #nook-tablet: mode change '+b *!*4329244c@gateway/web/freenode/ip.67.41.36.76' by nookster!~eggdrop@unaffiliated/frustro/bot/nookster
[16:55:26] nook-test kicked from #nook-tablet by nookster: frustro: requested
[16:55:31] Tcl error in script for 'timer220':
[16:55:31] invalid command name "if{1}"
,#nook-tablet Cannot join channel (+b) - you are banned
-frustro-> #nook-tablet Cannot join channel (+b) - you are banned
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Mar 08, 2012 4:41 pm    Post subject: Re: same problem, different script. Reply with quote

Code:
if { $command == "quick" } { utimer 7 "lol_deban $chan $banmask" }
...
utimer 10 "*dcc:channel $hand $idx $chan"
utimer 15 "lol_partchan $hand $idx $chan"
utimer 20 {   puthelp "AWAY :$lol(away)" }


All of these are incorrect methods to do what it is doing. It is not protecting from substitution except on the very last. And the very last does it so clumsily. wow...

utimer 7 [list lol_deban $chan $banmask]

Any that are not constructed within the [list] command and not within bracings { } will create wild unexpected effects at times depending on eggdrop version. The strictness of the interpreter when doing evaluations/substitution. Extra functions added requires new "strictness" so of course this happens naturally. Some scripts start to show their "age" and this is the case in both scenarios. They were not written future proof and somewhere forgot the basic concepts of tcl's golden rules found HERE. This will continue to happen until this is driven into people's heads with a nail.

Golden rules of tcl - read the timer section specifically......
http://www.peterre.info/characters.html

A fool and his channel are soon parted. Beware the ides of march. LolsToolz can be exploited to takeover eggdrop. Gain ownership of any channel, etc... Think before you act next time.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Mar 08, 2012 5:09 pm    Post subject: Reply with quote

Code:
proc TChkDed {} {
 if {$t2(-ison) == "0"} {  return 0  }

causes "can't read "t2(-ison)": no such variable".
change to below:
Code:
proc TChkDed {} { global t2 ;
 if {$t2(-ison) == "0"} {  return 0  }


Code:
  if {[info exists t2(-aoff)]} {  unset t2(-aoff) t2(-als) t2(-lastank) t2(-lastaut)  }

causes "can't read "t2(-als)": no such variable"
change to below:
Code:
  if {[info exists t2(-aoff)]} {  catch  { unset t2(-aoff) t2(-als) t2(-lastank) t2(-lastaut)  } }

_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
SpiKe^^
Master


Joined: 12 May 2006
Posts: 481
Location: Tennessee, USA

PostPosted: Sun Apr 29, 2012 5:32 pm    Post subject: BogusTrivia issues with Eggdrop 1.6.21 Update Reply with quote

Both of the above BogusTrivia patches will remove those errors, but Not the root cause of the errors (and many others). Stopping the errors from showing will Not allow BogusTrivia to run on Eggdrop 1.6.21 !

All of these errors are caused by a bug with the utimers command on Eggdrop 1.6.21 . We have reported this bug to the current Eggdrop team and were assured they would track it down as soon as possible. There is nothing I can do to work around this Eggdrop bug.

This same Eggdrop bug will also explain why the rest of your timer driven scripts are also not running so well.

At this time the work around would be to run BogusTrivia on Eggdrop 1.6.15-1.6.20

Thanks,

SpiKe^^
mytclscripts.com
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2825

PostPosted: Tue May 01, 2012 3:48 pm    Post subject: Reply with quote

I did some digging and testing of the code, since the actual timer-code hasn't been touched much since 1.6.20...

What I've noticed, is that on some occasions timers for TShoTrv2 and TShoTriv are started multiple times, breaking the scripts state-machine. All the different errors seen on the console are results of the environment no longer being what the script expected.

In defense of speechles, the TChkDed-patch is a perfectly valid bugfix. Also, that is not a "timer-bug", it's merely faulty code called by a timer...
As for the other fix, can't tell there as I really can't follow your code in it's current layout.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
SpiKe^^
Master


Joined: 12 May 2006
Posts: 481
Location: Tennessee, USA

PostPosted: Fri May 04, 2012 8:20 pm    Post subject: Reply with quote

Dismissing the bug as not an Eggdrop bug, does not fix the Eggdrop bug. All this same code is very stable on all versions of Eggdrop 1.6.15 - 1.6.20 , nothing at all has changed with the BogusTrivia code.

The issue comes down the the [utimers] command, and the fact you can no longer rely on its return being a complete list of running timers.

So, when someone gets an answer, Bogus needs to kill the running game timer, in order to start the timer to the next question. Bogus asks for a utimers list to see if the timer is still running, but occasionally the utimers list is empty and Bogus doesn't kill the timer because Eggdrop says it's not still running. BogusTrivia then sets the new timer to call the next question. Then the original game timer that Eggdrop assured me was not running, lands shortly after that, and we have a double game timer loop.

No script with timers can stand for that. After the double timer loop starts, the list of possible errors is huge. It's not a Bogus issue, Eggdrop did not return the timer in the utimers list, and Bogus won't kill a timer that's not running, that would return an error. But the timer clearly is running because just after i'm told it doesn't exist, the darn thing lands, and the whole thing falls apart.

We can all deny that it's an Eggdrop bug, but that wont fix the current Eggdrop issue with the utimers command.

SpiKe^^
mytclscripts.com
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2825

PostPosted: Sat May 05, 2012 4:18 am    Post subject: Reply with quote

Apart from the TChkDed bug, I'm not dismissing changes in 1.6.21 as the source. I'm sorry if I made you believe otherwise.
That said, I must admit I've read these posts as an issue with the utimer command, not utimers, My bad.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2825

PostPosted: Sat May 05, 2012 4:54 pm    Post subject: Reply with quote

Was a little bit bored, and dug further..
The issue lies with how timers use the new event notifier. Much simplified, timers (and utimers) are removed as their payload (the tcl code) is added to the event-list, not when the payload is finally executed. Between these two points in code execution, all checks for incoming network traffic is done (which in the end results in pubm bindings among others being checked and triggered).

A quick-fix could be to simply move the call_hook(SECONDLY) call to the end of mainloop, though I havn't investigated this solution that througout yet (might just cause other, more sever problems), so be cautious if you attempt this bugfix! Also, this fix will not allow multiple timers triggering at the same time to see other timers expiring at the same time, regardless of order.

Around main.c:743 you'll find these five lines of code:
Code:
  /* Once a second */
  if (now != then) {
    call_hook(HOOK_SECONDLY);
    then = now;
  }


They should be moved to the end of the same function, just before we parse the event-list at arund main.c:908
Code:
  /* Once a second */
  if (now != then) {
    call_hook(HOOK_SECONDLY);
    then = now;
  }

#ifdef USE_TCL_EVENTS
  if (!eggbusy) {
/* Process all pending tcl events */

#  ifdef REPLACE_NOTIFIER
    tclevent_t *e;
    if (Tcl_ServiceAll())
      tclbusy = 1;
    while (tclevents) {
      e = tclevents;
      tclevents = tclevents->next;
      tclbusy = 1;
      do_tcl_sync(e->context, e->script, e->callback, 1);
      nfree(e);
    }
#  else
    while (Tcl_DoOneEvent(TCL_DONT_WAIT | TCL_ALL_EVENTS))
      tclbusy = 1;
#  endif /* REPLACE_NOTIFIER */

#endif   /* USE_TCL_EVENTS   */
  }

  return (eggbusy || tclbusy);
}

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
thommey
Halfop


Joined: 01 Apr 2008
Posts: 68

PostPosted: Sun May 06, 2012 7:52 am    Post subject: Reply with quote

Great job at tracking down the bug. What nml375 said is exactly what's happening.

I'd propose this workaround (which basically reverts the change introducing the bug):

Code:

diff -urN eggdrop1.6.21/src/tcl.c eggdrop1.6.21.timerworkaround/src/tcl.c
--- eggdrop1.6.21/src/tcl.c 2012-05-06 13:19:13.209758240 +0200
+++ eggdrop1.6.21.timerworkaround/src/tcl.c 2012-05-06 13:23:36.985752474 +0200
@@ -611,7 +611,7 @@
  * where it's safe to recurse eventually (vwait/update).
  */
 void do_tcl(char *context, char *script) {
-  do_tcl_async(context, script, bgtclcallback);
+  do_tcl_sync(context, script, bgtclcallback, 0);
 }
 
 /* Evaluates Tcl code.


You can change that one line manually or use it as a patch file before compiling.

(The changes introducing the bug were made to fix another bug that was fixed by other means later, so there should be no downside to using this)
Back to top
View user's profile Send private message
starr
Voice


Joined: 18 Mar 2007
Posts: 26
Location: Tennessee

PostPosted: Sun May 06, 2012 9:58 am    Post subject: Reply with quote

I'd really like to try this fix, however I do not write code I'm more of the tester in this team.

I have no idea where to enter this fix in the main.c file. If you could give me a better idea of where to put it and what if any lines will be replaced I'd be glad to test this workaround.
_________________
Starr
www.dcs-computer-services.net
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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