Project

General

Profile

Actions

Bug #763

closed

Some debug statements are escaping to the wrong output streams

Added by Daniel U. Thibault about 10 years ago. Updated about 4 years ago.

Status:
Invalid
Priority:
Low
Category:
-
Target version:
-
Start date:
03/13/2014
Due date:
% Done:

0%

Estimated time:

Description

Using babeltrace-1.1.1-31-513413e.

When using babeltrace's debug option, nearly all '[debug]' statements go to stdout, while a separate set of messages goes to stderr. However, there's a little bit of crossover:

$ babeltrace ~/lttng-traces/w[...]/ -n all -f all -w [...]/w_na_fa -d 1> [...]w_1 2> [...]/w_2

$ cat w_1

[debug] Debug mode active.
Scanner input is a noninteractive file.
[debug] <IDENTIFIER size>
[...]
[debug] ctf_packet_seek (before call): 696736
[debug] ctf_packet_seek (after call): -1

$ cat w_2
[debug] metadata packet read: typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
typealias integer { size = 16; align = 8; signed = false; } := uint16_t;
[...]

[debug] metadata packet read: 
Starting parse
Entering state 0
[...]
</root>

The line "Scanner input is a noninteractive file" is the only one going to stdout that does not begin with [debug]. No idea where that's coming from.

Conversely, stderr is getting two [debug] lines that ought to go to stdout (or which should lose the [debug] prefix). Those seem to originate from babeltrace/formats/ctf/ctf.c:981:

        if (babeltrace_debug) {
            buf[readlen] = '\0';
            fprintf(stderr, "[debug] metadata packet read: %s\n",
                buf);
        }

There are a few more fprintf(stderr statements (lines 1101, 1741, and 2104) that are not prefixed with [debug], [warning], nor [error]:

            fprintf(stderr, "Unable to open metadata.\n");
[...]
        fprintf(stderr, "Error on ctf_fini_pos\n");
[...]
        fprintf(stderr, "Error on ctf_fini_pos\n");

Actions #1

Updated by Shitao Weng about 10 years ago

"Scanner input is a noninteractive file" is from babeltrace/formats/ctf/metadata/ctf-parser.y.

Actions #2

Updated by Jérémie Galarneau almost 10 years ago

  • Assignee set to Jérémie Galarneau
Actions #3

Updated by Jonathan Rajotte Julien about 4 years ago

  • Status changed from New to Invalid

State of babeltrace moved a lot since.

Closing this ticket as invalid. Reopen it if it stills apply to Babeltrace 2.

Actions

Also available in: Atom PDF