[kaffe] assertion failed, kaffe-bin core dump

Godmar Back gback@stanford.edu
Thu, 29 Aug 2002 02:08:52 -0600 (MDT)


 
I think the assertion is bogus.

A thread could be on the read queue even though another
thread cleared the readsPending bit.  This can happen if both
threads read from the same fd and were awoken after a successful
read poll.  The first clears the bit, does another read, sets the
bit, blocks - meanwhile, the second returns, clears the bit - and
then handleIO happens.

Just remove the assertion - we don't use readsPending in the 
USE_POLL case.

Actually/alternatively... it should then probably be in blockOnFile:

    rc = suspendOnQThread(currentJThread, &readQ[fd], timeout);
    if (readQ[fd] == 0) {
	FD_CLR(fd, &readsPending);
    }

in which case the assertion would be good(!?)

Tim, what do you think?

	- Godmar

> 
> 
> --Q2l42ZpTeLjzDHJr
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
> 
> I'm running Kaffe 1.0.7 on OpenBSD 3.1 (i386).  I'm using it to run
> Freenet.  My Freenet node was running along happily for a few days,
> then it crashed this morning, with this message:
> 
> assertion "FD_ISSET(i, &readsPending)" failed: file "jthread.c", line 1748
> 
> It left a core file behind, with the following stack trace:
> 
> #0  0x400fa557 in kill ()
> #1  0x400fa468 in abort ()
> #2  0x400b5917 in __assert ()
> #3  0x40060fe5 in handleIO (sleep=3D1) at jthread.c:1748
> #4  0x40060e99 in reschedule () at jthread.c:1685
> #5  0x4005f94b in suspendOnQThread (jtid=3D0xcfa010, queue=3D0x1132b58, tim=
> eout=3D0)
>     at jthread.c:802
> #6  0x400616c8 in jcondvar_wait (cv=3D0x1132b58, lock=3D0x1132b50, timeout=
> =3D0)
>     at jthread.c:1988
> #7  0x4003d6f9 in _waitCond (lkp=3D0x36f54a4, timeout=3D0) at ksem.h:87
> #8  0x401555d6 in java_lang_Object_wait0 (o=3D0x36f54a0, timeout=3D0)
>     at Object.c:96
> #9  0x5ab43b in ?? ()
> #10 0x7e55a6 in ?? ()
> #11 0xa23f16 in ?? ()
> #12 0x222335 in ?? ()
> #13 0x7cb0b8 in ?? ()
> #14 0x40045196 in callMethodV (meth=3D0x6b2060, func=3D0x7cb010, obj=3D0x36=
> f54a0,=20
>     args=3D0xd01f94 "wZ\004@`", ret=3D0xd01bfc) at ../../config/i386/common=
> .h:38
> #15 0x40035dd9 in Kaffe_CallVoidMethodV (env=3D0x40071bf0, obj=3D0x36f54a0,=
> =20
>     meth=3D0x6b2060, args=3D0xd01f94 "wZ\004@`") at jni.c:1069
> #16 0x40035e48 in Kaffe_CallVoidMethod (env=3D0x40071bf0, obj=3D0x36f54a0,=
> =20
>     meth=3D0x6b2060) at jni.c:1083
> #17 0x40045fc3 in firstStartThread (arg=3D0x36f54a0) at thread.c:356
> #18 0x400604c4 in start_this_sucker_on_a_new_frame () at jthread.c:1252
> #19 0x400605e2 in jthread_create (pri=3D8700568,=20
>     func=3D0x400600ca <jthread_enable_stop+14>, daemon=3D1074200672, jlThre=
> ad=3D0x0,=20
>     threadStackSize=3D9239040) at jthread.c:1322
> 
> The actual command in my node's start script is:
> 
> nohup java freenet/node/Main &
> 
> --=20
> Greg Wooledge                  |   "Truth belongs to everybody."
> greg@wooledge.org              |    - The Red Hot Chili Peppers
> http://wooledge.org/~greg/     |
> 
> --Q2l42ZpTeLjzDHJr
> Content-Type: application/pgp-signature
> Content-Disposition: inline
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (OpenBSD)
> 
> iD8DBQE9bU4FkAkqAYpL9t8RAm8VAKCeCwscHtFPbrW9ortb5aKLW+4qOACgqGcy
> P6JH6GMyfE0gQd/lp9SYzGQ=
> =uBm0
> -----END PGP SIGNATURE-----
> 
> --Q2l42ZpTeLjzDHJr--
> 
> _______________________________________________
> kaffe mailing list
> kaffe@kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe
>