Bug#709212: clang-3.2: application hangs on fgets with -D_FORTIFY_SOURCE=2 -O1

Rubidium rubidium at openttd.org
Tue May 21 16:10:46 UTC 2013


Package: clang-3.2
Version: 1:3.2repack-6
Severity: normal

Dear Maintainer,

The attached (minimal) application hangs when it is compiled with:
     clang++ -D_FORTIFY_SOURCE=2 -O1 -o clang_hang clang_hang.cpp
You need to run it as ./clang_hang clang_hang.cpp

The application works correctly if you remove either the -D or the -O1, 
or change the -O1 to -O0, -O2 or -O3. Correctly in this case is printing 
the lines of clang_hang.cpp and exiting within a few milliseconds.

This is (likely) the reason why openttd FTBFS when using clang; the code 
is the minimized variant of the application that fails during openttd's 
build.

The application works correctly with GCC on at least versions 4.4, 4.6, 
4.7 and 4.8.

Regards,
Remko 'Rubidium' Bijker

-- System Information:
Debian Release: jessie/sid
   APT prefers unstable
   APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.8-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages clang-3.2 depends on:
ii  libc6                2.17-3
ii  libclang-common-dev  1:3.2repack-6
ii  libffi6              3.0.13-4
ii  libgcc1              1:4.8.0-7
ii  libllvm3.2           1:3.2repack-6
ii  libstdc++6           4.8.0-7
ii  libstdc++6-4.7-dev   4.7.3-4

Versions of packages clang-3.2 recommends:
pn  llvm-3.2-dev  <none>
ii  python        2.7.3-5

clang-3.2 suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_hang.cpp
Type: text/x-c++src
Size: 433 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-llvm-team/attachments/20130521/634c6a46/attachment.cpp>


More information about the Pkg-llvm-team mailing list