This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Readline bug causes GDB crash on 64-bit


On Fri, Oct 20, 2006 at 11:10:43PM +0200, Ulrich Weigand wrote:
> 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?)

The right thing to do is to send the patch to Chet, and if he accepts
it for the next readline release, commit it to our copy.  I believe
bash-maintainers@gnu.org (CC'd) is the right place.

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

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]