Gentoo Archives: gentoo-user

From: Kevin O'Gorman <kogorman@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] OT? How to capture error messages from glibc
Date: Sun, 18 Oct 2009 14:06:40
Message-Id: 9acccfe50910180706t2495a6c1u54845b4ecd733b06@mail.gmail.com
1 This may be OT, inasmuch as it's not gentoo-specific. It's here because my
2 system runs Gentoo and I don't know where else to ask. If it annoys, just
3 point me in the right direction to where it will not be OT, please.
4
5 I'm trying to write scripts to help me grade student submissions in a
6 systems programming course. Students are just learning about malloc/free
7 and some are floundering. I'm seeing lots of errors that are caught by
8 glibc (with some help from compiling with -D_FORTIFY_SOURCE=2), but I would
9 like instead to capture those messages in a file. It appears that glibc
10 does not use stdin or stderr for these messages, since I cannot redirect
11 them. I suspect they are being sent to /dev/tty.
12
13 Is there any wizardry that would allow capture of these messages? I know
14 that somehow the script(1) command captures such stuff, but it's not useable
15 since I want all of this scripted and ironically script(1) does not seem to
16 play nice with scripts. I also know that this is about to tip me into the
17 abyss of session leaders and controlling terminals, but I'll try to be
18 brave.
19
20 --
21 Kevin O'Gorman, PhD

Replies

Subject Author
Re: [gentoo-user] OT? How to capture error messages from glibc Alan McKinnon <alan.mckinnon@×××××.com>