In (highly unlikely) case localtime() failed, test_msg() calls
pr_perror() which is a wrapper around test_msg() so we're
calling ourselves, which can lead to infinite recursion if
localtime() keeps failing. Use fprintf() here to avoid this.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In test_msg() a buffer is allocated on stack to cook the outputed message.
This buffer's size was defined using the PAGE_SIZE constant defined in
zdtmtst.h file.
On some system like ppc64, the page size is large (64K), leading to massive
stack allocation, which may be too large in case of alternate stack like
the one used in the sigaltstack test.
This fix, defines a 2048 characters buffer for test_msg, and expose a
constant to allocate stack accordingly in the sigaltstack test.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This is logging routine, lets it not affect the global @errno.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's need add format to fprintf to avoid following error in Ubuntu 12.04:
msg.c:59:2: error: format not a string literal and no format arguments [-Werror=format-security]
Signed-off-by: Victor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@openvz.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -c -o msg.o msg.c
msg.c: In function ‘test_msg’:
msg.c:40:6: error: variable ‘len’ set but not used [-Werror=unused-but-set-variable]
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pthread00 hangs if dprintf is used, and works well if fprintf is used.
One more mention of this bug is here:
http://sourceware.org/bugzilla/show_bug.cgi?id=12847
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
* Delete internal buffer, all data are written immediately in a log file
* Add timestamp and pid in a message
* All processes write log messages in one file
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This test suite contains many small test cases for different subsystems.
Example of execution:
# make busyloop00.pid
# ../../../../crtools -d -t `cat busyloop00.pid`
# kill -9 `cat busyloop00.pid`
# ../../../../crtools -r -t `cat busyloop00.pid`
# cat busyloop00.out
PASS
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>