Implict declaration issue with asan options.

William Brown william at blackhats.net.au
Wed Apr 18 09:00:57 UTC 2018


Hi,

I noticed that my fresh checkout on f27 stopped working with:

commit fc473cd28261478cc9c3232b43fc725f0468f8a9 (HEAD -> master,
origin/master, origin/HEAD)

./configure.developer --address-sanitizer --enable-developer --enable-
debug --enable-auto-reconfigure
make
...

[1624/4154] Compiling lib/ldb-samba/ldb_wrap.c
../lib/ldb-samba/ldb_wrap.c: In function ‘ldb_wrap_find’:
../lib/ldb-samba/ldb_wrap.c:191:14: error: implicit declaration of
function ‘getpid’; did you mean ‘getpt’? [-Werror=implicit-function-
declaration]
  pid_t pid = getpid();
              ^~~~~~
              getpt
cc1: some warnings being treated as errors
Waf: Leaving directory `/home/william/development/samba/bin'
Build failed:  -> task failed (err #1): 
	{task: cc ldb_wrap.c -> ldb_wrap_5.o}
make: *** [Makefile:8: all] Error 1

I then dumped the preprocessor output (attached), I notice that
unistd.h is missing. It's avaliable in source3/.../includes.h, but not
in source4.

I created a patch adding unistd.h to ldb_wrap.c, then continued and
noticed:

[3106/4154] Compiling source3/libgpo/gpext/security.c
../source3/libgpo/gpext/security.c: In function
‘security_process_group_policy’:
../source3/libgpo/gpext/security.c:202:5: error: ‘status.v’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  if (!NT_STATUS_IS_OK(status)) {
     ^
cc1: some warnings being treated as errors
Waf: Leaving directory `/home/william/development/samba/bin'
Build failed:  -> task failed (err #1): 
	{task: cc security.c -> security_5.o}


At this point I was quite suspicious - I have eventually worked out the
root cause is '--address-sanitizer'. Addition of this option will cause
compilation to fail, however I don't understand why.

I have done a make clean, reconfigure, build with and without, and the
cause is always --address-sanitizer

Any advice on what could be going on here would be great, as I'm not
yet very familiar with waf.

Thank you!

William
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldb_wrap_5.E
Type: text/x-eiffel
Size: 503180 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180418/a41a90be/ldb_wrap_5-0001.bin>


More information about the samba-technical mailing list