[krbdev.mit.edu #2902] KBR5 1.4 kinit build on AIX 5.1 coredumps

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[krbdev.mit.edu #2902] KBR5 1.4 kinit build on AIX 5.1 coredumps

Greg Hudson via RT
I'm running krb5 1.4.1 on AIX 5.2.0.0 --

The problem is due to the use of res_ninit() in krb5int_dns_init() in
dnsglue.c.

I'm not very familiar with the usage of res_ninit(), but debugging the
code seems to shows that whenever res_ninit(&statbuf) is called, the
stack seems to get corrupted and the core dump with illegal instruction
happens soon afterwards.

I don't know what the proper way to call res_ninit() is -- I can only
assume that it works on other platforms, nor do I have AIX source code
to dig into to see what actually is happening, but a reading of the
kerberos source doesn't suggest anything obvious is wrong.  I've also
tried initializing statbuf to various assorted values to no avail.

I reading of the AIX man page for res_ninit() seems to suggest the
parameter to res_ninit() should be &_res (_res is #defined to a function
in the system resolver library when _REENTRANT).  Switching statbuf to
_res, and lo, kerberos no longer crashes.

The attached patch does just this.

Of course, one could also #undef HAVE_RES_NSEARCH and have it work, but
I wasn't sure if res_search() in AIX was thread-safe.

-- Jonathan Chen <[hidden email]>
_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs
Reply | Threaded
Open this post in threaded view
|

Re: [krbdev.mit.edu #2902] KBR5 1.4 kinit build on AIX 5.1 coredumps

Greg Hudson via RT
Could someone who has an AIX 5 system please try making a config.cache
containing only the line

krb5_cv_func_res_search=no

on a clean build tree, configuring, and then running make to see if
that solves the problem?  That will trick the build system into not
using res_ninit()/res_nsearch()/etc.

---Tom

_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs
Reply | Threaded
Open this post in threaded view
|

Re: [krbdev.mit.edu #2902] KBR5 1.4 kinit build on AIX 5.1 coredumps

Greg Hudson via RT
In reply to this post by Greg Hudson via RT
Tom Yu via RT wrote:

> Could someone who has an AIX 5 system please try making a config.cache
> containing only the line
>
> krb5_cv_func_res_search=no
>
> on a clean build tree, configuring, and then running make to see if
> that solves the problem?  That will trick the build system into not
> using res_ninit()/res_nsearch()/etc.
>
> ---Tom
>

I will try this today.

Dan


_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs
Reply | Threaded
Open this post in threaded view
|

Re: [krbdev.mit.edu #2902] KBR5 1.4 kinit build on AIX 5.1 coredumps

Greg Hudson via RT
In reply to this post by Greg Hudson via RT
Tom Yu via RT wrote:

> Could someone who has an AIX 5 system please try making a config.cache
> containing only the line
>
> krb5_cv_func_res_search=no
>
> on a clean build tree, configuring, and then running make to see if
> that solves the problem?  That will trick the build system into not
> using res_ninit()/res_nsearch()/etc.
>
> ---Tom

This did not work.  I built KRB5 1.4 on AIX 5.1 as before, and the
config.cache now contains

        krb5_cv_func_res_search=${krb5_cv_func_res_search=no}

But after installing the new build, the kinit command still dies
immediately with an illegal instruction coredump.

Dan

_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs
Reply | Threaded
Open this post in threaded view
|

Re: [krbdev.mit.edu #2902] KBR5 1.4 kinit build on AIX 5.1 coredumps

Greg Hudson via RT
In reply to this post by Greg Hudson via RT
>>>>> "lio" == lio@ornl gov via RT <[hidden email]> writes:

lio> This did not work.  I built KRB5 1.4 on AIX 5.1 as before, and the
lio> config.cache now contains

lio> krb5_cv_func_res_search=${krb5_cv_func_res_search=no}

My apologies.  The setting should have been

krb5_cv_func_res_nsearch=no

_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs
Reply | Threaded
Open this post in threaded view
|

Re: [krbdev.mit.edu #2902] KBR5 1.4 kinit build on AIX 5.1 coredumps

Greg Hudson via RT
In reply to this post by Greg Hudson via RT
Tom Yu via RT wrote:

>>>>>>"lio" == lio@ornl gov via RT <[hidden email]> writes:
>
>
> lio> This did not work.  I built KRB5 1.4 on AIX 5.1 as before, and the
> lio> config.cache now contains
>
> lio> krb5_cv_func_res_search=${krb5_cv_func_res_search=no}
>
> My apologies.  The setting should have been
>
> krb5_cv_func_res_nsearch=no
>

OK, this one worked.  I can run kinit normally now.

Dan


_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs
Reply | Threaded
Open this post in threaded view
|

Re: [krbdev.mit.edu #2902] KBR5 1.4 kinit build on AIX 5.1 coredumps

Greg Hudson via RT
In reply to this post by Greg Hudson via RT
>>>>> "lio" == lio@ornl gov via RT <[hidden email]> writes:

lio> Tom Yu via RT wrote:

>> My apologies.  The setting should have been
>>
>> krb5_cv_func_res_nsearch=no

lio> OK, this one worked.  I can run kinit normally now.

Thanks for the confirmation.  A workaround based on the above will
appear in krb5-1.4.2.

---Tom

_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs