[OpenAFS-devel] Re: kauth broken - problem with IOMGR in lwp?
Ben Huntsman
ben@huntsmans.net
Tue, 12 Nov 2024 01:58:51 +0000
--_000_BYAPR07MB587991B3CF7CF2A90C1D452CA7592BYAPR07MB5879namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
In continuing to research this, I see there's a lot of interesting code in =
lwp that can be enabled by defining DEBUG. So just to give it a whirl, I a=
dded a line to lwp.h:
#define DEBUG 1
And recompiled just lwp and kauth. Now the resulting klog works. Very biz=
arre... I'm not sure what to make of it yet.
-Ben
________________________________
From: openafs-devel-admin@openafs.org <openafs-devel-admin@openafs.org> on =
behalf of Ben Huntsman <ben@huntsmans.net>
Sent: Monday, November 11, 2024 12:26 PM
To: openafs-devel@openafs.org <openafs-devel@openafs.org>
Subject: [OpenAFS-devel] kauth broken - problem with IOMGR in lwp?
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_BYAPR07MB587991B3CF7CF2A90C1D452CA7592BYAPR07MB5879namp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<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);">
In continuing to research this, I see there's a lot of interesting code in =
lwp that can be enabled by defining DEBUG. So just to give it a whirl=
, I added a line to lwp.h:</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);">
#define DEBUG 1</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);">
And recompiled just lwp and kauth. Now the resulting klog works. =
; Very bizarre... I'm not sure what to make of it yet.</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>
<div id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> openafs-devel-admin@o=
penafs.org <openafs-devel-admin@openafs.org> on behalf of Ben Huntsma=
n <ben@huntsmans.net><br>
<b>Sent:</b> Monday, November 11, 2024 12:26 PM<br>
<b>To:</b> openafs-devel@openafs.org <openafs-devel@openafs.org><br>
<b>Subject:</b> [OpenAFS-devel] kauth broken - problem with IOMGR in lwp?</=
font>
<div> </div>
</div>
<style type=3D"text/css" style=3D"display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir=3D"ltr">
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
Hi everyone-</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
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 anythi=
ng production, so don't worry.</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
That being said, is kauth currently broken? 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"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"line-height:normal; margin:0px; fo=
nt-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sa=
ns-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_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
Type 'help' for help.</div>
<div class=3D"x_elementToProof" style=3D"line-height:normal; margin:0px; fo=
nt-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sa=
ns-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_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
reading symbolic information ...</div>
<div style=3D"line-height:normal; margin:0px; min-height:13px; font-family:=
Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; =
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
Segmentation fault in unnamed block in IOMGR at line 362 in file "iomg=
r.c"</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
362 FD_ZERO(&IOMGR_writefds);=
</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
(dbx) where</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
libdebug assertion "(framep->getGpr(STKP, &addr) =3D=3D DB_SUCC=
ESS && *nextStkpp =3D=3D addr)" 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_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
unnamed block in IOMGR(dummy =3D (nil)), line 362 in "iomgr.c"</d=
iv>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
(dbx) </div>
<div class=3D"x_elementToProof" style=3D"line-height:normal; margin:0px; fo=
nt-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sa=
ns-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"line-height:normal; margin:0px; fo=
nt-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sa=
ns-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"x_elementToProof" style=3D"line-height:normal; margin:0px; fo=
nt-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sa=
ns-serif; font-size:12pt; color:rgb(0,0,0)">
...</div>
<div class=3D"x_elementToProof" style=3D"line-height:normal; margin:0px; fo=
nt-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sa=
ns-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_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor: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_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
static int IOMGR_nfds =3D 0;</div>
<div style=3D"line-height:normal; margin:0px; min-height:13px; font-family:=
Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; =
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
static void *IOMGR(void *dummy)</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
{</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
for (;;) {</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
int code;</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
struct TM_Elem *earliest;</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
struct timeval timeout, junk;</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
bool woke_someone;</div>
<div style=3D"line-height:normal; margin:0px; min-height:13px; font-family:=
Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; =
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
FD_ZERO(&IOMGR_readfds);</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
FD_ZERO(&IOMGR_writefds);</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
FD_ZERO(&IOMGR_exceptfds);</div>
<div style=3D"line-height:normal; margin:0px; font-family:Aptos,Aptos_Embed=
dedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; c=
olor:rgb(0,0,0)">
IOMGR_nfds =3D 0;</div>
<div class=3D"x_elementToProof" style=3D"line-height:normal; margin:0px; mi=
n-height:13px; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cal=
ibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
...</div>
<div class=3D"x_elementToProof" style=3D"line-height:normal; margin:0px; fo=
nt-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sa=
ns-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
I did the compile with the ./configure --enable-debug and -ena=
ble-debug-lwp options specified. Can someone help explain how this co=
de works, and what might done to fix it? 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"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
Thank you!</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
-Ben</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
</div>
</body>
</html>
--_000_BYAPR07MB587991B3CF7CF2A90C1D452CA7592BYAPR07MB5879namp_--