From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MzWti-0006Ku-Sy for garchives@archives.gentoo.org; Sun, 18 Oct 2009 14:38:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 812D5E08D2; Sun, 18 Oct 2009 14:38:12 +0000 (UTC) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by pigeon.gentoo.org (Postfix) with ESMTP id 3B0A2E08D2 for ; Sun, 18 Oct 2009 14:38:12 +0000 (UTC) Received: by ewy7 with SMTP id 7so2779113ewy.34 for ; Sun, 18 Oct 2009 07:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=EVaOCzkYnePmfYr7bUeDBcbv/Avo6S+JFUulQPhe1ek=; b=Jf/Kqi6BkGty43f6ZnWsrhbPSTd4L9iROwnDqkzqM4C8dtviOiEIyue4MZBictR8EN WyHh6otvQeAgIYcUWTJ9ky4TVvapmL8XdAwmyOn7qnD4/068hJeil8YY5u6GtIi6sSx7 MA6g2TGU0kqy+tGbKMQRAQg842RhnHo37VcG4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; b=KEUDijrouj7WqjP3AaOVZfolPg3skKqm1q8KvnyfoGs449FkDkFkqhU6qTOby2szcs f/yn/JtXL/5R26jLSyekHfHQ2Vrn5MINfLtNjLfmq4BR5XBDVD4gukugiPhNVbKzZ4cW oWAaPKy2URvoCArs8ZuSl/joQ0XhMbQzHo+PE= Received: by 10.210.156.15 with SMTP id d15mr3575856ebe.27.1255876691296; Sun, 18 Oct 2009 07:38:11 -0700 (PDT) Received: from nazgul.localnet ([196.210.202.225]) by mx.google.com with ESMTPS id 10sm8211797eyd.10.2009.10.18.07.38.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Oct 2009 07:38:10 -0700 (PDT) From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] OT? How to capture error messages from glibc Date: Sun, 18 Oct 2009 16:37:07 +0200 User-Agent: KMail/1.12.2 (Linux/2.6.31-gentoo-r2; KDE/4.3.2; x86_64; ; ) References: <9acccfe50910180706t2495a6c1u54845b4ecd733b06@mail.gmail.com> In-Reply-To: <9acccfe50910180706t2495a6c1u54845b4ecd733b06@mail.gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200910181637.07762.alan.mckinnon@gmail.com> X-Archives-Salt: 22f0c719-defa-480b-b188-9a700d2a732d X-Archives-Hash: 1affa561663ebca3da02968528e8ffba On Sunday 18 October 2009 16:06:38 Kevin O'Gorman wrote: > This may be OT, inasmuch as it's not gentoo-specific. It's here because my > system runs Gentoo and I don't know where else to ask. If it annoys, just > point me in the right direction to where it will not be OT, please. > > I'm trying to write scripts to help me grade student submissions in a > systems programming course. Students are just learning about malloc/free > and some are floundering. I'm seeing lots of errors that are caught by > glibc (with some help from compiling with -D_FORTIFY_SOURCE=2), but I would > like instead to capture those messages in a file. It appears that glibc > does not use stdin or stderr for these messages, since I cannot redirect > them. I suspect they are being sent to /dev/tty. > > Is there any wizardry that would allow capture of these messages? I know > that somehow the script(1) command captures such stuff, but it's not > useable since I want all of this scripted and ironically script(1) does > not seem to play nice with scripts. I also know that this is about to tip > me into the abyss of session leaders and controlling terminals, but I'll > try to be brave. My first thought was way out on left field: could you use syslog-ng to read /dev/tty? -- alan dot mckinnon at gmail dot com