Bug#749513: nethack: Conflicting parameter types to cause undefined behaviour

Michael Tautschnig mt at debian.org
Tue May 27 15:15:07 UTC 2014


Package: nethack
Version: 3.4.3-15
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 -Wall -Wl,-z,relro -o nethack.console monst.o objects.o allmain.o alloc.o apply.o artifact.o attrib.o ball.o bones.o botl.o cmd.o dbridge.o decl.o detect.o dig.o display.o dlb.o do.o do_name.o do_wear.o dog.o dogmove.o dokick.o dothrow.o drawing.o dungeon.o eat.o end.o engrave.o exper.o explode.o extralev.o files.o fountain.o hack.o hacklib.o invent.o light.o lock.o mail.o makemon.o mapglyph.o mcastu.o mhitm.o mhitu.o minion.o mklev.o mkmap.o mkmaze.o mkobj.o mkroom.o mon.o mondata.o monmove.o monstr.o mplayer.o mthrowu.o muse.o music.o o_init.o objnam.o options.o pager.o pickup.o pline.o polyself.o potion.o pray.o priest.o quest.o questpgr.o read.o rect.o region.o restore.o rip.o rnd.o role.o rumors.o save.o shk.o shknam.o sit.o sounds.o sp_lev.o spell.o steal.o steed.o teleport.o timeout.o topten.o track.o trap.o u_init.o uhitm.o vault.o vision.o vis_tab.o weapon.o were.o wield.o windows.o wizard.o worm.o worn.o write.o zap.o  ioctl.o unixmain.o unixtty.o unixunix.o unixres.o getline.o termcap.o topl.o wintty.o cursmain.o curswins.o cursmisc.o cursdial.o cursstat.o cursinit.o cursmesg.o version.o -lncurses 

error: conflicting function declarations "check_leash"
old definition in module allmain file ../include/extern.h line 41
void (signed int, signed int)
new definition in module apply file apply.c line 542
void (signed char x, signed char y)
Makefile:423: recipe for target 'Sysunix' failed
make[1]: *** [Sysunix] Error 64

This will result in undefined behaviour in at least one of the two following
ways:

- A value greater than 127 is passed in;
- big endian systems will fail to pick the right byte, even if all values are
  below 127.

Best,
Michael

-------------- 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-games-devel/attachments/20140527/85178f7c/attachment.sig>


More information about the Pkg-games-devel mailing list