From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4437 invoked by alias); 30 Mar 2010 17:25:27 -0000 Received: (qmail 4420 invoked by uid 22791); 30 Mar 2010 17:25:26 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Mar 2010 17:25:22 +0000 Received: (qmail 13769 invoked from network); 30 Mar 2010 17:25:20 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Mar 2010 17:25:20 -0000 From: Pedro Alves To: Jan Kratochvil Subject: Re: [patch] Fix crash on NULL rl_prompt Date: Tue, 30 Mar 2010 17:25:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: tromey@redhat.com, gdb-patches@sourceware.org References: <20100329234026.GA23895@host0.dyn.jankratochvil.net> <201003301741.20844.pedro@codesourcery.com> <20100330170457.GA10938@host0.dyn.jankratochvil.net> In-Reply-To: <20100330170457.GA10938@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003301825.18754.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg01069.txt.bz2 On Tuesday 30 March 2010 18:04:57, Jan Kratochvil wrote: > On Tue, 30 Mar 2010 18:41:20 +0200, Pedro Alves wrote: > > But, how did rl_prompt end up NULL in the first place? > > I do not know. I have spent some time trying to reproduce it reading the > source but gave up after some reasonable time. Bugreport comes from an > automated crash reporter (ABRT) where the person only sometimes can/gives more > info. Asked now for a reproducer. My guess is, either readline wasn't setup proper at all, or, the prompts stack got busted (get_prompt/set_prompt/PROMPT), which I've seen happen before with target-async mode. > An existing bug a user cannot notice is ... no longer a bug, isn't it? Err, whatever. (Nowhere in this thread have I seen mentioned that GDB (or its prompt) doesn't get busted further down the road, mind you.) On Tuesday 30 March 2010 18:13:20, Tom Tromey wrote: > Jan> I do not know. > > Yeah, it is not great that we don't know how to reproduce it. > > But, given that part of the readline contract is that rl_prompt==NULL is > a valid state, I think tui_prep_terminal ought to cope with that as > well>. Maybe there is also some other bug somewhere else, but that > doesn't affect the correctness of this particular patch. But isn't `rl_prompt' always built from input feed to readline? GDB always gives readline a non-NULL prompt, from what I've seen. Hence, I wouldn't be so fast in calling it correct, but I'm not going to spend more time on this. My intention was mainly to comment on the xstrdup/xmalloc remark. -- Pedro Alves