[Pkg-ime-devel] Bug#750218: gcin: Conflicting declarations of function get_gcin_sockpath_atom cause undefined behaviour

Michael Tautschnig mt at debian.org
Mon Jun 2 15:39:43 UTC 2014

Package: gcin
Version: 2.8.2+dfsg1-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.

gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wl,-z,relro -fPIC -Wl,--as-needed -shared -Wl,-soname,libgcin-im-client.so.1 gcin-im-client.o im-addr.o gcin-conf.o util.o gcin-crypt-fpic.o -lX11 -o libgcin-im-client.so.1.2.5 -L/usr/X11R6/lib

error: conflicting function declarations "get_gcin_sockpath_atom"
old definition in module gcin-im-client file gcin-im-client.cpp line 27
unsigned int (struct _XDisplay *)
new definition in module im-addr file ../im-addr.cpp line 63
unsigned long int (struct _XDisplay *dpy)
Makefile:23: recipe for target 'libgcin-im-client.so.1.2.5' failed
make[2]: *** [libgcin-im-client.so.1.2.5] Error 64
make[2]: Leaving directory '/srv/jenkins-slave/workspace/sid-goto-cc-gcin/gcin-2.8.2+dfsg1/im-client'
Makefile:190: recipe for target 'im-client/libgcin-im-client.so' failed
make[1]: *** [im-client/libgcin-im-client.so] Error 2

For any platform with sizeof(unsigned)<sizeof(unsigned long), the call to
get_gcin_sockpath_atom has undefined behaviour if the return value is used:
either it will get truncated in some arbitrary way, or the wrong set of bytes
will be picked up.

Adjusting the declaration in gcin-im-client.cpp should fix this problem.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 859 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ime-devel/attachments/20140602/1d884be1/attachment.sig>

More information about the Pkg-ime-devel mailing list