This is the mail archive of the 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

--- 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/ 
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
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
For bug reporting instructions, please see:

$ gcc -v
Using built-in specs.
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
--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
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 | grep timer_create”
> > for one of the 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 | grep timer_create
> (readelf instead of eu-readelf should work as well.)

eu-readelf -s /usr/lib64/ | grep timer_create
  106: 0000000000003ed0    135 FUNC    GLOBAL DEFAULT       14
  107: 0000000000003c50    625 FUNC    GLOBAL DEFAULT       14

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 timer.o
  527  gcc timer_test.c -L./ -o timer_test -ltimer -lrt
  528  ./timer_test 

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]