[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#822236: marked as done (vsyscall is not in effect in static linked executable on jessie)



Your message dated Sun, 11 Sep 2022 00:52:10 +0200
with message-id <Yx0VGt2HrWgYgD0n@aurel32.net>
and subject line Re: Bug#822236: vDSO is not in effect in static linked executable on jessie
has caused the Debian Bug report #822236,
regarding vsyscall is not in effect in static linked executable on jessie
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
822236: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822236
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: lib6
Version: 2.19-18+deb8u4
Severity: important

vDSO is not in effect in static linked executable on jessie. This is
not the case with wheezy.

We build binary to run on both wheezy and jessie, so -static. When
building platform is wheezy, vdso works fine, but jessie the opposite.

This leads to performance hit. Unfortunately, we use g++ 4.9 for some
application, so wheezy can't be used as build platform.

How to reproduce

$ cat t.c
#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/time.h>

int main()
{
        struct timeval now;
        gettimeofday(&now, NULL);
        printf("%d\n", now.tv_sec);
        printf("%d\n", time(NULL));
        return 0;
}

$ gcc -static t.c

$ strace ./a.out

>From output, you can see syscall gettimeofday() is called.

--- End Message ---
--- Begin Message ---
Version: 2.31-1

Hi,

On 2016-07-19 18:58, Aurelien Jarno wrote:
> control: retitle -1 vsyscall is not in effect in static linked executable on jessie
> thanks
> 
> On 2016-04-24 21:01, jian wang wrote:
> > On Sun, Apr 24, 2016 at 6:31 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > > control: tag -1 + moreinfo
> > >
> > > On 2016-04-22 11:11, Mattia Rizzolo wrote:
> > >> control: reassign -1 libc6  2.19-18+deb8u4
> > >>
> > >> On Fri, Apr 22, 2016 at 06:27:34PM +0800, jian wang wrote:
> > >> > Package: lib6
> > >>
> > >> lost a 'c' :)
> > >> reassigning.
> > >>
> > >> > Version: 2.19-18+deb8u4
> > >> > Severity: important
> > >> >
> > >> > vDSO is not in effect in static linked executable on jessie. This is
> > >> > not the case with wheezy.
> > >> >
> > >> > We build binary to run on both wheezy and jessie, so -static. When
> > >> > building platform is wheezy, vdso works fine, but jessie the opposite.
> > >> >
> > >> > This leads to performance hit. Unfortunately, we use g++ 4.9 for some
> > >> > application, so wheezy can't be used as build platform.
> > >
> > > There is not of information about your environment, so given what you
> > > describe, it seems you are using an i386 installation.
> > >
> > 
> > The context is for lots of servers. We use amd64 all over datacenters.
> > 
> > > The vDSO support requires at least a i686 CPU, while Debian i386 targets
> > > i586. When using dynamic linking, one can install libc6-i686 which
> > > provides an i686 optimized version of the libc, therefore with vDSO
> > > support. It is automatically loaded if the CPU supports it.
> > >
> > > In your case, given you use static linking, the i586 version of the libc
> > > is used, and it therefore doesn't support vDSO . That is true on wheezy,
> > > jessie, stretch, sid. I don't believe this is a regression, and in
> > > addition I can't reproduce it.
> > >
> > 
> > No.
> > 
> > We have looked into the code now.
> > 
> > Glibc 2.13 (wheezy) uses an asm version of gettimeofday.S for x86_64
> > which uses vDSO.
> 
> To be more precise, glibc 2.13 uses vDSO for shared builds and vsyscall
> for static ones.
> 
> > On the way up to glibc 2.19 (jessie), vDSO was rewritten into
> > gettimeofday.c. And as we dig out, Ulrich Drepper decided to not
> > optimize static linking, or even to dwarf static linking
> > 
> >     https://sourceware.org/bugzilla/show_bug.cgi?id=12813
> 
> vsyscalls are consider deprecated due to limitation and security
> consideration. I guess that the reason the vsyscall part of the code has
> been removed.

Support for vDSO in static binaries has been added in glibc 2.31.
Closing the bug accordingly.

Regards
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

--- End Message ---

Reply to: