mpd/test
Michael Cree 72637d00e8 Bug#822848: mpd FTBFS on Alpha; misaligned arrays in the test suite
Source: mpd
Version: 0.19.14-2
Severity: important
Justification: fails to build form source (but built in the past)
Tags: patch
User: debian-alpha@lists.debian.org
Usertags: alpha

mpd FTBFS on Alpha with a failure in the test suite [1]:

FAIL: test/test_byte_reverse
============================

.F...

!!!FAILURES!!!
Test Results:
Run:  4   Failures: 1   Errors: 0

1) test: ByteReverseTest::TestByteReverse2 (F) line: 58 test/test_byte_reverse.cxx
assertion failed
- Expression: strcmp(result, (const char *)dest) == 0

This occurs because the test suite (in test/test_byte_reversal.cxx)
allocates static char arrays and passes the char arrays to functions
whose respective arguments were declared to be uint16_t *, etc., in
the main code.

This is in the realm of undefined behaviour on architectures with
strict memory alignment requirements.  Although the test only fails
on Alpha (because Alpha has a particular CPU load instruction that
gcc likes to use to add bugs ..., ahem,  optimise the code on the
assumption of alignment) it is potentially a latent bug for other
architectures with strict alignment requirements.

Since the code is compiled with the c++11 standard I attach a patch
that modifies the test suite to align the non-compliant strings with
the alignas() attribute.  The test suite now passes on Alpha with
that patch.

Cheers
Michael

