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

Bug#748644: Conflicting array sizes may cause undefined behaviour



Package: flite
Version: 1.4-release-8
Usertags: goto-cc

During a rebuild of all packages in a clean sid chroot (and cowbuilder+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.

[...]
x86_64-linux-gnu-gcc -g -O2 -Wall    -o ../bin/flite flite_main.o flite_voice_list.o -L../build/x86_64-linux-gnu/lib -lflite_cmu_us_kal -lflite_cmu_time_awb -lflite_cmu_us_kal16 -lflite_cmu_us_awb -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite -lm -lasound 

file cmu_time_awb_lex_entry.c line 50: error: conflicting array sizes for variable "cmu_time_awb_lex_phone_table"
old definition in module cmu_time_awb file cmu_time_awb.c line 57
const char * const [54l]
new definition in module cmu_time_awb_lex_entry file cmu_time_awb_lex_entry.c line 50
const char * const [36l]
Makefile:84: recipe for target '../bin/flite' failed
make[2]: *** [../bin/flite] Error 64
config/common_make_rules:132: recipe for target 'build/x86_64-linux-gnu/obj//.make_build_dirs' failed
make[1]: *** [build/x86_64-linux-gnu/obj//.make_build_dirs] Error 2
make[1]: Leaving directory '/srv/jenkins-slave/workspace/sid-goto-cc-flite/flite-1.4-release'
debian/rules:49: recipe for target 'build-stamp' failed

Observe that the larger of the two, in cmu_time_awb.c, is declared extern:

http://sources.debian.net/src/flite/1.4-release-8/lang/cmu_time_awb/cmu_time_awb.c?hl=57#L57

Hence the actual storage size will match that of cmu_time_awb_lex_entry.c:

http://sources.debian.net/src/flite/1.4-release-8/lang/cmu_time_awb/cmu_time_awb_lex_entry.c?hl=50#L50

As the compiler may perform optimisations using the known size of the array,
invalid memory accesses may result.

Best,
Michael

Attachment: pgpmZOOPVCvuw.pgp
Description: PGP signature


Reply to: