* [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* Re: [PATCH] Readline bug causes GDB crash on 64-bit
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 5:15 ` Daniel Jacobowitz
2 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2006-10-20 21:30 UTC (permalink / raw)
To: Ulrich Weigand; +Cc: gdb-patches
"Ulrich Weigand" <uweigand@de.ibm.com> writes:
> 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?
Upstream does not have this bug any more.
> (Where is readline upstream?)
bash
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Readline bug causes GDB crash on 64-bit
2006-10-20 21:30 ` Andreas Schwab
@ 2006-10-20 21:36 ` Daniel Jacobowitz
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2006-10-20 21:36 UTC (permalink / raw)
To: Andreas Schwab, Ulrich Weigand, gdb-patches, bash-maintainers
Oops, didn't see Andreas's reply before I sent mine...
On Fri, Oct 20, 2006 at 11:30:15PM +0200, Andreas Schwab wrote:
> "Ulrich Weigand" <uweigand@de.ibm.com> writes:
>
> > 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?
>
> Upstream does not have this bug any more.
I guess we ought to import readline 5.2 sometime.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Readline bug causes GDB crash on 64-bit
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:32 ` Daniel Jacobowitz
2006-10-21 2:56 ` Chet Ramey
2006-10-21 5:15 ` Daniel Jacobowitz
2 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2006-10-20 21:32 UTC (permalink / raw)
To: Ulrich Weigand; +Cc: gdb-patches, bash-maintainers
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Readline bug causes GDB crash on 64-bit
2006-10-20 21:32 ` Daniel Jacobowitz
@ 2006-10-21 2:56 ` Chet Ramey
0 siblings, 0 replies; 7+ messages in thread
From: Chet Ramey @ 2006-10-21 2:56 UTC (permalink / raw)
To: Ulrich Weigand, gdb-patches; +Cc: chet
Daniel Jacobowitz wrote:
> 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.
Either that address or bug-readline@gnu.org will work. But in this
case, someone beat you to it, and the fix is in the recently-released
readline-5.2.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Readline bug causes GDB crash on 64-bit
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:32 ` Daniel Jacobowitz
@ 2006-10-21 5:15 ` Daniel Jacobowitz
2006-10-21 20:48 ` Ulrich Weigand
2 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2006-10-21 5:15 UTC (permalink / raw)
To: gdb-patches
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?)
I don't want to mess with a readline import just now. So, unless you
want to try it, this patch is fine for now.
--
Daniel Jacobowitz
CodeSourcery
^ 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