[Coldstuff] vm_task bug?

Brad Roberts coldstuff@cold.org
Thu, 28 Mar 2002 01:54:21 -0800 (PST)


Quick question, does this happen for any driver initiated method call or
just $sys.startup()?  $sys.startup() is a little special in that the
engine isn't fully up and running the main loop yet, so its going to have
trouble suspending.  I suspect you are right in that a driver initiated
task can't suspend at all.

While it'd be an unfortunatly limitation, do you need to do this for any
reason other than trying to track down some other potential bug?  Of hand,
I'm not sure there's a quick fix for letting them suspend.

I really want to really overhaul the vm system to make it cleaner, the
code is really a lot more complicated than it needs to be.  Maybe I can
address this problem then, but off the top of my head, driver method call
suspension would be tricky.  Not nearly as tricky as having a mechanism
for builtin's and native's calling back into an $object.method() call,
though.  I want that to be doable at some point also.  An example, and not
necessairily a great one (give me a break, its 2am), would be to have
tracebacks call $sys.traceback() or something along those lines.

Later,
Brad

On Thu, 28 Mar 2002, Allen Noe wrote:

> Date: Thu, 28 Mar 2002 03:31:44 -0600
> From: Allen Noe <cynewulf@usit.net>
> Reply-To: coldstuff@cold.org
> To: coldstuff@cold.org
> Subject: [Coldstuff] vm_task bug?
>
> I've been testing a few things, trying to find a bug that may be related to
> open_connection, and I stumbled on something that may be a bug in the way
> vm_task does its driver-method calls.
>
> Core:
>
> object $sys;
>
> public method .startup() {
>     arg @args;
>
>     dblog("startup tid=" + toliteral(task_id()));
>     open_connection("127.0.0.1", 42);
>     suspend();
>     dblog("done");
>     shutdown();
> };
>
> public method .failed() {
>     arg @args;
>
>     dblog("failed tid=" + toliteral(task_id()));
>     dblog("failed: " + toliteral(args));
>     resume(args[1]);
>     dblog("out of resume");
> };
>
> Output:
>
> [...]
> Calling $sys.startup([])...
> startup tid=1
> failed tid=1
> failed: [1, ~refused]
> out of resume
>
> And it hangs here until I kill it. I traced genesis with gdb and it looks like
> vm_resume is noticing that task_id is the same as the TID it's being asked to
> resume, and just returns. The startup task just sits suspended forever.
>
> So I looked around the code a little, and copied the task_id = next_task_id++;
> line in vm_task() up to just after the first if, ran it again, and got this
> output:
>
> [...]
> Calling $sys.startup([])...
> startup tid=1
> failed tid=3
> failed: [1, ~refused]
> done
> out of resume
>
> This time it shuts down. So is this a bug? If it is, what would the best way to
> fix it be?
> _______________________________________________
> Cold-Coldstuff mailing list
> Cold-Coldstuff@cold.org
> http://web.cold.org/mailman/listinfo/cold-coldstuff
>