[OpenAFS-devel] kauth broken - problem with IOMGR in lwp?

Ben Huntsman ben@huntsmans.net
Mon, 11 Nov 2024 20:26:59 +0000


--_000_BYAPR07MB5879E2CED4267CE6EB6DA8E8A7582BYAPR07MB5879namp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi everyone-
   First of all, please don't laugh, but I do have an older test cell that =
runs kauth instead of krb5.  This is at home, not for anything production, =
so don't worry.

   That being said, is kauth currently broken?  A colleague of mine tried i=
t on Linux and gets a segfault when running klog, and I get the same behavi=
or on AIX:

$ dbx /usr/afs/bin/klog core
Type 'help' for help.
[using memory image in core]
reading symbolic information ...

Segmentation fault in unnamed block in IOMGR at line 362 in file "iomgr.c"
  362           FD_ZERO(&IOMGR_writefds);
(dbx) where
libdebug assertion "(framep->getGpr(STKP, &addr) =3D=3D DB_SUCCESS && *next=
Stkpp =3D=3D addr)" failed at line 1418 in file ../../../../../../../../../=
../../src/bos/usr/ccs/lib/libdbx/libdebug/modules/stackdebug/POWER/stackdb_=
FrameProgress.C
unnamed block in IOMGR(dummy =3D (nil)), line 362 in "iomgr.c"
(dbx)

And here's a blurb from around that line in src/lwp/iomgr.c:
...
/* These are not declared in IOMGR so that they don't use up 6K of stack. *=
/
static fd_set IOMGR_readfds, IOMGR_writefds, IOMGR_exceptfds;
static int IOMGR_nfds =3D 0;

static void *IOMGR(void *dummy)
{
    for (;;) {
        int code;
        struct TM_Elem *earliest;
        struct timeval timeout, junk;
        bool woke_someone;

        FD_ZERO(&IOMGR_readfds);
        FD_ZERO(&IOMGR_writefds);
        FD_ZERO(&IOMGR_exceptfds);
        IOMGR_nfds =3D 0;
...


   I did the compile with the ./configure --enable-debug and -enable-debug-=
lwp options specified.  Can someone help explain how this code works, and w=
hat might done to fix it?  I'm a little fuzzy on the *IOMGR piece and I don=
't see that anyone calls IOMGR() directly in the code...

Thank you!

-Ben


--_000_BYAPR07MB5879E2CED4267CE6EB6DA8E8A7582BYAPR07MB5879namp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Hi everyone-</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
&nbsp; &nbsp;First of all, please don't laugh, but I do have an older test =
cell that runs kauth instead of krb5.&nbsp; This is at home, not for anythi=
ng production, so don't worry.</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
&nbsp; &nbsp;That being said, is kauth currently broken?&nbsp; A colleague =
of mine tried it on Linux and gets a segfault when running klog, and I get =
the same behavior on AIX:</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
$ dbx /usr/afs/bin/klog core</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
Type 'help' for help.</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[using memory image in core]</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
reading symbolic information ...</div>
<div style=3D"line-height: normal; margin: 0px; min-height: 13px; font-fami=
ly: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
Segmentation fault in unnamed block in IOMGR at line 362 in file &quot;iomg=
r.c&quot;</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; 362 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FD_ZERO(&amp;IOMGR_writefds);=
</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
(dbx) where</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
libdebug assertion &quot;(framep-&gt;getGpr(STKP, &amp;addr) =3D=3D DB_SUCC=
ESS &amp;&amp; *nextStkpp =3D=3D addr)&quot; failed at line 1418 in file ..=
/../../../../../../../../../../src/bos/usr/ccs/lib/libdbx/libdebug/modules/=
stackdebug/POWER/stackdb_FrameProgress.C</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
unnamed block in IOMGR(dummy =3D (nil)), line 362 in &quot;iomgr.c&quot;</d=
iv>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
(dbx)&nbsp;</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And here's a blurb from around that line in src/lwp/iomgr.c:</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
...</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/* These are not declared in IOMGR so that they don't use up 6K of stack. *=
/</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
static fd_set IOMGR_readfds, IOMGR_writefds, IOMGR_exceptfds;</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
static int IOMGR_nfds =3D 0;</div>
<div style=3D"line-height: normal; margin: 0px; min-height: 13px; font-fami=
ly: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
static void *IOMGR(void *dummy)</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
{</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; for (;;) {</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; &nbsp; int code;</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; &nbsp; struct TM_Elem *earliest;</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; &nbsp; struct timeval timeout, junk;</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; &nbsp; bool woke_someone;</div>
<div style=3D"line-height: normal; margin: 0px; min-height: 13px; font-fami=
ly: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; &nbsp; FD_ZERO(&amp;IOMGR_readfds);</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; &nbsp; FD_ZERO(&amp;IOMGR_writefds);</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; &nbsp; FD_ZERO(&amp;IOMGR_exceptfds);</div>
<div style=3D"line-height: normal; margin: 0px; font-family: Aptos, Aptos_E=
mbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
&nbsp; &nbsp; &nbsp; &nbsp; IOMGR_nfds =3D 0;</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; mi=
n-height: 13px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService=
, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
...</div>
<div class=3D"elementToProof" style=3D"line-height: normal; margin: 0px; fo=
nt-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helveti=
ca, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
&nbsp; &nbsp;I did the compile with the ./configure --enable-debug and -ena=
ble-debug-lwp options specified.&nbsp; Can someone help explain how this co=
de works, and what might done to fix it?&nbsp; I'm a little fuzzy on the *I=
OMGR piece and I don't see that anyone calls IOMGR()
 directly in the code...</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
Thank you!</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
-Ben</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
</body>
</html>

--_000_BYAPR07MB5879E2CED4267CE6EB6DA8E8A7582BYAPR07MB5879namp_--