From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Fix low-mem limit regression in multifile mode
Date: Tue, 01 Jan 2019 00:00:00 -0000 [thread overview]
Message-ID: <20191125143857.GA5228@delia> (raw)
Hi,
With the commit 639610d "Avoid unnecessary .debug_info section parsing", the
following regression was introduced:
...
$ cp hello 1; cp 1 2; dwz -l73 --devel-trace -m 3 1 2
Compressing 1
Write-multifile 1
Compressing 2
Write-multifile 2
Optimize-multifile
-Read-multifile
-Compressing 1 in finalize-multifile mode
-Compressing 2 in finalize-multifile mode
+Hit low-mem die-limit
...
The problem is in read_debug_info, in the condition for calling
try_debug_info, which uses !low_mem to avoid triggering clause
'estimated_nr_dies > low_mem_die_limit' in low_mem mode:
...
if (kind == DEBUG_INFO
&& ((multifile_mode == 0 && estimated_nr_dies > max_die_limit)
|| (!low_mem && estimated_nr_dies > low_mem_die_limit)))
{
int try_ret = try_debug_info (dso);
...
which results in triggering the clause in optimize_multifile mode.
Fix this by testing for multifile_mode == 0 instead of for !low_mem mode.
Committed to trunk.
Thanks,
- Tom
Fix low-mem limit regression in multifile mode
2019-11-25 Tom de Vries <tdevries@suse.de>
* dwz.c (read_debug_info): Don't call try_debug_info in
optimize-multifile mode.
* testsuite/dwz.tests/low-mem-die-limit-at-limit-multifile.sh: New
test.
---
dwz.c | 5 +++--
.../low-mem-die-limit-at-limit-multifile.sh | 23 ++++++++++++++++++++++
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/dwz.c b/dwz.c
index b80375d..c8e43b7 100644
--- a/dwz.c
+++ b/dwz.c
@@ -5043,8 +5043,9 @@ read_debug_info (DSO *dso, int kind)
unsigned int estimated_nr_dies = estimate_nr_dies ();
if (kind == DEBUG_INFO
- && ((multifile_mode == 0 && estimated_nr_dies > max_die_limit)
- || (!low_mem && estimated_nr_dies > low_mem_die_limit)))
+ && multifile_mode == 0
+ && (estimated_nr_dies > max_die_limit
+ || estimated_nr_dies > low_mem_die_limit))
{
int try_ret = try_debug_info (dso);
if (try_ret != 0)
diff --git a/testsuite/dwz.tests/low-mem-die-limit-at-limit-multifile.sh b/testsuite/dwz.tests/low-mem-die-limit-at-limit-multifile.sh
new file mode 100644
index 0000000..ece4fd5
--- /dev/null
+++ b/testsuite/dwz.tests/low-mem-die-limit-at-limit-multifile.sh
@@ -0,0 +1,23 @@
+cp $execs/hello 1
+cp 1 2
+
+count=$(readelf -wi 1 \
+ | grep '(DW_TAG' \
+ | wc -l)
+limit=$count
+
+if $execs/dwz-for-test \
+ -l$limit \
+ --devel-trace \
+ -m 3 1 2 \
+ 2> dwz.err; status=$?; then
+ true
+fi
+
+if grep -q "Hit low-mem die-limit" dwz.err; then
+ exit 1
+fi
+
+[ $status -eq 0 ]
+
+rm -f 1 2 3 dwz.err
reply other threads:[~2019-11-25 14:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191125143857.GA5228@delia \
--to=tdevries@suse.de \
--cc=dwz@sourceware.org \
--cc=jakub@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).