[tpop3d-discuss] signal 11?

Chris Lightfoot chris at ex-parrot.com
Wed, 18 Jul 2001 10:21:49 +0100


On Tue, Jul 17, 2001 at 05:04:01PM -0700, Paul Makepeace wrote:
> On Tue, Jul 17, 2001 at 04:43:18PM -0700, Nancy Pettigrew (work) wrote:
> > Why would the process get the SIGSEGV after returning an error back from the
> > auth_mysql_new_user_pass function?
> 
> FWIW, and this may be completely unrelated, but I was getting SEGVs in
> authswitch.c using auth_perl_new_user_pass. It was happening here,
> 
> (gdb) bt
> #0  0x40186b00 in strdup () from /lib/libc.so.6
> #1  0x804f652 in authcontext_new (uid=8, gid=0, mboxdrv=0x80664ca "",
>     mailbox=0x0, home=0x81d0c58 "/var/spool/mail",
>     domain=0x5 <Address 0x5 out of bounds>) at authswitch.c:215
> #2  0x804ed1c in auth_perl_new_user_pass (
>     user=0x81e22b0 "paul@realprogrammers.com", pass=0x80dcf48 "4321")
>     at auth_perl.c:331
> 
> It turns out it was because I was returning a perl hash that was
> frightening it in ways I haven't yet looked into (this was about
> 20mins ago).

You've found a bug :)

It's another fails-to-initialise pointes thing. The
declaration of char *mailbox, *mboxdrv, *domain should
initialise them to NULL. In this instance the domain was
getting initialised to 0x5, which caused a problem in
strdup. How this worked when I tried it I don't know.
Apologies for this fairly basic screwup.

(See! I told you we'd find the bugs....)

I'm also not now sure why I thought that it would be
useful to set the domain. I suppose because an
authenticator might determine the domain in a surprising
way. I didn't trouble to document it, though. Hmm.

-- 
Chris Lightfoot -- www.ex-parrot.com/~chris/
 ``... the reason soldiers retire early is that,
   at about age 40 - 45, they realise that war is dangerous.'' (anon.)