From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1183 invoked by alias); 8 May 2015 05:09:44 -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 125422 invoked by uid 89); 8 May 2015 05:06:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 May 2015 05:06:28 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 983F85A08D; Fri, 8 May 2015 05:06:24 +0000 (UTC) Received: from localhost (unused-10-15-17-126.yyz.redhat.com [10.15.17.126]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4856NDw005000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO); Fri, 8 May 2015 01:06:24 -0400 From: Sergio Durigan Junior To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code References: <1429889336-12277-1-git-send-email-qiyaoltc@gmail.com> <554A3D61.8090302@redhat.com> X-URL: http://blog.sergiodj.net Date: Fri, 08 May 2015 05:09:00 -0000 In-Reply-To: <554A3D61.8090302@redhat.com> (Pedro Alves's message of "Wed, 06 May 2015 17:12:17 +0100") Message-ID: <874mnn1wvn.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00174.txt.bz2 On Wednesday, May 06 2015, Pedro Alves wrote: >> After trying pass different parameters to remote_exec and hacking >> remote_exec/rsh_exec/local_exec, I got no success, I decide >> to give up, and try to update /proc/$ipid/coredump_filter by the c >> code directly. > > Probably the right fix would be for dejagnu to put ''s around > the whole sh -c command in rsh_exec: > > set ret [local_exec "$RSH $rsh_useropts $hostname sh -c '$program $pargs \\; echo XYZ\\\${?}ZYX'" $inp $outp $timeout] > > dunno if that would work with real rsh. Alternatively, teach > dejagnu about a real ssh mode... FWIW, I managed to solve the problem by hacking /usr/share/dejagnu/rsh.exp:rsh_exec and doing: set ret [local_exec "$RSH $rsh_useropts $hostname \"sh -c '$program $pargs \\; echo XYZ\\\${?}ZYX'\"" $inp $outp $timeout] Then I found this message by Pedro. But only doing this is not enough: because of the quote-hell, the coredump-filter.exp needs to be adjusted to: remote_exec target "echo $filter_flag > /proc/$ipid/coredump_filter" I.e., remove the "sh -c" and the extra quotes. After that, everything passes. Since the full solution involves hacking dejagnu, then I agree that a most desirable solution is to hack the C source file as Yao did. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/