error when running "make bench"

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

error when running "make bench"

Zimmermann Paul
       Hi,

with git revision a8f0fc4, when running "make bench" on my machine
(x86_64 under Linux), I get just before the math tests start:

...
/bin/sh: 2: /tmp/glibc/build/benchtests/bench-timing-type: not found
Running /tmp/glibc/build/benchtests/bench-acos
Running /tmp/glibc/build/benchtests/bench-acosh
...

Is the "not found" message normal?

Best regards,
Paul Zimmermann
Reply | Threaded
Open this post in threaded view
|

Re: error when running "make bench"

Carlos O'Donell-6
On Wed, Jan 15, 2020 at 12:02 PM paul zimmermann
<[hidden email]> wrote:
> with git revision a8f0fc4, when running "make bench" on my machine

What branch has that commit?

> (x86_64 under Linux), I get just before the math tests start:
>
> ...
> /bin/sh: 2: /tmp/glibc/build/benchtests/bench-timing-type: not found

This is a binary that should have been built for you which returns the
timing type to use.

[carlos@athas glibc]$ /home/carlos/build/glibc/benchtests/bench-timing-type
hp_timing

> Running /tmp/glibc/build/benchtests/bench-acos
> Running /tmp/glibc/build/benchtests/bench-acosh
> ...
>
> Is the "not found" message normal?

No. It works just fine for me.

Cheers,
Carlos.

Reply | Threaded
Open this post in threaded view
|

Re: error when running "make bench"

Zimmermann Paul
       Dear Carlos,

> From: "Carlos O'Donell" <[hidden email]>
> Date: Wed, 15 Jan 2020 12:33:01 -0500
>
> On Wed, Jan 15, 2020 at 12:02 PM paul zimmermann
> <[hidden email]> wrote:
> > with git revision a8f0fc4, when running "make bench" on my machine
>
> What branch has that commit?

it is branch "master":

commit a8f0fc4e5fbad300d524a3339d503c41e3182ed0 (HEAD -> master, origin/master, origin/HEAD)
Author: Samuel Thibault <[hidden email]>
Date:   Mon Jan 13 20:41:07 2020 +0100

    htl: Add internal version of __pthread_mutex_timedlock
   
    The C11 threads implementation will need it.

> > (x86_64 under Linux), I get just before the math tests start:
> >
> > ...
> > /bin/sh: 2: /tmp/glibc/build/benchtests/bench-timing-type: not found
>
> This is a binary that should have been built for you which returns the
> timing type to use.
>
> [carlos@athas glibc]$ /home/carlos/build/glibc/benchtests/bench-timing-type
> hp_timing
>
> > Running /tmp/glibc/build/benchtests/bench-acos
> > Running /tmp/glibc/build/benchtests/bench-acosh
> > ...
> >
> > Is the "not found" message normal?
>
> No. It works just fine for me.

what is strange is that the file exists:

$ ls -l /tmp/glibc/build/benchtests/bench-timing-type
-rwxr-xr-x 1 zimmerma caramba 35760 Jan 16 07:48 /tmp/glibc/build/benchtests/bench-timing-type

$ file /tmp/glibc/build/benchtests/bench-timing-type
/tmp/glibc/build/benchtests/bench-timing-type: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /tmp/lib/ld-linux-x86-64.so.2, BuildID[sha1]=6eaee68beda7ba9d3a4e7c329d427b5c0676483d, for GNU/Linux 3.2.0, with debug_info, not stripped

however it does not want to run:

$ /tmp/glibc/build/benchtests/bench-timing-type
-bash: /tmp/glibc/build/benchtests/bench-timing-type: No such file or directory

Anyway this does not prevent "make bench" to run.

Paul Zimmermann
Reply | Threaded
Open this post in threaded view
|

Re: error when running "make bench"

