[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#749120: Missing X11 include to cause type conflict



Package: libfs
Version: 2:1.0.5-1
Usertags: goto-cc

During a rebuild of all Debian packages in a clean sid chroot (using cowbuilder
and pbuilder) the build failed with the following error. Please note that we
use our research compiler tool-chain (using tools from the cbmc package), which
permits extended reporting on type inconsistencies at link time.

[...]
libtool: link:  gcc -shared  -fPIC -DPIC  .libs/FSCloseFt.o .libs/FSClServ.o .libs/FSConnServ.o .libs/FSErrDis.o .libs/FSErrHndlr.o .libs/FSFlush.o .libs/FSFontInfo.o .libs/FSFtNames.o .libs/FSGetCats.o .libs/FSlibInt.o .libs/FSListCats.o .libs/FSListExt.o .libs/FSMisc.o .libs/FSNextEv.o .libs/FSOpenFont.o .libs/FSOpenServ.o .libs/FSQGlyphs.o .libs/FSQuExt.o .libs/FSQXExt.o .libs/FSQXInfo.o .libs/FSServName.o .libs/FSSetCats.o .libs/FSSync.o .libs/FSSynchro.o .libs/fs_transport.o    -O2 -Wl,-z -Wl,relro   -Wl,-soname -Wl,libFS.so.6 -Wl,-version-script -Wl,.libs/libFS.ver -o .libs/libFS.so.6.0.0

error: conflicting function declarations "_FSTransBytesReadable"
old definition in module FSConnServ file /usr/include/X11/Xtrans/Xtrans.h line 338
signed int (struct _XtransConnInfo *, signed int *)
new definition in module fs_transport file /usr/include/X11/Xtrans/Xtrans.c line 897
signed int (struct _XtransConnInfo *ciptr, signed long int *pend)
Makefile:467: recipe for target 'libFS.la' failed
make[3]: *** [libFS.la] Error 64
make[3]: Leaving directory '/srv/jenkins-slave/workspace/sid-goto-cc-libfs/libfs-1.0.5/build/src'
Makefile:509: recipe for target 'all-recursive' failed

While Xtrans.h and Xtrans.c can reasonably be expected to be consistent, indeed
the second parameter's type depends on whether LONG64 is defined or not. This is
set in /usr/include/X11/Xmd.h, which is transitively included by FSConnServ.c
(via #include "FSlibint.h"). fs_transport.c, however, solely has:

#include "config.h" /* Need to know which transport types to support */
#include <X11/Xtrans/transport.c>

This causes a mismatch of types, with undefined behaviour as dereferencing the
"pend" pointer will cause invalid memory accesses. Consequently fs_transport.c
should include FSlibint.h before transport.c.

Best,
Michael

Attachment: pgpm2AE7LewUX.pgp
Description: PGP signature


Reply to: