Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Readline bug causes GDB crash on 64-bit
@ 2006-10-20 21:10 Ulrich Weigand
  2006-10-20 21:30 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ulrich Weigand @ 2006-10-20 21:10 UTC (permalink / raw)
  To: gdb-patches

Hello,

GDB on s390x (64-bit) is crashing when you press ctrl-V.
This is because xmalloc is used without prototype in scope
in _rl_callback_data_alloc (readline/callback.c), and thus
the returned pointer is improperly truncated/extended.

Fixed by including "xmalloc.h".  Tested on s390x-ibm-linux.

What's the policy for readline bugs in GDB?  It is OK to check
this patch into GDB, or does it have to go upstream first?
(Where is readline upstream?)

Bye,
Ulrich


ChangeLog:

	* callback.c: Include "xmalloc.h".
	* Makefile.in: Add dependency.


Index: readline/Makefile.in
===================================================================
RCS file: /cvs/src/src/readline/Makefile.in,v
retrieving revision 1.7
diff -c -p -r1.7 Makefile.in
*** readline/Makefile.in	5 May 2006 18:26:12 -0000	1.7
--- readline/Makefile.in	20 Oct 2006 20:48:49 -0000
*************** util.o: rlprivate.h
*** 446,451 ****
--- 446,452 ----
  vi_mode.o: rlprivate.h
  
  bind.o: xmalloc.h
+ callback.o: xmalloc.h
  complete.o: xmalloc.h
  display.o: xmalloc.h
  funmap.o: xmalloc.h
Index: readline/callback.c
===================================================================
RCS file: /cvs/src/src/readline/callback.c,v
retrieving revision 1.6
diff -c -p -r1.6 callback.c
*** readline/callback.c	5 May 2006 18:26:12 -0000	1.6
--- readline/callback.c	20 Oct 2006 20:48:49 -0000
***************
*** 43,48 ****
--- 43,49 ----
  #include "rldefs.h"
  #include "readline.h"
  #include "rlprivate.h"
+ #include "xmalloc.h"
  
  /* Private data for callback registration functions.  See comments in
     rl_callback_read_char for more details. */
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


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

end of thread, other threads:[~2006-10-21 20:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-20 21:10 [PATCH] Readline bug causes GDB crash on 64-bit Ulrich Weigand
2006-10-20 21:30 ` Andreas Schwab
2006-10-20 21:36   ` Daniel Jacobowitz
2006-10-20 21:32 ` Daniel Jacobowitz
2006-10-21  2:56   ` Chet Ramey
2006-10-21  5:15 ` Daniel Jacobowitz
2006-10-21 20:48   ` Ulrich Weigand

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