Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Do not pass NULL for the string in catch_errors
@ 2015-09-09 14:45 Luis Machado
  2015-09-10 13:16 ` Pedro Alves
  0 siblings, 1 reply; 10+ messages in thread
From: Luis Machado @ 2015-09-09 14:45 UTC (permalink / raw)
  To: gdb-patches

I caught a segmentation fault while running gdb.reverse/sigall-reverse.exp,
in a mingw32 GDB, in this code path. It boils down to the code trying to
strlen () a NULL pointer. I tracked things down and it looks like
record_full_message_wrapper_safe is the only occurrence.

We could also change catch_errors to check the char pointer and pass the
empty string automatically if the pointer is NULL. Then again, it seems like
catch_errors is going away at any time now, being potentially replaced
with catch_exceptions.

For now, though, the attach fix seems to accomplish the job.

Does that look reasonable?

gdb/ChangeLog:

2015-09-09  Luis Machado  <lgustavo@codesourcery.com>

	* record-full.c (record_full_message_wrapper_safe): Do not pass
	NULL to string parameter in catch_errors.
---
 gdb/record-full.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/record-full.c b/gdb/record-full.c
index 06bfdb8..15941c6 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -666,7 +666,7 @@ record_full_message_wrapper_safe (struct regcache *regcache,
   args.regcache = regcache;
   args.signal = signal;
 
-  return catch_errors (record_full_message_wrapper, &args, NULL,
+  return catch_errors (record_full_message_wrapper, &args, "",
 		       RETURN_MASK_ALL);
 }
 
-- 
1.9.1


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

end of thread, other threads:[~2015-10-26 13:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-09 14:45 [PATCH] Do not pass NULL for the string in catch_errors Luis Machado
2015-09-10 13:16 ` Pedro Alves
2015-10-21 11:19   ` Luis Machado
2015-10-22 13:39     ` Pedro Alves
2015-10-22 13:39       ` Luis Machado
2015-10-22 13:39         ` Pedro Alves
2015-10-22 13:39           ` Luis Machado
2015-10-22 15:00             ` Pedro Alves
2015-10-24 22:39               ` Luis Machado
2015-10-26 16:30                 ` Luis Machado

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