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 libc/21276] gettimeofday() segfaults when called before libc init() and before calling _dl_vdso_vsym()


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

--- Comment #2 from Vinitha Vijayan <Vinitha.Vijayann at gmail dot com> ---
I am tracing pthread library using Pthread Trace Tool
(http://nptltracetool.sourceforge.net/). The initialization of ptt tracing, is
done after pthread_initialization in the _init section. Here to get the
timestamp, gettimeofday() is called. HP-TIMING cannot be used here as ARM
doesn't support that.

 For earlier version of glibc, this was working fine.
 Since the  vdso support was enabled for gettimeofday, this SEGV is observed.

To test the threaded application, ptt daemon forks the application and preloads
the pthread library( with trace points enabled). 

So libpthread is getting initialized first.
Then the glibc init is called, after which the _dl_vdso_vsym() is called. 
So gettimeofday() is called before the _dl_vdso_vsym() is called to fixup
__vdso_gettimeofday.

Hope this is clear :(

-- 
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]