<html><head></head><body><div>Hi All,</div><div><br></div><div>On Sat, 2015-12-05 at 15:23 +0100, Gilles Risch wrote:</div><blockquote type="cite">program ReproduceBug;<br>
<br>
{$mode objfpc}{$H+}<br>
<br>
uses<br>
{$ifdef unix}cthreads;{$endif}<br>
<br>
begin<br>
writeln('using cthreads seems to be the root cause of this bug.');<br>
end.<br></blockquote><div><br></div><div>I just tried the above program and it worked perfect:</div><pre>$cat - > test.pas</pre><pre>program ReproduceBug;</pre><pre><br></pre><pre>{$mode objfpc}{$H+}</pre><pre><br></pre><pre>uses</pre><pre> {$ifdef unix}cthreads;{$endif}</pre><pre><br></pre><pre>begin</pre><pre> writeln('using cthreads seems to be the root cause of this bug.');</pre><pre>end.</pre><pre>$fpc test.pas </pre><pre>Free Pascal Compiler version 2.6.4+dfsg-8 [2015/08/14] for x86_64</pre><pre>Copyright (c) 1993-2014 by Florian Klaempfl and others</pre><pre>Target OS: Linux for x86-64</pre><pre>Compiling test.pas</pre><pre>Linking test</pre><pre><br></pre><pre>[some blank lines]</pre><pre><br></pre><pre>/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?</pre><pre>10 lines compiled, 0.5 sec </pre><pre>$./test </pre><pre>using cthreads seems to be the root cause of this bug.</pre><pre>$uname -a</pre><pre>Linux lt-mazen 4.2.0-1-amd64 #1 SMP Debian 4.2.6-1 (2015-11-10) x86_64 GNU/Linux</pre><pre>$dpkg-architecture </pre><pre>DEB_BUILD_ARCH=amd64</pre><pre>DEB_BUILD_ARCH_BITS=64</pre><pre>DEB_BUILD_ARCH_CPU=amd64</pre><pre>DEB_BUILD_ARCH_ENDIAN=little</pre><pre>DEB_BUILD_ARCH_OS=linux</pre><pre>DEB_BUILD_GNU_CPU=x86_64</pre><pre>DEB_BUILD_GNU_SYSTEM=linux-gnu</pre><pre>DEB_BUILD_GNU_TYPE=x86_64-linux-gnu</pre><pre>DEB_BUILD_MULTIARCH=x86_64-linux-gnu</pre><pre>DEB_HOST_ARCH=amd64</pre><pre>DEB_HOST_ARCH_BITS=64</pre><pre>DEB_HOST_ARCH_CPU=amd64</pre><pre>DEB_HOST_ARCH_ENDIAN=little</pre><pre>DEB_HOST_ARCH_OS=linux</pre><pre>DEB_HOST_GNU_CPU=x86_64</pre><pre>DEB_HOST_GNU_SYSTEM=linux-gnu</pre><pre>DEB_HOST_GNU_TYPE=x86_64-linux-gnu</pre><pre>DEB_HOST_MULTIARCH=x86_64-linux-gnu</pre><pre>DEB_TARGET_ARCH=amd64</pre><pre>DEB_TARGET_ARCH_BITS=64</pre><pre>DEB_TARGET_ARCH_CPU=amd64</pre><pre>DEB_TARGET_ARCH_ENDIAN=little</pre><pre>DEB_TARGET_ARCH_OS=linux</pre><pre>DEB_TARGET_GNU_CPU=x86_64</pre><pre>DEB_TARGET_GNU_SYSTEM=linux-gnu</pre><pre>DEB_TARGET_GNU_TYPE=x86_64-linux-gnu</pre><pre>DEB_TARGET_MULTIARCH=x86_64-linux-gnu</pre><pre>$dpkg -l '*:i386'</pre><pre>Desired=Unknown/Install/Remove/Purge/Hold</pre><pre>| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend</pre><pre>|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)</pre><pre>||/ Name Version Architecture Description</pre><pre>+++-===========================-==================-==================-===========================================================</pre><pre>ii gcc-5-base:i386 5.2.1-23 i386 GCC, the GNU Compiler Collection (base package)</pre><pre>ii gstreamer1.0-plugins-base:i 1.6.1-1 i386 GStreamer plugins from the "base" set</pre><pre>ii i965-va-driver:i386 1.6.1-1 i386 VAAPI driver for Intel G45 & HD Graphics family</pre><pre>ii libasound2:i386 1.0.29-1 i386 shared library for ALSA applications</pre><pre>ii libasound2-plugins:i386 1.0.29-1 i386 ALSA library additional plugins</pre><pre>ii libasyncns0:i386 0.8-5 i386 Asynchronous name service query library</pre><pre>ii libatk1.0-0:i386 2.18.0-1 i386 ATK accessibility toolkit</pre><pre>ii libattr1:i386 1:2.4.47-2 i386 Extended attribute shared library</pre><pre>ii libaudio2:i386 1.9.4-3 i386 Network Audio System - shared libraries</pre><pre>ii libavahi-client3:i386 0.6.32~rc+dfsg-1 i386 Avahi client library</pre><pre>ii libavahi-common-data:i386 0.6.32~rc+dfsg-1 i386 Avahi common data files</pre><pre>ii libavahi-common3:i386 0.6.32~rc+dfsg-1 i386 Avahi common library</pre><pre>ii libavcodec-ffmpeg56:i386 7:2.8.3-1 i386 FFmpeg library with de/encoders for audio/video codecs - ru</pre><pre>ii libavresample-ffmpeg2:i386 7:2.8.3-1 i386 FFmpeg compatibility library for resampling - runtime files</pre><pre>ii libavutil-ffmpeg54:i386 7:2.8.3-1 i386 FFmpeg library with functions for simplifying programming -</pre><pre>ii libbsd0:i386 0.7.0-2 i386 utility functions from BSD systems - shared library</pre><pre>ii libc6:i386 2.19-22 i386 GNU C Library: Shared libraries</pre><pre>ii libc6-i686:i386 2.19-22 i386 GNU C Library: Shared libraries [i686 optimized]</pre><pre>ii libcairo2:i386 1.14.4-1 i386 Cairo 2D vector graphics library</pre><pre>ii libcap2:i386 1:2.24-12 i386 POSIX 1003.1e capabilities (library)</pre><pre>ii libcdparanoia0:i386 3.10.2+debian-11 i386 audio extraction tool for sampling CDs (library)</pre><pre>ii libcomerr2:i386 1.42.13-1 i386 common error description library</pre><pre>ii libcrystalhd3:i386 1:0.0~git20110715. i386 Crystal HD Video Decoder (shared library)</pre><pre>ii libcups2:i386 2.1.0-6 i386 Common UNIX Printing System(tm) - Core library</pre><pre>ii libdatrie1:i386 0.2.10-1 i386 Double-array trie library</pre><pre>ii libdbus-1-3:i386 1.10.4-1 i386 simple interprocess messaging system (library)</pre><pre>ii libdrm-amdgpu1:i386 2.4.65-3 i386 Userspace interface to amdgpu-specific kernel DRM services </pre><pre>ii libdrm-intel1:i386 2.4.65-3 i386 Userspace interface to intel-specific kernel DRM services -</pre><pre>ii libdrm-nouveau2:i386 2.4.65-3 i386 Userspace interface to nouveau-specific kernel DRM services</pre><pre>ii libdrm-radeon1:i386 2.4.65-3 i386 Userspace interface to radeon-specific kernel DRM services </pre><pre>ii libdrm2:i386 2.4.65-3 i386 Userspace interface to kernel DRM services -- runtime</pre><pre>ii libedit2:i386 3.1-20150325-1 i386 BSD editline and history libraries</pre><pre>ii libelf1:i386 0.163-5.1 i386 library to read and write ELF files</pre><pre>ii libexpat1:i386 2.1.0-7 i386 XML parsing C library - runtime library</pre><pre>ii libffi6:i386 3.2.1-3 i386 Foreign Function Interface library runtime</pre><pre>ii libflac8:i386 1.3.1-4 i386 Free Lossless Audio Codec - runtime C library</pre><pre>ii libfontconfig1:i386 2.11.0-6.3 i386 generic font configuration library - runtime</pre><pre>ii libfreetype6:i386 2.6.1-0.1 i386 FreeType 2 font engine, shared library files</pre><pre>ii libgcc1:i386 1:5.2.1-23 i386 GCC support library</pre><pre>ii libgcrypt20:i386 1.6.4-3 i386 LGPL Crypto library - runtime library</pre><pre>ii libgdk-pixbuf2.0-0:i386 2.32.2-1 i386 GDK Pixbuf library</pre><pre>ii libgl1-mesa-dri:i386 11.0.6-1 i386 free implementation of the OpenGL API -- DRI modules</pre><pre>ii libgl1-mesa-glx:i386 11.0.6-1 i386 free implementation of the OpenGL API -- GLX runtime</pre><pre>ii libglapi-mesa:i386 11.0.6-1 i386 free implementation of the GL API -- shared library</pre><pre>ii libglib2.0-0:i386 2.46.2-1 i386 GLib library of C routines</pre><pre>ii libgmp10:i386 2:6.1.0+dfsg-2 i386 Multiprecision arithmetic library</pre><pre>ii libgnutls-deb0-28:i386 3.3.18-1 i386 GNU TLS library - main runtime library</pre><pre>ii libgpg-error0:i386 1.20-1 i386 library for common error values and messages in GnuPG compo</pre><pre>ii libgpm2:i386 1.20.4-6.1+b2 i386 General Purpose Mouse - shared library</pre><pre>ii libgraphite2-3:i386 1.3.3-1 i386 Font rendering engine for Complex Scripts -- library</pre><pre>ii libgsm1:i386 1.0.13-4 i386 Shared libraries for GSM speech compressor</pre><pre>ii libgssapi-krb5-2:i386 1.13.2+dfsg-4 i386 MIT Kerberos runtime libraries - krb5 GSS-API Mechanism</pre><pre>ii libgstreamer-plugins-base1. 1.6.1-1 i386 GStreamer libraries from the "base" set</pre><pre>ii libgstreamer1.0-0:i386 1.6.1-1 i386 Core GStreamer libraries and elements</pre><pre>ii libgtk2.0-0:i386 2.24.28-1 i386 GTK+ graphical user interface library</pre><pre>ii libharfbuzz0b:i386 1.0.1-1+b1 i386 OpenType text shaping engine (shared library)</pre><pre>ii libhogweed4:i386 3.1.1-4 i386 low level cryptographic library (public-key cryptos)</pre><pre>ii libice6:i386 2:1.0.9-1+b1 i386 X11 Inter-Client Exchange library</pre><pre>ii libjack-jackd2-0:i386 1.9.10+20150825git i386 JACK Audio Connection Kit (libraries)</pre><pre>ii libjbig0:i386 2.1-3.1 i386 JBIGkit libraries</pre><pre>ii libjpeg62-turbo:i386 1:1.4.1-2 i386 libjpeg-turbo JPEG runtime library</pre><pre>ii libjson-c2:i386 0.11-4 i386 JSON manipulation library - shared library</pre><pre>ii libk5crypto3:i386 1.13.2+dfsg-4 i386 MIT Kerberos runtime libraries - Crypto Library</pre><pre>ii libkeyutils1:i386 1.5.9-8 i386 Linux Key Management Utilities (library)</pre><pre>ii libkrb5-3:i386 1.13.2+dfsg-4 i386 MIT Kerberos runtime libraries</pre><pre>ii libkrb5support0:i386 1.13.2+dfsg-4 i386 MIT Kerberos runtime libraries - Support library</pre><pre>ii liblcms2-2:i386 2.6-3+b3 i386 Little CMS 2 color management library</pre><pre>ii libllvm3.5v5:i386 1:3.5.2-3 i386 Modular compiler and toolchain technologies, runtime librar</pre><pre>ii libllvm3.7:i386 1:3.7-4 i386 Modular compiler and toolchain technologies, runtime librar</pre><pre>ii liblzma5:i386 5.1.1alpha+2012061 i386 XZ-format compression library</pre><pre>ii libmng1:i386 1.0.10+dfsg-3.1+b3 i386 Multiple-image Network Graphics library</pre><pre>ii libmp3lame0:i386 3.99.5+repack1-9+b i386 MP3 encoding library</pre><pre>ii libncurses5:i386 6.0+20151024-2 i386 shared libraries for terminal handling</pre><pre>ii libnettle6:i386 3.1.1-4 i386 low level cryptographic library (symmetric and one-way cryp</pre><pre>ii libnuma1:i386 2.0.10-1 i386 Libraries for controlling NUMA policy</pre><pre>ii libogg0:i386 1.3.2-1 i386 Ogg bitstream library</pre><pre>ii libopenjpeg5:i386 1:1.5.2-3.1 i386 JPEG 2000 image compression/decompression library - runtime</pre><pre>ii libopus0:i386 1.1.1-1 i386 Opus codec runtime library</pre><pre>ii liborc-0.4-0:i386 1:0.4.24-1 i386 Library of Optimized Inner Loops Runtime Compiler</pre><pre>ii libp11-kit0:i386 0.23.1-3 i386 Library for loading and coordinating access to PKCS#11 modu</pre><pre>ii libpango-1.0-0:i386 1.38.1-1 i386 Layout and rendering of internationalized text</pre><pre>ii libpangocairo-1.0-0:i386 1.38.1-1 i386 Layout and rendering of internationalized text</pre><pre>ii libpangoft2-1.0-0:i386 1.38.1-1 i386 Layout and rendering of internationalized text</pre><pre>ii libpciaccess0:i386 0.13.4-1 i386 Generic PCI access library for X</pre><pre>ii libpcre3:i386 2:8.35-8 i386 Perl 5 Compatible Regular Expression Library - runtime file</pre><pre>ii libpixman-1-0:i386 0.33.4-1 i386 pixel-manipulation library for X and cairo</pre><pre>ii libpng12-0:i386 1.2.54-1 i386 PNG library - runtime</pre><pre>ii libpulse0:i386 7.1-2 i386 PulseAudio client libraries</pre><pre>ii libqt4-dbus:i386 4:4.8.7+dfsg-4 i386 Qt 4 D-Bus module</pre><pre>ii libqt4-network:i386 4:4.8.7+dfsg-4 i386 Qt 4 network module</pre><pre>ii libqt4-opengl:i386 4:4.8.7+dfsg-4 i386 Qt 4 OpenGL module</pre><pre>ii libqt4-xml:i386 4:4.8.7+dfsg-4 i386 Qt 4 XML module</pre><pre>ii libqt4-xmlpatterns:i386 4:4.8.7+dfsg-4 i386 Qt 4 XML patterns module</pre><pre>ii libqtcore4:i386 4:4.8.7+dfsg-4 i386 Qt 4 core module</pre><pre>ii libqtdbus4:i386 4:4.8.7+dfsg-4 i386 Qt 4 D-Bus module library</pre><pre>ii libqtgui4:i386 4:4.8.7+dfsg-4 i386 Qt 4 GUI module</pre><pre>ii libqtwebkit4:i386 2.3.4.dfsg-5 i386 Web content engine library for Qt</pre><pre>ii libsamplerate0:i386 0.1.8-8 i386 Audio sample rate conversion library</pre><pre>ii libschroedinger-1.0-0:i386 1.0.11-2.1 i386 library for encoding/decoding of Dirac video streams</pre><pre>ii libselinux1:i386 2.4-3 i386 SELinux runtime shared libraries</pre><pre>ii libshine3:i386 3.1.0-2.1 i386 Fixed-point MP3 encoding library - runtime files</pre><pre>ii libsm6:i386 2:1.2.2-1+b1 i386 X11 Session Management library</pre><pre>ii libsnappy1v5:i386 1.1.3-2 i386 fast compression/decompression library</pre><pre>ii libsndfile1:i386 1.0.25-10 i386 Library for reading/writing audio files</pre><pre>ii libspeex1:i386 1.2~rc1.2-1 i386 The Speex codec runtime library</pre><pre>ii libspeexdsp1:i386 1.2~rc1.2-1 i386 The Speex extended runtime library</pre><pre>ii libsqlite3-0:i386 3.9.2-1 i386 SQLite 3 shared library</pre><pre>ii libssl1.0.0:i386 1.0.2d-1 i386 Secure Sockets Layer toolkit - shared libraries</pre><pre>ii libstdc++6:i386 5.2.1-23 i386 GNU Standard C++ Library v3</pre><pre>ii libswresample-ffmpeg1:i386 7:2.8.3-1 i386 FFmpeg library for audio resampling, rematrixing etc. - run</pre><pre>ii libsystemd0:i386 228-2 i386 systemd utility library</pre><pre>ii libtasn1-6:i386 4.7-2 i386 Manage ASN.1 structures (runtime)</pre><pre>ii libthai0:i386 0.1.24-1 i386 Thai language support library</pre><pre>ii libtheora0:i386 1.1.1+dfsg.1-7 i386 Theora Video Compression Codec</pre><pre>ii libtiff5:i386 4.0.5-1 i386 Tag Image File Format (TIFF) library</pre><pre>ii libtinfo5:i386 6.0+20151024-2 i386 shared low-level terminfo library for terminal handling</pre><pre>ii libtwolame0:i386 0.3.13-1.2 i386 MPEG Audio Layer 2 encoding library</pre><pre>ii libtxc-dxtn-s2tc0:i386 0~git20131104-1.1 i386 Texture compression library for Mesa</pre><pre>ii libudev1:i386 228-2 i386 libudev shared library</pre><pre>ii libuuid1:i386 2.27.1-1 i386 Universally Unique ID library</pre><pre>ii libva1:i386 1.6.1-1 i386 Video Acceleration (VA) API for Linux -- runtime</pre><pre>ii libvdpau1:i386 1.1.1-3 i386 Video Decode and Presentation API for Unix (libraries)</pre><pre>ii libvisual-0.4-0:i386 0.4.0-8 i386 audio visualization framework</pre><pre>ii libvorbis0a:i386 1.3.4-3 i386 decoder library for Vorbis General Audio Compression Codec</pre><pre>ii libvorbisenc2:i386 1.3.4-3 i386 encoder library for Vorbis General Audio Compression Codec</pre><pre>ii libvpx2:i386 1.4.0-4 i386 VP8 and VP9 video codec (shared library)</pre><pre>ii libwavpack1:i386 4.75.0-1 i386 audio codec (lossy and lossless) - library</pre><pre>ii libwebp5:i386 0.4.4-1 i386 Lossy compression of digital photographic images.</pre><pre>ii libwrap0:i386 7.6.q-25 i386 Wietse Venema's TCP wrappers library</pre><pre>ii libx11-6:i386 2:1.6.3-1 i386 X11 client-side library</pre><pre>ii libx11-xcb1:i386 2:1.6.3-1 i386 Xlib/XCB interface library</pre><pre>ii libx264-148:i386 2:0.148.2601+gita0 i386 x264 video coding library</pre><pre>ii libx265-68:i386 1.8-4 i386 H.265/HEVC video stream encoder (shared library)</pre><pre>ii libxau6:i386 1:1.0.8-1 i386 X11 authorisation library</pre><pre>ii libxcb-dri2-0:i386 1.10-3+b1 i386 X C Binding, dri2 extension</pre><pre>ii libxcb-dri3-0:i386 1.10-3+b1 i386 X C Binding, dri3 extension</pre><pre>ii libxcb-glx0:i386 1.10-3+b1 i386 X C Binding, glx extension</pre><pre>ii libxcb-present0:i386 1.10-3+b1 i386 X C Binding, present extension</pre><pre>ii libxcb-randr0:i386 1.10-3+b1 i386 X C Binding, randr extension</pre><pre>ii libxcb-render0:i386 1.10-3+b1 i386 X C Binding, render extension</pre><pre>ii libxcb-shape0:i386 1.10-3+b1 i386 X C Binding, shape extension</pre><pre>ii libxcb-shm0:i386 1.10-3+b1 i386 X C Binding, shm extension</pre><pre>ii libxcb-sync1:i386 1.10-3+b1 i386 X C Binding, sync extension</pre><pre>ii libxcb-xfixes0:i386 1.10-3+b1 i386 X C Binding, xfixes extension</pre><pre>ii libxcb1:i386 1.10-3+b1 i386 X C Binding</pre><pre>ii libxcomposite1:i386 1:0.4.4-1 i386 X11 Composite extension library</pre><pre>ii libxcursor1:i386 1:1.1.14-1+b1 i386 X cursor management library</pre><pre>ii libxdamage1:i386 1:1.1.4-2+b1 i386 X11 damaged region extension library</pre><pre>ii libxdmcp6:i386 1:1.1.2-1 i386 X11 Display Manager Control Protocol library</pre><pre>ii libxext6:i386 2:1.3.3-1 i386 X11 miscellaneous extension library</pre><pre>ii libxfixes3:i386 1:5.0.1-2+b2 i386 X11 miscellaneous 'fixes' extension library</pre><pre>ii libxi6:i386 2:1.7.5-1 i386 X11 Input extension library</pre><pre>ii libxinerama1:i386 2:1.1.3-1+b1 i386 X11 Xinerama extension library</pre><pre>ii libxrandr2:i386 2:1.5.0-1 i386 X11 RandR extension library</pre><pre>ii libxrender1:i386 1:0.9.9-2 i386 X Rendering Extension client library</pre><pre>ii libxshmfence1:i386 1.2-1 i386 X shared memory fences - shared library</pre><pre>ii libxss1:i386 1:1.2.2-1 i386 X11 Screen Saver extension library</pre><pre>ii libxt6:i386 1:1.1.5-1 i386 X11 toolkit intrinsics library</pre><pre>ii libxtst6:i386 2:1.2.2-1+b1 i386 X11 Testing -- Record extension library</pre><pre>ii libxv1:i386 2:1.0.10-1+b1 i386 X11 Video extension library</pre><pre>ii libxvidcore4:i386 2:1.3.4-1 i386 Open source MPEG-4 video codec (library)</pre><pre>ii libxxf86vm1:i386 1:1.1.4-1 i386 X11 XFree86 video mode extension library</pre><pre>ii libzvbi0:i386 0.2.35-10 i386 Vertical Blanking Interval decoder (VBI) - runtime files</pre><pre>ii skype:i386 4.3.0.37-1 i386 Wherever you are, wherever they are</pre><pre>ii va-driver-all:i386 1.6.1-1 i386 Video Acceleration (VA) API -- driver metapackage</pre><pre>ii vdpau-va-driver:i386 0.7.4-4 i386 VDPAU-based backend for VA API</pre><pre>ii zlib1g:i386 1:1.2.8.dfsg-2+b1 i386 compression library - runtime</pre><div><br></div><div>As you can see I have both gcc and libc installed for i386 and this programs works.</div><div>i think this probably happens that the compiler finds the i386 linker and thus looks for the i386 libs.</div><div><br></div><div>Can you please attach the link.res file?</div><div><pre>--
Cheers,
Abou Al Montacir</pre></div></body></html>