Successfully identified regression in *binutils* in CI configuration 
tcwg_bmk_llvm_apm/llvm-master-arm-spec2k6-Oz.  So far, this commit has 
regressed CI configurations:
 - tcwg_bmk_llvm_apm/llvm-master-arm-spec2k6-Oz

Culprit:
<cut>
commit f947f96797f8ec33aabf9cd7234c850778068445
Author: Tom de Vries <tdevr...@suse.de>
Date:   Mon Aug 30 14:34:03 2021 +0200

    [gdb/cli] Don't assert on empty string for core-file
    
    With current gdb we run into:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    pathstuff.cc:132: internal-error: \
      gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): \
      Assertion `path != NULL && path[0] != '\0'' failed.
    ...
    
    Fix this by skipping the call to gdb_abspath in core_target_open in the
    empty-string case, such that we have instead:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    : No such file or directory.
    $
    ...
    
    Tested on x86_64-linux.
    
    gdb/ChangeLog:
    
    2021-08-30  Tom de Vries  <tdevr...@suse.de>
    
            PR cli/28290
            * gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the
            empty-string case.
    
    gdb/testsuite/ChangeLog:
    
    2021-08-30  Tom de Vries  <tdevr...@suse.de>
    
            PR cli/28290
            * gdb.base/batch-exit-status.exp: Add gdb '' and gdb '' '' tests.
</cut>

Results regressed to (for first_bad == f947f96797f8ec33aabf9cd7234c850778068445)
# reset_artifacts:
-10
# build_abe binutils:
-9
# build_abe stage1 -- --set gcc_override_configure=--with-mode=thumb --set 
gcc_override_configure=--disable-libsanitizer:
-8
# build_abe linux:
-7
# build_abe glibc:
-6
# build_abe stage2 -- --set gcc_override_configure=--with-mode=thumb --set 
gcc_override_configure=--disable-libsanitizer:
-5
# build_llvm true:
-3
# true:
0
# benchmark -- -Oz_mthumb 
artifacts/build-f947f96797f8ec33aabf9cd7234c850778068445/results_id:
1
# 447.dealII,[.] contract<3>                                    regressed by 200

from (for last_good == 9b9b1092f0a8e6b7d240ea05a74968a883b8a05c)
# reset_artifacts:
-10
# build_abe binutils:
-9
# build_abe stage1 -- --set gcc_override_configure=--with-mode=thumb --set 
gcc_override_configure=--disable-libsanitizer:
-8
# build_abe linux:
-7
# build_abe glibc:
-6
# build_abe stage2 -- --set gcc_override_configure=--with-mode=thumb --set 
gcc_override_configure=--disable-libsanitizer:
-5
# build_llvm true:
-3
# true:
0
# benchmark -- -Oz_mthumb 
artifacts/build-9b9b1092f0a8e6b7d240ea05a74968a883b8a05c/results_id:
1

Artifacts of last_good build: 
https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_apm-llvm-master-arm-spec2k6-Oz/7/artifact/artifacts/build-9b9b1092f0a8e6b7d240ea05a74968a883b8a05c/
Results ID of last_good: 
apm_32/tcwg_bmk_llvm_apm/bisect-llvm-master-arm-spec2k6-Oz/4909
Artifacts of first_bad build: 
https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_apm-llvm-master-arm-spec2k6-Oz/7/artifact/artifacts/build-f947f96797f8ec33aabf9cd7234c850778068445/
Results ID of first_bad: 
apm_32/tcwg_bmk_llvm_apm/bisect-llvm-master-arm-spec2k6-Oz/4905
Build top page/logs: 
https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_apm-llvm-master-arm-spec2k6-Oz/7/

Configuration details:


Reproduce builds:
<cut>
mkdir investigate-binutils-f947f96797f8ec33aabf9cd7234c850778068445
cd investigate-binutils-f947f96797f8ec33aabf9cd7234c850778068445

git clone https://git.linaro.org/toolchain/jenkins-scripts

mkdir -p artifacts/manifests
curl -o artifacts/manifests/build-baseline.sh 
https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_apm-llvm-master-arm-spec2k6-Oz/7/artifact/artifacts/manifests/build-baseline.sh
 --fail
curl -o artifacts/manifests/build-parameters.sh 
https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_apm-llvm-master-arm-spec2k6-Oz/7/artifact/artifacts/manifests/build-parameters.sh
 --fail
curl -o artifacts/test.sh 
https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_apm-llvm-master-arm-spec2k6-Oz/7/artifact/artifacts/test.sh
 --fail
chmod +x artifacts/test.sh

# Reproduce the baseline build (build all pre-requisites)
./jenkins-scripts/tcwg_bmk-build.sh @@ artifacts/manifests/build-baseline.sh

# Save baseline build state (which is then restored in artifacts/test.sh)
mkdir -p ./bisect
rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ 
--exclude /binutils/ ./ ./bisect/baseline/

cd binutils

# Reproduce first_bad build
git checkout --detach f947f96797f8ec33aabf9cd7234c850778068445
../artifacts/test.sh

# Reproduce last_good build
git checkout --detach 9b9b1092f0a8e6b7d240ea05a74968a883b8a05c
../artifacts/test.sh

cd ..
</cut>

History of pending regressions and results: 
https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/ci/tcwg_bmk_llvm_apm/llvm-master-arm-spec2k6-Oz

Artifacts: 
https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_apm-llvm-master-arm-spec2k6-Oz/7/artifact/artifacts/
Build log: 
https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_apm-llvm-master-arm-spec2k6-Oz/7/consoleText

Full commit (up to 1000 lines):
<cut>
commit f947f96797f8ec33aabf9cd7234c850778068445
Author: Tom de Vries <tdevr...@suse.de>
Date:   Mon Aug 30 14:34:03 2021 +0200

    [gdb/cli] Don't assert on empty string for core-file
    
    With current gdb we run into:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    pathstuff.cc:132: internal-error: \
      gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): \
      Assertion `path != NULL && path[0] != '\0'' failed.
    ...
    
    Fix this by skipping the call to gdb_abspath in core_target_open in the
    empty-string case, such that we have instead:
    ...
    $ gdb -batch '' ''
    : No such file or directory.
    : No such file or directory.
    $
    ...
    
    Tested on x86_64-linux.
    
    gdb/ChangeLog:
    
    2021-08-30  Tom de Vries  <tdevr...@suse.de>
    
            PR cli/28290
            * gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the
            empty-string case.
    
    gdb/testsuite/ChangeLog:
    
    2021-08-30  Tom de Vries  <tdevr...@suse.de>
    
            PR cli/28290
            * gdb.base/batch-exit-status.exp: Add gdb '' and gdb '' '' tests.
