Re: birthdaylist.js
By: DesotoFireflite to Digital Man on Wed May 18 2022 12:09 pm
> Re: birthdaylist.js
> By: Digital Man to DesotoFireflite on Tue May 17 2022 02:51 pm
>
> DM> Re: birthdaylist.js
> DM> By: DesotoFireflite to Digital Man on Tue May 17 2022 04:15 pm
>
> > > DM>>> No immediate ideas. I probably start adding log() lines to
> > > DM>>> exec/birthdaylist.js and load/birthdays.js to find out exactly
> > > DM>>> where is locking or infinite-looping (more likely).
>
> > DM>> Okay, here's an example (to birthdaylist.js):
>
> > DM>> log("Loading birthdays.js"); // added
> > DM>> var list = load({}, "birthdays.js", month, day);
> > DM>> log("Loaded birthdays.js"); // added
>
> > DM>> So when run 'jsexec birthdaylist' here with those added log lines:
>
> > DM>> Reading script from /sbbs/exec/birthdaylist.js
> > DM>> /sbbs/exec/birthdaylist.js compiled in 0.00 seconds
> > DM>> Loading birthdays.js
> > DM>> Loaded birthdays.js
> > DM>> 45 Vertrauen users with birthdays in May:
>
> >> Ok, i put the log lines in as you suggested, and the problem seems to
> >> be in birthdays.js, as it tries to load birthdays.js then it locks up.
> >> see log output below. It never got to the second part.
>
> >> 5/17 03:47:39p Node 1 <DesotoFireflite> Executing external:
> >> ?birthdaylist
> >> 5/17 03:47:39p Node 1 <DesotoFireflite> Loading birthdays.js
>
> >> Seeing this, I tried to jsexec c:\sbbs\exec\load\birthdays.js, and it
> >> did the same thing, locked up, curser sits and spins.
>
> DM> Okay, but with birthdays.js runs correct, it's not going to display
> DM> anything to the console either. Best to just continue testing by
> DM> invoking birthdaylist.js.
>
> >> I just don't understand why the program worked flawlessley for months
> >> on end, then stops on the 12th with a new user logs in. Also, I
> >> checked, windows did an update late on the 12th also, just discovered
> >> this today.
>
> >> As always, thanks
>
> DM> The next step is to add some log() lines to load/birthdays.js and let
> DM> me know what's displayed before the hang:
>
> DM> function birthdays(month, day)
> DM> {
> DM> var u = new User;
> DM> log("getting total_users"); // added
> DM> var lastuser = system.stats.total_users;
> DM> log("got total_users: " + lastuser); // added
> DM> var list = [];
> DM> month = parseInt(month, 10) + 1;
> DM> for(u.number = 1; u.number <= lastuser; u.number++) {
> DM> if(u.settings&(USER_DELETED|USER_INACTIVE))
> DM> continue;
> DM> if(u.security.restrictions&(UFLAG_Q|UFLAG_G))
> DM> continue;
> DM> if(u.birthmonth != month)
> DM> continue;
> DM> if(day && u.birthday != day)
> DM> continue;
> DM> log("Adding to list: " + u.number); // added
> DM> list.push(u.number);
> DM> }
> DM> return list;
> DM> }
>
> Heres what I get: I think we found the infinate loop you were talking
> about (big sigh)
>
> 5/18 11:51:23a Node 1 <DesotoFireflite> Loading birthdays.js
> 5/18 11:51:23a Node 1 <DesotoFireflite> getting total_users
> 5/18 11:51:23a Node 1 <DesotoFireflite> got total_users: 286
>
> This section below keeps repeating over and over the same thing till I shut
> down the system. It won't let me exit.
>
> 5/18 11:51:23a Node 2 <DesotoFireflite> Adding to list: 249
> 5/18 11:51:23a Node 2 <DesotoFireflite> Adding to list: 265
> 5/18 11:51:23a Node 2 <DesotoFireflite> Adding to list: 270
> 5/18 11:51:23a Node 2 <DesotoFireflite> Adding to list: 12
Okay, so it climbs to 270 and then jumps back down to 12? That definitely sounds
like a bug.
Do you mind sending me (ftp or email) your system's user.dat file so I can repro
duce and fix the issue? I'll delete it when I'm done. If you're not okay with th
at, then we can try to work out some other ways of debugging this, but I definit
ely would like to root-cause and fix it.
--
digital man (rob)
Synchronet "Real Fact" #15:
SBBSecho was introduced (replacing SBBSFIDO) for Synchronet v2 in 1994
Norco, CA WX: 69.0°F, 67.0% humidity, 3 mph E wind, 0.00 inches rain/24hrs
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
|