This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug librt/20489] timer_create in compatibility mode on a 64bit big-endian system segfaults


https://sourceware.org/bugzilla/show_bug.cgi?id=20489

--- Comment #8 from ian.merin at thalesesec dot com ---
I have tested this on multiple systems with multiple architectures and
different versions of glibc with the same result.  

When using dynamic linking, I cannot avoid using __timer_create_old.  timer_id
remains an integer inside to a void * that happens to work because the system
is little endian.

My latest test was done on the following system:

4.5.4-1-ARCH #1 SMP PREEMPT Wed May 11 22:21:28 CEST 2016 x86_64 GNU/Linux

$ /usr/lib64/libc.so.6 
GNU C Library (GNU libc) stable release version 2.23, by Roland McGrath et al.
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 6.1.1 20160501.
Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<https://bugs.archlinux.org/>.

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --disable-multilib --disable-werror
--enable-checking=release
Thread model: posix
gcc version 6.1.1 20160501 (GCC)(In reply to Florian Weimer from comment #7)
> (In reply to Florian Weimer from comment #6)
> > Please show us the output of “eu-readelf -s libc.so.6 | grep timer_create”
> > for one of the librt.so.1 files.
> > 
> > Do you use dlsym?
> > 
> > Can you post a small example which reproduces the issue, together with the
> > commands you use to compile it?
> 
> To clarify, the command should be this:
> 
>   eu-readelf -s librt.so.1 | grep timer_create
> 
> (readelf instead of eu-readelf should work as well.)

eu-readelf -s /usr/lib64/librt.so.1 | grep timer_create
  106: 0000000000003ed0    135 FUNC    GLOBAL DEFAULT       14
timer_create@GLIBC_2.2.5
  107: 0000000000003c50    625 FUNC    GLOBAL DEFAULT       14
timer_create@@GLIBC_2.3.3

I'll attach the smallest a stripped down version of the code and compiler
options that produced this issue.


  524  gcc -c -fPIC timer.c 
  525  gcc -shared -o libtimer.so timer.o
  527  gcc timer_test.c -L./ -o timer_test -ltimer -lrt
  528  ./timer_test 

outputs:
timer ID is 0x0
timer ID is 0x1
timer ID is 0x2

expect timer_id to be a pointer (this is a little_endian machine so the integer
value appears correct)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]