---
 gdb/corelow.c                                | 3 ++-
 gdb/testsuite/gdb.base/batch-exit-status.exp | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/corelow.c b/gdb/corelow.c
index eb785a08633..711e86c4cd4 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -428,7 +428,8 @@ core_target_open (const char *arg, int from_tty)
     }
 
   gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));
-  if (!IS_ABSOLUTE_PATH (filename.get ()))
+  if (strlen (filename.get ()) != 0
+      && !IS_ABSOLUTE_PATH (filename.get ()))
     filename = gdb_abspath (filename.get ());
 
   flags = O_BINARY | O_LARGEFILE;
diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp 
b/gdb/testsuite/gdb.base/batch-exit-status.exp
index 085dfc6ad56..9a080196bd6 100644
--- a/gdb/testsuite/gdb.base/batch-exit-status.exp
+++ b/gdb/testsuite/gdb.base/batch-exit-status.exp
@@ -76,3 +76,7 @@ test_exit_status 1 "-batch -x $good_commands -x 
$bad_commands" \
     "-batch -x good-commands -x bad-commands"
 test_exit_status 1 "-batch -x $good_commands -ex \"set not-a-thing 4\"" \
     "-batch -x good-commands -ex \"set not-a-thing 4\""
+
+set no_such_re ": No such file or directory\\."
+test_exit_status 1 "-batch \"\"" $no_such_re
+test_exit_status 1 "-batch \"\" \"\"" [multi_line $no_such_re $no_such_re]
</cut>
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to