Szabolcs Nagy-2
On 16/01/2020 06:57, paul zimmermann wrote:
> what is strange is that the file exists:
>
> $ ls -l /tmp/glibc/build/benchtests/bench-timing-type
> -rwxr-xr-x 1 zimmerma caramba 35760 Jan 16 07:48 /tmp/glibc/build/benchtests/bench-timing-type
>
> $ file /tmp/glibc/build/benchtests/bench-timing-type
> /tmp/glibc/build/benchtests/bench-timing-type: ELF 64-bit LSB shared object,
> x86-64, version 1 (SYSV), dynamically linked, interpreter /tmp/lib/ld-linux-x86-64.so.2,
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> BuildID[sha1]=6eaee68beda7ba9d3a4e7c329d427b5c0676483d, for GNU/Linux 3.2.0, with debug_info, not stripped
>
> however it does not want to run:
>
> $ /tmp/glibc/build/benchtests/bench-timing-type
> -bash: /tmp/glibc/build/benchtests/bench-timing-type: No such file or directory

that executable seems to be built with

 -Wl,-dynamic-linker=/tmp/lib/ld-linux-x86-64.so.2

which does not exist, you can quickly fix it now
by making that a symlink to wherever the dynamic
linker is (and set up runtime library paths where
libc.so.6 etc is)

but i think ideally your host toolchain should
not produce executables that cannot run.
Reply | Threaded
Open this post in threaded view
|

Re: error when running "make bench"

Zimmermann Paul
thank you Szabolcs, this solved the problem.

However, I believe the issue is on the glibc side. Indeed, the
bench-timing-type is linked with /tmp/lib/ld-linux-x86-64.so.2
by the glibc Makefile, and that file doesn't exist if "make install"
was not done (I configured with ./configure --prefix=/tmp).

Thus either benchtests/README should indicate that "make install" should
be done, or the compile line for bench-timing-type should not link with
files in $PREFIX.

To reproduce:

$ git clone git://sourceware.org/git/glibc.git
$ cd glibc
$ mkdir build
$ cd build
$ ../configure --prefix=/tmp
$ make -j4
$ make bench

Best regards,
Paul

> From: Szabolcs Nagy <[hidden email]>
> CC: nd <[hidden email]>, "[hidden email]" <[hidden email]>
> Thread-Topic: error when running "make bench"
> Thread-Index: AQHVy8STAjP+xHdPFUeTg1WXkdE96Kfr/CKAgADg6e+AACnCAA==
> Date: Thu, 16 Jan 2020 09:27:36 +0000
> user-agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101
>  Thunderbird/60.9.0
> nodisclaimer: True
> Original-Authentication-Results: spf=none (sender IP is )
>  smtp.mailfrom=[hidden email];
>
> On 16/01/2020 06:57, paul zimmermann wrote:
> > what is strange is that the file exists:
> >
> > $ ls -l /tmp/glibc/build/benchtests/bench-timing-type
> > -rwxr-xr-x 1 zimmerma caramba 35760 Jan 16 07:48 /tmp/glibc/build/benchtests/bench-timing-type
> >
> > $ file /tmp/glibc/build/benchtests/bench-timing-type
> > /tmp/glibc/build/benchtests/bench-timing-type: ELF 64-bit LSB shared object,
> > x86-64, version 1 (SYSV), dynamically linked, interpreter /tmp/lib/ld-linux-x86-64.so.2,
>                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > BuildID[sha1]=6eaee68beda7ba9d3a4e7c329d427b5c0676483d, for GNU/Linux 3.2.0, with debug_info, not stripped
> >
> > however it does not want to run:
> >
> > $ /tmp/glibc/build/benchtests/bench-timing-type
> > -bash: /tmp/glibc/build/benchtests/bench-timing-type: No such file or directory
>
> that executable seems to be built with
>
>  -Wl,-dynamic-linker=/tmp/lib/ld-linux-x86-64.so.2
>
> which does not exist, you can quickly fix it now
> by making that a symlink to wherever the dynamic
> linker is (and set up runtime library paths where
> libc.so.6 etc is)
>
> but i think ideally your host toolchain should
> not produce executables that cannot run.
Reply | Threaded
Open this post in threaded view
|

Re: error when running "make bench"

Joseph Myers
On Thu, 16 Jan 2020, paul zimmermann wrote:

> thank you Szabolcs, this solved the problem.
>
> However, I believe the issue is on the glibc side. Indeed, the
> bench-timing-type is linked with /tmp/lib/ld-linux-x86-64.so.2
> by the glibc Makefile, and that file doesn't exist if "make install"
> was not done (I configured with ./configure --prefix=/tmp).

The normal configuration people generally test with has --prefix=/usr.

However, what this indicates to me is that the call of $(timing-type)
needs to use $(test-via-rtld-prefix).  Does this (untested) patch help in
your configuration using --prefix=/tmp?


Run bench-timing-type with newly built libc.

benchtests/timing-type is built with the newly built libc, so should
be run with it like actual tests and benchmarks.

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 99c3fae9bf..71b9565fed 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -217,7 +217,10 @@ bench-malloc: $(binaries-bench-malloc)
 # capable language or tool.
 bench-func: $(binaries-bench)
  if [ -n '$^' ] ; then \
- { timing_type=$$($(timing-type)); \
+ { timing_type=$$($(test-wrapper-env) \
+ $(run-program-env) \
+ $(test-via-rtld-prefix) \
+ $(timing-type)); \
   echo "{\"timing_type\": \"$${timing_type}\","; \
   echo " \"functions\": {"; \
   for run in $^; do \

--
Joseph S. Myers
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: error when running "make bench"

Zimmermann Paul
       Dear Joseph,

> Date: Thu, 16 Jan 2020 16:31:05 +0000
> From: Joseph Myers <[hidden email]>
>
> On Thu, 16 Jan 2020, paul zimmermann wrote:
>
> > thank you Szabolcs, this solved the problem.
> >
> > However, I believe the issue is on the glibc side. Indeed, the
> > bench-timing-type is linked with /tmp/lib/ld-linux-x86-64.so.2
> > by the glibc Makefile, and that file doesn't exist if "make install"
> > was not done (I configured with ./configure --prefix=/tmp).
>
> The normal configuration people generally test with has --prefix=/usr.
>
> However, what this indicates to me is that the call of $(timing-type)
> needs to use $(test-via-rtld-prefix).  Does this (untested) patch help in
> your configuration using --prefix=/tmp?
>
>
> Run bench-timing-type with newly built libc.
>
> benchtests/timing-type is built with the newly built libc, so should
> be run with it like actual tests and benchmarks.
>
> diff --git a/benchtests/Makefile b/benchtests/Makefile
> index 99c3fae9bf..71b9565fed 100644
> --- a/benchtests/Makefile
> +++ b/benchtests/Makefile
> @@ -217,7 +217,10 @@ bench-malloc: $(binaries-bench-malloc)
>  # capable language or tool.
>  bench-func: $(binaries-bench)
>   if [ -n '$^' ] ; then \
> - { timing_type=$$($(timing-type)); \
> + { timing_type=$$($(test-wrapper-env) \
> + $(run-program-env) \
> + $(test-via-rtld-prefix) \
> + $(timing-type)); \
>    echo "{\"timing_type\": \"$${timing_type}\","; \
>    echo " \"functions\": {"; \
>    for run in $^; do \

yes this patch solves the issue.

Paul
Reply | Threaded
Open this post in threaded view
|

Re: error when running "make bench"

Joseph Myers
On Sat, 18 Jan 2020, paul zimmermann wrote:

> yes this patch solves the issue.

Siddhesh, is this patch
<https://sourceware.org/ml/libc-alpha/2020-01/msg00346.html> OK for the
current development stage?

--
Joseph S. Myers
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: error when running "make bench"

Siddhesh Poyarekar-9


On 20/01/20 4:53 pm, Joseph Myers wrote:
> On Sat, 18 Jan 2020, paul zimmermann wrote:
>
>> yes this patch solves the issue.
>
> Siddhesh, is this patch
> <https://sourceware.org/ml/libc-alpha/2020-01/msg00346.html> OK for the
> current development stage?
>

Yes, this patch is OK for master.

Thanks,
Siddhesh