[1] https://buildd.debian.org/status/fetch.php?pkg=mpd&arch=alpha&ver=0.19.14-2&stamp=1461542099
2016-04-28 13:29:41 +02:00
..
.gitignore neighbor: new subsystem to detect file servers on the local network 2014-01-26 00:10:05 +01:00
dump_playlist.cxx test/run_input, ...: add struct ScopeIOThread 2014-10-07 20:02:13 +02:00
dump_rva2.cxx Config*: move to config/ 2014-01-24 00:20:01 +01:00
dump_text_file.cxx test/run_input, ...: add struct ScopeIOThread 2014-10-07 20:02:13 +02:00
DumpDatabase.cxx test/DumpDatabase, ...: no g_thread_init() calls when GLib is disabled 2014-10-24 18:30:30 +02:00
FakeDecoderAPI.cxx test/FakeDecoderAPI: dump bit rate 2014-11-10 09:00:38 +01:00
FakeDecoderAPI.hxx DecoderAPI: add function decoder_open_uri() 2014-05-22 12:35:20 +02:00
FakeReplayGainConfig.cxx copyright year 2014 2014-01-13 22:31:55 +01:00
read_conf.cxx Config*: move to config/ 2014-01-24 00:20:01 +01:00
read_mixer.cxx test/read_mixer: add missing stdlib.h include 2015-01-26 20:39:49 +01:00
read_tags.cxx test/run_input, ...: add struct ScopeIOThread 2014-10-07 20:02:13 +02:00
run_avahi.cxx event/Loop: remove the dummy constructor argument 2014-02-05 00:00:03 +01:00
run_convert.cxx PcmConvert: Convert() returns ConstBuffer 2014-08-12 16:36:07 +02:00
run_decoder.cxx test/run_input, ...: add struct ScopeIOThread 2014-10-07 20:02:13 +02:00
run_encoder.cxx Config*: move to config/ 2014-01-24 00:20:01 +01:00
run_filter.cxx Filter: FilterPCM() returns ConstBuffer 2014-08-12 16:40:51 +02:00
run_gunzip.cxx input/GunzipInputStream: new class 2014-08-08 20:11:29 +02:00
run_gzip.cxx fs/output, fs/TextFile: move to fs/io/ 2014-08-07 19:38:25 +02:00
run_inotify.cxx event/Loop: remove the dummy constructor argument 2014-02-05 00:00:03 +01:00
run_input.cxx test/run_input: make variables more local 2014-11-25 07:51:33 +01:00
run_neighbor_explorer.cxx event/Loop: remove the dummy constructor argument 2014-02-05 00:00:03 +01:00
run_normalize.cxx test: various fixups for building without GLib 2014-02-18 09:18:42 +01:00
run_output.cxx test/run_input, ...: add struct ScopeIOThread 2014-10-07 20:02:13 +02:00
run_resolver.cxx copyright year 2014 2014-01-13 22:31:55 +01:00
run_storage.cxx StoragePlugin: pass EventLoop to constructor 2014-10-09 07:45:25 +02:00
ScopeIOThread.hxx test/run_input, ...: add struct ScopeIOThread 2014-10-07 20:02:13 +02:00
ShutdownHandler.cxx copyright year 2014 2014-01-13 22:31:55 +01:00
ShutdownHandler.hxx test/ShutdownHandler: make the constructor "explicit" 2014-02-05 00:00:00 +01:00
software_volume.cxx copyright year 2014 2014-01-13 22:31:55 +01:00
stdbin.h copyright year 2014 2014-01-13 22:31:55 +01:00
test_archive_bzip2.sh Makefile.am: added unit tests for the archive plugins 2009-12-31 15:50:59 +01:00
test_archive_iso9660.sh Makefile.am: added unit tests for the archive plugins 2009-12-31 15:50:59 +01:00
test_archive_zzip.sh Makefile.am: added unit tests for the archive plugins 2009-12-31 15:50:59 +01:00
test_archive.cxx test/test_archive: don't use GLib 2014-10-25 00:08:04 +02:00
test_byte_reverse.cxx Bug#822848: mpd FTBFS on Alpha; misaligned arrays in the test suite 2016-04-28 13:29:41 +02:00
test_icy_parser.cxx Merge branch 'v0.18.x' 2014-01-27 10:33:42 +01:00
test_mixramp.cxx test/test_mixramp: add threshold to floating point comparisons 2013-11-04 22:08:59 +01:00
test_pcm_all.hxx output/alsa, pcm: rename "DSD over USB" to "DoP" 2014-08-31 16:12:26 +02:00
test_pcm_channels.cxx test/test_pcm: replace 256 with prime number 2014-03-15 10:53:13 +01:00
test_pcm_dither.cxx test/test_pcm: replace 256 with prime number 2014-03-15 10:53:13 +01:00
test_pcm_export.cxx output/alsa, pcm: rename "DSD over USB" to "DoP" 2014-08-31 16:12:26 +02:00
test_pcm_format.cxx test/test_pcm: replace 256 with prime number 2014-03-15 10:53:13 +01:00
test_pcm_main.cxx test/test_pcm: add PcmExport unit test 2014-08-12 22:05:38 +02:00
test_pcm_mix.cxx test/test_pcm: replace 256 with prime number 2014-03-15 10:53:13 +01:00
test_pcm_pack.cxx test/test_pcm: replace 256 with prime number 2014-03-15 10:53:13 +01:00
test_pcm_util.hxx copyright year 2014 2014-01-13 22:31:55 +01:00
test_pcm_volume.cxx test/test_pcm: replace 256 with prime number 2014-03-15 10:53:13 +01:00
test_protocol.cxx test/test_protocol: add missing stdlib.h include 2014-09-24 23:03:28 +02:00
test_queue_priority.cxx Queue*: move to queue/ 2014-01-24 00:17:50 +01:00
test_rewind.cxx InputStream: move typedef offset_type to Offset.hxx 2014-08-19 22:29:52 +02:00
test_translate_song.cxx Tag: use SignedSongTime for the song duration 2014-08-29 13:20:58 +02:00
test_util.cxx util/UriUtil: add uri_get_suffix() overload that ignores query string 2014-11-01 12:45:47 +01:00
test_vorbis_encoder.cxx Config*: move to config/ 2014-01-24 00:20:01 +01:00
TestCircularBuffer.hxx util/CircularBuffer: add method GetSpace() 2014-03-16 00:28:42 +01:00
visit_archive.cxx test/DumpDatabase, ...: no g_thread_init() calls when GLib is disabled 2014-10-24 18:30:30 +02:00