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.

Stats.mod Crashing Error

Discussion of Eggdrop's code and module programming in C.
Post Reply
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Stats.mod Crashing Error

Post by Weirdo »

Hi,

Using eggdrop 1.6.17 and using Stats.mod 1.3 (not touched the new one yet).

Found an error, which crashes the bot completely.

.schannel <channel>

If i put a channel in, it dies horribly.

this is the error recorded in debug mode:
[14:17] tcl: builtin dcc call: *dcc:schannel Weirdo 13 ##uno##
[14:17] #Weirdo# (#catgirls) schannel ##uno##
[14:17] * Last context: stats:userrec.c/535 []
[14:17] * Please REPORT this BUG!
[14:17] * Check doc/BUG-REPORT on how to do so.
[14:17] * Wrote DEBUG
[14:17] * BUS ERROR -- CRASHING!
Bus error (core dumped)

Debug file
Debug (eggdrop v1.6.17) written Tue Jan 3 14:17:50 2006
Full Patch List:
Tcl library: /usr/local/lib/tcl8.4
Tcl version: 8.4.7 (header version 8.3.5)
Compile flags: gcc -pipe -g -O2 -Wall -I.. -I.. -DHAVE_CONFIG_H
Link flags: gcc -pipe
Strip flags: touch
Context: tclhash.c/688, []
tclhash.c/680, []
tclhash.c/684, [Tcl proc: *raw:irc:msg, param: $_raw1 $_raw2 $_raw3]
tclhash.c/680, []
tclhash.c/684, [Tcl proc: *pubm:stat, param: $_pubm1 $_pubm2 $_pubm3 $_pubm4 $_pubm5]
stats:userrec.c/29, []
stats:datahandling.c/1004, []
tclhash.c/688, []
tclhash.c/688, []
tclhash.c/680, []
tclhash.c/684, [Tcl proc: *raw:PRIVMSG, param: $_raw1 $_raw2 $_raw3]
tclhash.c/688, []
tclhash.c/680, []
tclhash.c/684, [Tcl proc: *dcc:schannel, param: $_dcc1 $_dcc2 $_dcc3]
stats:dcccmds.c/166, []
stats:userrec.c/535 []

SOCK ADDR PORT NICK HOST TYPE
---- -------- ----- --------- ----------------- ----
3 C3F2D525 1600 (telnet) * lstn 1600
4 00000000 0 (dns) dns (ready)
6 DEADF00D 4060 livestats * lstn port
9 550DFB12 6667 (server) irc.rizon.net serv (lag: 0)
13 5164F250 64443 Weirdo broadband.ntl.com chat flags: cpTep/0

Compiled without extensive memory debugging (sorry).
Open sockets: 3 (listen), 4 (passed on), 6 (listen), 9, 13, 14 (file), done.
Furthermore, its occuring only on commands in channels where stats is monitored, but not outputted. IE no !stat or livestats. I am thinking it may be data corruption.

thanks,
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you might want to report this to the author, although I don't believe this thing is still being developed
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

What seems to have fixed it is a stats reset.

Looks like it must have been caused by a dead or corrupted file. Ill pass it on.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Strange thing. I checked the source code of the function, but the only thing the looked suspincious could not be confirmed by me (stats usernames bigger than HANDLEN, because it might have been lead to set a negative array element).

Code: Select all

static int cmd_schannel(struct userrec *u, int idx, char *par)
{
  char *chname, spaces[50], *user, ubuf[2];
  struct stats_chanset *chan;
  struct stats_memberlist *m;
  int len = 0;

  
  ubuf[0] = '*';
  ubuf[1] = 0;
#if EGG_IS_MIN_VER(10500)
  len = nick_len;
#else
  len = NICKLEN;
#endif
  chname = newsplit(&par);
  putlog(LOG_CMDS, "*", "#%s# (%s) schannel %s", dcc[idx].nick,
	 dcc[idx].u.chat->con_chan, chname);
  if (!chname[0])
    chname = dcc[idx].u.chat->con_chan;
  chan = findschan(chname);
  if (!chan) {
    if (!findchan_by_dname(chname))
      dprintf(idx, "Invalid channel: %s\n", chname);
    else
      dprintf(idx, "Channel %s is inactive\n", chname);
    return 0;
  }
  dprintf(idx, "%d users on channel:\n", countmembers(chan->members));
  sprintf(spaces, "                                                ");
  spaces[len - 4] = 0;
  dprintf(idx, "NICK%s", spaces);
  spaces[len - 4] = ' ';
  spaces[HANDLEN - 4] = 0;
  dprintf(idx, "  USER%s", spaces);
  dprintf(idx, "  UHOST\n");
  spaces[HANDLEN - 4] = ' ';
  for (m = chan->members; m; m = m->next) {
    if (m->user)
      user = m->user->user;
    else
      user = ubuf;
    spaces[len - strlen(m->nick)] = 0;
    dprintf(idx, "%s%s", m->nick, spaces);
    spaces[len - strlen(m->nick)] = ' ';
    spaces[HANDLEN - strlen(user)] = 0;
    dprintf(idx, "  %s%s", user, spaces);
    spaces[HANDLEN - strlen(user)] = ' ';
    dprintf(idx, "  %s\n", m->uhost);
  }
  
  return 0;
}
I am too lazy to unbind channels from !stats and livestats just to confirm if it is really because of such a silly thing.

Just to make sure... you are taking about stats.mod 1.3.3dev1 ?!
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

No, using the 1.3 version that comes with Eggdrop 1.6.16 (I didnt like all the new fangled features of the newest release).

If it helps, handlen is set to 30 on my bot. Edited the eggdrop.h to allow long handle lengths before compiling.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

There is no stats.mod provided with any official eggdrop versions. So any package including stats.mod HAS been modified :).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

Mmmm,

Perhaps its one i downloaded a long long long time ago and just kept?

Which, is also highly likely.

Its reported in the bot as Version 1.3, however, on examination of the files i used to compile her with, it IS 1.3.3 Dev1 it seems.

Sorry for the confusion.
Post Reply