Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* A fix for bug 13259 - gdb sometimes crashes with SIGSEGV when printing variables
@ 2011-10-05 14:07 Martin Runge
  2011-10-05 15:02 ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Runge @ 2011-10-05 14:07 UTC (permalink / raw)
  To: gdb-patches

Hello together,
here is a possible fix for a gdb crash I just filed as bug 13259:


--- a/gdb/varobj.c      Wed Sep 28 12:36:27 2011 +0200
+++ b/gdb/varobj.c      Wed Oct 05 15:53:04 2011 +0200
@@ -2640,7 +2640,7 @@
   opts.raw = 1;
   if (thevalue)
     LA_PRINT_STRING (stb, type, thevalue, len, encoding, 0, &opts);
-  else if (string_print)
+  else if (string_print && type != NULL)
     val_print_string (type, encoding, str_addr, len, stb, &opts);
   else
     common_val_print (value, stb, 0, &opts, current_language);


I observed the "type" parameter beeing NULL _and_ "string_print" !=0
several times, which leads to a SIGSEGV inside val_print_string.

Maybe the cause is a few lines earlier in the same function
(value_get_print_value), where string_print is set to 1 without having
resolved "type".

best regards
Martin


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

* Re: A fix for bug 13259 - gdb sometimes crashes with SIGSEGV when printing variables
  2011-10-05 14:07 A fix for bug 13259 - gdb sometimes crashes with SIGSEGV when printing variables Martin Runge
@ 2011-10-05 15:02 ` Joel Brobecker
  2011-10-05 15:11   ` Martin Runge
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2011-10-05 15:02 UTC (permalink / raw)
  To: Martin Runge; +Cc: gdb-patches

> here is a possible fix for a gdb crash I just filed as bug 13259:

Have you seen the request to test again with the HEAD? It appears
a recent change may have fixed your problem.

Also, could you check if you could attach the patches instead of
putting them in the email body? The patch shows up with a lot \240
in lieu of the spaces, and that makes it very hard to read...

-- 
Joel


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

* Re: A fix for bug 13259 - gdb sometimes crashes with SIGSEGV when printing variables
  2011-10-05 15:02 ` Joel Brobecker
@ 2011-10-05 15:11   ` Martin Runge
  2011-10-06 13:27     ` Martin Runge
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Runge @ 2011-10-05 15:11 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

I will test with HEAD tomorrow. I am behind a firewall right now and
cannot reach cvs head.



2011/10/5 Joel Brobecker <brobecker@adacore.com>:
>> here is a possible fix for a gdb crash I just filed as bug 13259:
>
> Have you seen the request to test again with the HEAD? It appears
> a recent change may have fixed your problem.
>
> Also, could you check if you could attach the patches instead of
> putting them in the email body? The patch shows up with a lot \240
> in lieu of the spaces, and that makes it very hard to read...
>
> --
> Joel
>

[-- Attachment #2: bug13259.patch --]
[-- Type: text/x-patch, Size: 466 bytes --]

diff -r 3667782d0071 gdb/varobj.c
--- a/gdb/varobj.c	Wed Sep 28 12:36:27 2011 +0200
+++ b/gdb/varobj.c	Wed Oct 05 15:53:47 2011 +0200
@@ -2640,7 +2640,7 @@
   opts.raw = 1;
   if (thevalue)
     LA_PRINT_STRING (stb, type, thevalue, len, encoding, 0, &opts);
-  else if (string_print)
+  else if (string_print && type != NULL)
     val_print_string (type, encoding, str_addr, len, stb, &opts);
   else
     common_val_print (value, stb, 0, &opts, current_language);

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

* Re: A fix for bug 13259 - gdb sometimes crashes with SIGSEGV when printing variables
  2011-10-05 15:11   ` Martin Runge
@ 2011-10-06 13:27     ` Martin Runge
  2011-10-06 18:37       ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Runge @ 2011-10-06 13:27 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

I just tried it with CVS head: gdb does not crash any more.

What will be the base for the next release then, 7.3.50 (contains the
bug) or CVS head?

best regards
Martin


2011/10/5 Martin Runge <martin.runge@web.de>:
> I will test with HEAD tomorrow. I am behind a firewall right now and
> cannot reach cvs head.
>
>
>
> 2011/10/5 Joel Brobecker <brobecker@adacore.com>:
>>> here is a possible fix for a gdb crash I just filed as bug 13259:
>>
>> Have you seen the request to test again with the HEAD? It appears
>> a recent change may have fixed your problem.
>>
>> Also, could you check if you could attach the patches instead of
>> putting them in the email body? The patch shows up with a lot \240
>> in lieu of the spaces, and that makes it very hard to read...
>>
>> --
>> Joel
>>
>


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

* Re: A fix for bug 13259 - gdb sometimes crashes with SIGSEGV when printing variables
  2011-10-06 13:27     ` Martin Runge
@ 2011-10-06 18:37       ` Joel Brobecker
  0 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2011-10-06 18:37 UTC (permalink / raw)
  To: Martin Runge; +Cc: gdb-patches

> What will be the base for the next release then, 7.3.50 (contains the
> bug) or CVS head?

A priori, the plan for the next release is to make a 7.4. So the fix
should be in that release.

-- 
Joel


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

end of thread, other threads:[~2011-10-06 18:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-05 14:07 A fix for bug 13259 - gdb sometimes crashes with SIGSEGV when printing variables Martin Runge
2011-10-05 15:02 ` Joel Brobecker
2011-10-05 15:11   ` Martin Runge
2011-10-06 13:27     ` Martin Runge
2011-10-06 18:37       ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox