Created attachment 15023 [details] gprofng.log The 'tmpdir/gp-collect-app_F' test fails for me with binutils-2.41. ``` Running /var/tmp/portage/sys-devel/binutils-2.41/work/binutils-2.41/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp ... mkdir -p tmpdir/gp-collect-app_F % timeout 300 sh -c 'mkdir -p tmpdir/gp-collect-app_F' 2>&1 cd tmpdir/gp-collect-app_F && /var/tmp/portage/sys-devel/binutils-2.41/work/build/gprofng/src/gprofng collect app -p on -a off -F 'off' -O exp.er sh -c 'mkdir t && touch t/x; rm -rf t' % timeout 300 sh -c 'cd tmpdir/gp-collect-app_F && /var/tmp/portage/sys-devel/binutils-2.41/work/build/gprofng/src/gprofng collect app -p on -a off -F 'off' -O exp.er sh -c 'mkdir t && touch t/x; rm -rf t' ' 2>&1 find tmpdir/gp-collect-app_F -name '*x1.er' | wc -l % timeout 300 sh -c 'find tmpdir/gp-collect-app_F -name '*x1.er' | wc -l' 2>&1 cd tmpdir/gp-collect-app_F && /var/tmp/portage/sys-devel/binutils-2.41/work/build/gprofng/src/gprofng collect app -p on -a off -F 'on' -O exp.er sh -c 'mkdir t && touch t/x; rm -rf t' % timeout 300 sh -c 'cd tmpdir/gp-collect-app_F && /var/tmp/portage/sys-devel/binutils-2.41/work/build/gprofng/src/gprofng collect app -p on -a off -F 'on' -O exp.er sh -c 'mkdir t && touch t/x; rm -rf t' ' 2>&1 find tmpdir/gp-collect-app_F -name '*x1.er' | wc -l % timeout 300 sh -c 'find tmpdir/gp-collect-app_F -name '*x1.er' | wc -l' 2>&1 Test failed for -F on. subExp=1. Shold be 3 FAIL: tmpdir/gp-collect-app_F testcase /var/tmp/portage/sys-devel/binutils-2.41/work/binutils-2.41/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp completed in 1 seconds ```
Reported by doko as well at https://inbox.sourceware.org/binutils/86e6e812-4968-cd28-0c1c-6a38a053c404@debian.org/.
It looks like libpthread has a new version number for pthread_create. What is an output of `nm /usr/lib/libpthread.so | grep pthread_create` on your machine.
$ nm /usr/lib/x86_64-linux-gnu/libpthread.so.0 nm: /usr/lib/x86_64-linux-gnu/libpthread.so.0: no symbols glibc 2.37, there is no libpthread.so anymore.
Use the -D flag: % nm -D /usr/lib/x86_64-linux-gnu/libpthread.so.0 | grep pthread_create
$ nm -D /usr/lib/x86_64-linux-gnu/libpthread.so.0 w __cxa_finalize@GLIBC_2.2.5 0000000000000000 A GLIBC_2.11 0000000000000000 A GLIBC_2.12 0000000000000000 A GLIBC_2.18 0000000000000000 A GLIBC_2.2.5 0000000000000000 A GLIBC_2.2.6 0000000000000000 A GLIBC_2.28 0000000000000000 A GLIBC_2.30 0000000000000000 A GLIBC_2.31 0000000000000000 A GLIBC_2.3.2 0000000000000000 A GLIBC_2.3.3 0000000000000000 A GLIBC_2.3.4 0000000000000000 A GLIBC_2.4 w __gmon_start__ w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.28 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.11 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.4 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.2.5 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.30 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.3.3 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.12 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.18 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.31 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.2.6 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.3.4 0000000000001100 T __libpthread_version_placeholder@GLIBC_2.3.2
$ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep pthread_create 0000000000088580 T pthread_create@GLIBC_2.2.5 0000000000088580 T pthread_create@@GLIBC_2.34
We should OK with this libc. What version of Linux are you using? I will try to reproduce the problem tomorrow.
these are the current Debian and Ubuntu development versions.
Gentoo here. I can give you a Dockerfile or something if you can't reproduce. Just let me know.
This test tests the -F option (-F on, -F off, -F <regexp>). The test profiles this command: sh -c 'mkdir t && touch t/x; rm -rf t' and looks at how many sub-experiments have been created. The test uses `find $tdir -name '*x1.er' | wc -l` to count sub-experiments. This is wrong in Debian. In RH/OL, sh runs fork() -> exec() for each command. In this case, gprofng creates these sub-experiments: % ls -1d tmpdir/gp-collect-app_F/exp.er/*er tmpdir/gp-collect-app_F/exp.er/_f1_x0_x1.er tmpdir/gp-collect-app_F/exp.er/_f2_x0_x1.er tmpdir/gp-collect-app_F/exp.er/_f3_x0_x1.er In Debian, sh runs vfork() -> exec(). In this case, gprofng creates these sub-experiments: % ls -1d tmpdir/gp-collect-app_F/exp.er/*er tmpdir/gp-collect-app_F/exp.er/_x1.er tmpdir/gp-collect-app_F/exp.er/_x2.er tmpdir/gp-collect-app_F/exp.er/_x3.er Proposed fix: % git diff diff --git a/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp b/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp index f791b0f7a95..02bcc8e5b49 100644 --- a/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp +++ b/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp @@ -46,11 +46,11 @@ proc run_gp_collect_app { subExpCnt F_opt } { return -code break } - set output [run_native_host_cmd "find $tdir -name '*x1.er' | wc -l"] + set output [run_native_host_cmd "find $tdir -name '*_x?.er' | wc -l"] set subExp [lindex $output 1] if { $subExp != $subExpCnt } then { set out [lindex $output 1] - send_log "Test failed for -F $F_opt. subExp=$subExp. Shold be $subExpCnt\n" + send_log "Test failed for -F $F_opt. subExp=$subExp. Should be $subExpCnt\n" fail $tdir return -code break }
that patch fixes the issue for me
https://inbox.sourceware.org/binutils/20230803203339.822435-1-vladimir.mezentsev@oracle.com/ works for me too, thanks!
The master branch has been updated by Vladimir Mezentsev <vmezents@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e0282cf1284b4d358892427a6b4f60d6f4c0580b commit e0282cf1284b4d358892427a6b4f60d6f4c0580b Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com> Date: Thu Aug 3 12:56:54 2023 -0700 gprofng: 30700 tmpdir/gp-collect-app_F test fails gprofng/ChangeLog 2023-08-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/30700 * testsuite/gprofng.display/gp-collect-app_F.exp: Fix -name argument for sub-experiment filtering.
Update status as resolved/fixed.
The binutils-2_41-branch branch has been updated by Sam James <sjames@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1ce656c66f1859d0f6066e0f9064033712e37aea commit 1ce656c66f1859d0f6066e0f9064033712e37aea Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com> Date: Thu Aug 3 12:56:54 2023 -0700 gprofng: 30700 tmpdir/gp-collect-app_F test fails gprofng/ChangeLog 2023-08-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/30700 * testsuite/gprofng.display/gp-collect-app_F.exp: Fix -name argument for sub-experiment filtering. (cherry picked from commit e0282cf1284b4d358892427a6b4f60d6f4c0580b)