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.

Bogustrivia issues with Eggdrop 1.6.21

Support & discussion of released scripts, and announcements of new releases.
User avatar
starr
Voice
Posts: 26
Joined: Sun Mar 18, 2007 1:18 am
Location: Tennessee
Contact:

Bogustrivia issues with Eggdrop 1.6.21

Post by starr »

It has recently come to our attention that users are seeing timer errors when running Bogustrivia on Eggdrop 1.6.21.
[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
R
Rynet
Voice
Posts: 4
Joined: Tue Jun 12, 2007 3:24 pm

Post by Rynet »

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
a
aditaa
Voice
Posts: 1
Joined: Wed Jan 25, 2012 4:42 pm
Location: texas
Contact:

i am getting the same thing

Post by aditaa »

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

Code: Select all

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
f
frustro
Voice
Posts: 3
Joined: Sat Dec 11, 2010 6:09 pm

get the error as we..

Post by frustro »

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
a
achilles1900
Voice
Posts: 30
Joined: Mon Apr 21, 2008 5:40 am

Post by achilles1900 »

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
f
frustro
Voice
Posts: 3
Joined: Sat Dec 11, 2010 6:09 pm

same problem, different script.

Post by frustro »

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
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: same problem, different script.

Post by speechles »

Code: Select all

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
  • 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.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

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

Code: Select all

proc TChkDed {} { global t2 ;
 if {$t2(-ison) == "0"} {  return 0  }

Code: Select all

  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: Select all

  if {[info exists t2(-aoff)]} {  catch  { unset t2(-aoff) t2(-als) t2(-lastank) t2(-lastaut)  } }
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

BogusTrivia issues with Eggdrop 1.6.21 Update

Post by SpiKe^^ »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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: Select all

  /* 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: Select all

  /* 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
t
thommey
Halfop
Posts: 76
Joined: Tue Apr 01, 2008 2:59 pm

Post by thommey »

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: Select all

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)
User avatar
starr
Voice
Posts: 26
Joined: Sun Mar 18, 2007 1:18 am
Location: Tennessee
Contact:

Post by starr »

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.
Post Reply