From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18314 invoked by alias); 20 Oct 2006 21:10:52 -0000 Received: (qmail 18305 invoked by uid 22791); 20 Oct 2006 21:10:52 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 20 Oct 2006 21:10:48 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id k9KLAiuu286426 for ; Fri, 20 Oct 2006 21:10:44 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k9KLDKvd2531504 for ; Fri, 20 Oct 2006 23:13:20 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k9KLAiFd002488 for ; Fri, 20 Oct 2006 23:10:44 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id k9KLAiFL002481 for ; Fri, 20 Oct 2006 23:10:44 +0200 Message-Id: <200610202110.k9KLAiFL002481@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 20 Oct 2006 23:10:43 +0200 Subject: [PATCH] Readline bug causes GDB crash on 64-bit To: gdb-patches@sourceware.org Date: Fri, 20 Oct 2006 21:10:00 -0000 From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00260.txt.bz2 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