public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] Error out on empty debug section
  2019-01-01  0:00 [PATCH] Error out on empty debug section Tom de Vries
@ 2019-01-01  0:00 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2019-01-01  0:00 UTC (permalink / raw)
  To: Tom de Vries; +Cc: dwz

On Thu, Mar 07, 2019 at 08:05:11AM +0100, Tom de Vries wrote:
> Hi,
> 
> When encountering an empty debug section, we run into the following assert:
> ...
> dwz: dwz.c:9901: read_dwarf: Assertion `data != NULL && data->d_buf != NULL' \
>   failed.
> ...
> 
> Error out instead:
> ...
> dwz: a.out: Found empty .debug_gdb_scripts section, not attempting dwz \
>   compression
> ...
> 
> OK for trunk?
> 
> Thanks,
> - Tom
> 
> Error out on empty debug section
> 
> 2019-02-14  Tom de Vries  <tdevries@suse.de>
> 
> 	PR dwz/24173
> 	* dwz.c (read_dwarf): Change assert (data->d_buf != NULL) into an error.

Ok.

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] Error out on empty debug section
@ 2019-01-01  0:00 Tom de Vries
  2019-01-01  0:00 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

When encountering an empty debug section, we run into the following assert:
...
dwz: dwz.c:9901: read_dwarf: Assertion `data != NULL && data->d_buf != NULL' \
  failed.
...

Error out instead:
...
dwz: a.out: Found empty .debug_gdb_scripts section, not attempting dwz \
  compression
...

OK for trunk?

Thanks,
- Tom

Error out on empty debug section

2019-02-14  Tom de Vries  <tdevries@suse.de>

	PR dwz/24173
	* dwz.c (read_dwarf): Change assert (data->d_buf != NULL) into an error.

---
 dwz.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dwz.c b/dwz.c
index 4ef8657..fc87abe 100644
--- a/dwz.c
+++ b/dwz.c
@@ -9906,7 +9906,13 @@ read_dwarf (DSO *dso, bool quieter)
 
 		  scn = dso->scn[i];
 		  data = elf_rawdata (scn, NULL);
-		  assert (data != NULL && data->d_buf != NULL);
+		  assert (data != NULL);
+		  if (data->d_buf == NULL)
+		    {
+		      error (0, 0, "%s: Found empty %s section, not attempting"
+			     " dwz compression", dso->filename, name);
+		      return 1;
+		    }
 		  assert (elf_rawdata (scn, data) == NULL);
 		  assert (data->d_off == 0);
 		  assert (data->d_size == dso->shdr[i].sh_size);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-07  7:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [PATCH] Error out on empty debug section Tom de Vries
2019-01-01  0:00 ` Jakub Jelinek

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).