Project

General

Profile

Actions

Bug #222

closed

BabelTrace 1.0.0-rc1 does not report an error code in error situations

Added by Jesus Garcia almost 12 years ago. Updated almost 12 years ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
Start date:
04/24/2012
Due date:
% Done:

0%

Estimated time:

Description

Hi Guys,

The latest version of babeltrace (rc1) does not report an error code in error situations (at least not this particular error).
In the following example there is a text file in the Pid directory and when babeltrace is invoked, it reports an error, but it returns 0:

SC-1:~ # ll /home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/
total 20
rw-r--r- 1 root root 0 Apr 23 23:16 MyTextFile.txt
rw-r--r- 1 root root 0 Apr 23 23:16 MyTextFile2.txt
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 channel0_0
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 channel0_1
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 channel0_2
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 channel0_3
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 metadata
SC-1:~ # babeltrace /home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/
[error] Open file stream error.
[warning] [Context] Cannot open_trace of the format /home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/ .

[warning] [Context] opening trace "/home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/" from /home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/ for reading.
SC-1:~ # echo $?
0
SC-1:~ # babeltrace -h
BabelTrace Trace Viewer and Converter 1.0.0-rc1

======================================================================

In the previous version of babaltrace, it reports the same errors, but it returns 1:

SC-1:/home/trace/Profile006_4/SC-1/ust # babeltrace /home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/
[error] Open file stream error.
[error] [Context] Cannot open_trace of the format /home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/ .

[error] [Context] opening trace "/home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/" from /home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/ for reading.
[error] opening trace "/home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/" for reading.

SC-1:/home/trace/Profile006_4/SC-1/ust # echo $?
1
SC-1:/home/trace/Profile006_4/SC-1/ust # babeltrace --help
BabelTrace Trace Viewer and Converter 1.0.0-pre4

Actions #1

Updated by Mathieu Desnoyers almost 12 years ago

Issue #222 has been reported by Jesus Garcia.

----------------------------------------
Bug #222: BabelTrace 1.0.0-rc1 does not report an error code in error situations
https://bugs.lttng.org/issues/222

Author: Jesus Garcia
Status: New
Priority: Normal
Assignee:
Category:
Target version: Babeltrace 1.0

Hi Guys,

The latest version of babeltrace (rc1) does not report an error code in error situations (at least not this particular error).
In the following example there is a text file in the Pid directory and when babeltrace is invoked, it reports an error, but it returns 0:

SC-1:~ # ll /home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/
total 20
rw-r--r- 1 root root 0 Apr 23 23:16 MyTextFile.txt
rw-r--r- 1 root root 0 Apr 23 23:16 MyTextFile2.txt
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 channel0_0
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 channel0_1
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 channel0_2
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 channel0_3
-rwxrwxrwx 1 root root 4096 Apr 23 23:15 metadata
SC-1:~ # babeltrace /home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/
[error] Open file stream error.
[warning] [Context] Cannot open_trace of the format /home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/ .

[warning] [Context] opening trace "/home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/" from /home/trace/Profile016_1/SC-1/ust/TestApp_type1-4459-20120423-231455/ for reading.
SC-1:~ # echo $?
0
SC-1:~ # babeltrace -h
BabelTrace Trace Viewer and Converter 1.0.0-rc1

======================================================================

In the previous version of babaltrace, it reports the same errors, but it returns 1:

SC-1:/home/trace/Profile006_4/SC-1/ust # babeltrace /home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/
[error] Open file stream error.
[error] [Context] Cannot open_trace of the format /home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/ .

[error] [Context] opening trace "/home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/" from /home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/ for reading.
[error] opening trace "/home/trace/Profile006_4/SC-1/ust/TestApp_type1-16635-20120424-101632/" for reading.

SC-1:/home/trace/Profile006_4/SC-1/ust # echo $?
1
SC-1:/home/trace/Profile006_4/SC-1/ust # babeltrace --help
BabelTrace Trace Viewer and Converter 1.0.0-pre4

You will notice that those "error" messages became warnings, so when
opening a trace collection that contains a couple of oddly-formed
traces, rather than bailing out, babeltrace prints a warning on stderr
and continues.

One thing we could do is check if none of the traces attempted to be
opened were successful, and return an error in that case. I'll look into
it.

Thanks,

Mathieu

--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

Actions #2

Updated by Mathieu Desnoyers almost 12 years ago

  • Status changed from New to Resolved
  • Assignee set to Mathieu Desnoyers

commit 27cd3890b5ad7975669cf3ec3f7d575aa1e55c67
Author: Mathieu Desnoyers <>
Date: Tue Apr 24 11:50:43 2012 -0400

Fix: return an error if no trace can be opened
Fixes #222
Signed-off-by: Mathieu Desnoyers &lt;&gt;
Actions #3

Updated by Mathieu Desnoyers almost 12 years ago

Addendum fixing this issue:

commit b945d4a5943030cdfbe697570c8c9d76838f7473
Author: Mathieu Desnoyers <>
Date: Tue May 8 21:32:26 2012 -0400

Fix: converter error logic
- If a subdirectory is empty, just warn and continue anyway.
- On partial error, babeltrace now returns a nonzero error value to the
parent process, even though it proceeds anyway.
Signed-off-by: Mathieu Desnoyers &lt;&gt;
Actions

Also available in: Atom PDF