libosmocore/tests/logging
Neels Hofmeyr 85b42c4618 show bug in logging: erratic redirection to DLGLOBAL for invalid categories
Add a check to logging_test.c to show a bug: when a logging category value that
is out-of-bounds is passed to the logging system, the internal map_subsys()
function should remap that to DLGLOBAL. But in fact DLGLOBAL is -1 and the
function fails to map this to a proper positive array index, directly returning
-1 instead. This results in a negative array index and undefined behavior. A
sanitize build should catch this.

The bug is confirmed by the fact that logging_test.err stays the same
(hopefully) although a logging output should appear from this patch. The test
could as well segfault or anything else, it's a bit of a gamble.

This bug will be fixed along with the expectation in a subsequent patch.

Note: osmo_log_info->num_cat + 0 is also out-of-bounds, but there is a separate
bug there, so leaving this for another patch.

Change-Id: I161b6550fa204a872bad1abefee1a6155393fafd
2016-12-12 15:47:32 +01:00
..
logging_test.c show bug in logging: erratic redirection to DLGLOBAL for invalid categories 2016-12-12 15:47:32 +01:00
logging_test.err logging test: cosmetic: print target and don't print color 2016-12-12 14:24:39 +01:00
logging_test.ok logging: Move the logging test from OpenBSC into libosmocore 2012-09-27 16:29:54 +02:00