From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56571 invoked by alias); 26 Jan 2016 09:59:10 -0000 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 Received: (qmail 55847 invoked by uid 89); 26 Jan 2016 09:59:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=*after*, HERE X-HELO: mail-pf0-f195.google.com Received: from mail-pf0-f195.google.com (HELO mail-pf0-f195.google.com) (209.85.192.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 26 Jan 2016 09:59:08 +0000 Received: by mail-pf0-f195.google.com with SMTP id e65so8124063pfe.0 for ; Tue, 26 Jan 2016 01:59:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=nWr4sxl+auFBcxnd7VeTYFNGetGye4WMQtQtsYYieKQ=; b=MRn6282D/gSd3Kh961jCO6dQ7iGgcdKk1yia01Vb7Gy1PvCVwWQbOQI6NdRCcAwa5z OJRP6JhKrviu804KiO3Xtjs8E6aqKrf3N/ZXgki2XBsjT2+Va/R2+/yeTuQoFsf2s4f6 Wgt0OvyeqtidPIgXFmJbFv/1NRss4S3/dOpkyt0oYitDyS/Cx4SqqjG8jOJMB/7JuAqJ HNa71q8DsgwoYKcimovyC6trrb339vSLwyS37YM/N1y6cnuSuqCUC8uQmR3nCMFnxj1M zuDPZBF2Rv5wAUDnJq7xT+3rBqs93DkafTqWfIiGeX7o9/t+1C9IHVTg1oY91cie5eRX p8XA== X-Gm-Message-State: AG10YORCz5zXr+h8vF2e5RkAxWURhRrTwzHjB/aBzWVCCn6E9lYj1nYveprczcpPF9vguQ== X-Received: by 10.98.42.74 with SMTP id q71mr32006739pfq.18.1453802347194; Tue, 26 Jan 2016 01:59:07 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id 83sm900187pft.44.2016.01.26.01.59.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jan 2016 01:59:06 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 0/2 V2] Fix a fail in gdb.base/interrupt-noterm.exp Date: Tue, 26 Jan 2016 09:59:00 -0000 Message-Id: <1453802339-20401-1-git-send-email-yao.qi@linaro.org> In-Reply-To: <86powqqa57.fsf@gmail.com> References: <86powqqa57.fsf@gmail.com> X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00642.txt.bz2 Hi, In my test, I see the following fail intermittently, interrupt (gdb) PASS: gdb.base/interrupt-noterm.exp: interrupt [Inferior 1 (process 13407) exited normally] Child exited with status 0 FAIL: gdb.base/interrupt-noterm.exp: inferior received SIGINT (timeout) because interrupt character isn't processed by GDBserver in time due to two different problems: 1. GDBserver may receive vCont;c and '\003' together, and read them into the buffer. GDBserver will wait for the inferior but there won't be SIGIO because GDBserver has already read '\003' into the buffer. 2. GDBserver may receive vCont;c only. GDBserver will resume the inferior and wait for it. If '\003' arrives at the moment between GDBserver received vCont;c and install SIGIO handler, GDBserver can't receive SIGIO. these two problems above cause GDB wait for the inferior and leave the interrupt there, so the test is timeout. Two patches in the series fix these two problems separately. Patch 1 fixes the problem 1 by checking the buffer *after* reading in each packet. Patch 2 fixes the problem 2 by block/unblock SIGIO rather than install/uninstall signal handler. These two patches are tested on {x86_64,arm,aarch64}-linux. No regression. *** BLURB HERE *** Yao Qi (2): [GDBserver] Check input interrupt after reading in a packet [GDBserver] Block and unblock SIGIO gdb/gdbserver/remote-utils.c | 60 ++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 21 deletions(-) -- 1.9.1