From patchwork Wed Mar 25 13:59:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "ir. Tjeerd Pinkert" X-Patchwork-Id: 454404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 84D9E14009B for ; Thu, 26 Mar 2015 00:59:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E6FBD33820; Wed, 25 Mar 2015 13:59:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pkBR8dRLviA0; Wed, 25 Mar 2015 13:59:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3A688337D7; Wed, 25 Mar 2015 13:59:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id DE2DF1BF992 for ; Wed, 25 Mar 2015 13:59:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D69408D503 for ; Wed, 25 Mar 2015 13:59:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NxzrmLXs+RML for ; Wed, 25 Mar 2015 13:59:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailin.vu.nl (mailin.vu.nl [130.37.164.18]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6950E91DDD for ; Wed, 25 Mar 2015 13:59:32 +0000 (UTC) Received: from PEXHB012B.vu.local (130.37.236.67) by mailin.vu.nl (130.37.164.18) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 25 Mar 2015 14:59:26 +0100 Received: from [145.108.172.20] (130.37.253.20) by mails.vu.nl (130.37.236.67) with Microsoft SMTP Server id 14.3.224.2; Wed, 25 Mar 2015 14:59:28 +0100 Message-ID: <5512BF40.5000702@vu.nl> Date: Wed, 25 Mar 2015 14:59:28 +0100 From: "ir. Tjeerd Pinkert" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-Version: 1.0 To: Gustavo Zacarias , "buildroot@busybox.net" , , References: <55116D12.1000106@vu.nl> <5511B114.60704@case.edu> <20150325003203.GL10761@vapier> <5512940B.60808@vu.nl> <5512B650.1020006@zacarias.com.ar> In-Reply-To: <5512B650.1020006@zacarias.com.ar> X-Originating-IP: [130.37.253.20] Subject: Re: [Buildroot] [Bug-readline] IPython/readline segfaults X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" On 25-03-15 14:21, Gustavo Zacarias wrote: > On 03/25/2015 07:55 AM, ir. Tjeerd Pinkert wrote: > >> Thanks, indeed, buildroot 2015.02 has 6.3 with no patches, although it >> downloads the latest tar file. I'm trying to see if patching helps. > > I've sent a patch to bump it to patchlevel 8 after the 2015.02 release > for another bug in commit b817e8c58117402561a61c0d749337f415c9c985 > (bash-related). > So it'll be part of the 2015.05 release, or if you're in a rush just > apply that patch to your tree. I have tested it, and the patch works, no more segfaults so far. I attach the patch file for buildroot, Gustavo, can you tell me if I did it in a correct way? Did you already include this one in buildroot too? I could not get the original patch working with the buildroot system so I generated my own diff which works for buildroot (that is readline-0001-63-002.patch). I saw there are more patches for readline 6.3 available. Tjeerd READLINE PATCH REPORT ===================== Readline-Release: 6.3 Patch-ID: readline63-002 Bug-Reported-by: Anatol Pomozov Bug-Reference-ID: Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html Bug-Description: When in callback mode, some readline commands can cause readline to seg fault by passing invalid contexts to callback functions. Patch (apply with `patch -p0'): *** ../readline-6.3/readline.c 2013-10-28 14:58:06.000000000 -0400 --- readline.c 2014-03-10 14:15:02.000000000 -0400 *************** *** 745,749 **** RL_CHECK_SIGNALS (); ! if (r == 0) /* success! */ { _rl_keyseq_chain_dispose (); --- 745,750 ---- RL_CHECK_SIGNALS (); ! /* We only treat values < 0 specially to simulate recursion. */ ! if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */ { _rl_keyseq_chain_dispose (); *** ../readline-6.3/patchlevel 2013-11-15 08:11:11.000000000 -0500 --- patchlevel 2014-03-21 08:28:40.000000000 -0400 *************** *** 1,3 **** # Do not edit -- exists only for use by patch ! 1 --- 1,3 ---- # Do not edit -- exists only for use by patch ! 2 --- a/readline.c 2013-10-28 19:58:06.000000000 +0100 +++ b/readline.c 2015-03-25 13:45:43.900418511 +0100 @@ -744,7 +744,8 @@ _rl_dispatch_callback (cxt) r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); RL_CHECK_SIGNALS (); - if (r == 0) /* success! */ + /* We only treat values < 0 specially to simulate recursion. */ + if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */ { _rl_keyseq_chain_dispose (); RL_UNSETSTATE (RL_STATE_MULTIKEY);