Debugging NSS_WRAPPER in the samba test environment.

Andreas Schneider asn at samba.org
Tue Jul 28 06:42:52 UTC 2015


On Monday 27 July 2015 13:23:23 Jeremy Allison wrote:
> On Mon, Jul 27, 2015 at 01:13:30PM -0700, Jeremy Allison wrote:
> > I'm trying to debug a test case I'm writing,
> > and I'd really like to see the debug test
> > messages from NSS_WRAPPER.
> > 
> > So I tried adding
> > 
> > $ENV{NSS_WRAPPER_DEBUGLEVEL} = 10;
> > 
> > to the startup scripts for smbd and winbindd in
> > selftest/target/Samba3.pm, but don't see any
> > NWRAP_XXX messages in any logs, or in the
> > stdout.
> > 
> > Anyone know how to get lib/nss_wrapper/nss_wrapper.c
> > debug to work ?
> 
> Oh, I found it...
> 
> Inside lib/uid_wrapper/wscript we have:
> 
> def build(bld):
>     if not bld.CONFIG_SET("USING_SYSTEM_UID_WRAPPER"):
>         # We need to do it this way or the library wont work.
>         # Using private_library=True will add symbol version which
>         # breaks preloading!
>         bld.SAMBA_LIBRARY('uid_wrapper',
>                           source='uid_wrapper.c',
>                           cflags='-DNDEBUG',
>                           deps='dl',
>                           install=False,
>                           realname='libuid-wrapper.so')
> 
> It's the cflags='-DNDEBUG' that does it :-(.
> 
> Any chance we can add a configure option that
> turns this off (not sure how to waf-ify that :-) ?

I think you could enable it in a developer build if you want. Create a 
variable cwrap_cflags and set it to '-DNDEBUG' in the default case and change 
it to '' if we have --enable-developer.

However it is normally a better idea to have the latest version of the wrapper 
installed on your system. This way if we have a bug in a wrapper and you 
bisect with git you will not run into the wrapper bug.

Cheers,


	-- andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list