[SSSD] [PATCH] Print pointer contents not address

Stephen Gallagher sgallagh at redhat.com
Tue Jul 10 13:31:11 UTC 2012


On Tue, 2012-07-10 at 09:26 -0400, Stephen Gallagher wrote:
> On Tue, 2012-07-10 at 15:10 +0200, Jakub Hrozek wrote:
> > On Mon, Jul 09, 2012 at 07:28:12AM -0400, Stephen Gallagher wrote:
> > > On Sun, 2012-07-08 at 22:02 +0200, Jakub Hrozek wrote:
> > > > I was not able to log in today, I was getting krb5_child segfaults. The
> > > > attached patch fixed that.
> > > 
> > > Nack.
> > > 
> > > I fail to see how this could possibly have caused a segfault. The
> > > previous version would have been printing either "true" or "false" based
> > > on whether the pointer was NULL or contained a value. This was
> > > incorrect, but should be impossible to segfault on.
> > 
> > Yeah, the segfault was caused by incorrect format string. I'll send a
> > separate patch for that issue.
> > 
> > I assumed this was the reason because I no longer saw the segfault on my
> > laptop, but it turned out that the crash went away only because I tested
> > a build compiled with -O0, krb5_child was still crashing when compiled
> > with -O2.
> > 
> 
> I hate it when bugs only occur at certain optimization levels...
> 
> > > 
> > > However, the new patch changes this to a dereference without checking
> > > the validity of the offline pointer first. So now you've introduced the
> > > possibility of a segfault if the pointer is uninitialized (though it
> > > never should be).
> > 
> > We write into the address earlier anyway, so we depended on the pointer
> > validity. I've added a check, 
> 
> Ack.

Pushed to master.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120710/ed11c2c3/attachment.sig>


More information about the sssd-devel mailing list