[PATCH] libosmocore[master]: show bug in logging: erratic redirection to DLGLOBAL for fir...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Dec 12 15:09:58 UTC 2016


Review at  https://gerrit.osmocom.org/1416

show bug in logging: erratic redirection to DLGLOBAL for first invalid category

Add a check to logging_test.c to show a bug: when a logging category value that
is the first out-of-bounds value is passed to the logging system, the internal
map_subsys() fails to redirect to DLGLOBAL due to a flawed conditional. This
results in a too large 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.

Change-Id: I12bf38b6c1f85e2d7bf5a15f942dfe0beed41eba
---
M tests/logging/logging_test.c
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/1416/1

diff --git a/tests/logging/logging_test.c b/tests/logging/logging_test.c
index 6c5a8f2..3cc6c5b 100644
--- a/tests/logging/logging_test.c
+++ b/tests/logging/logging_test.c
@@ -115,6 +115,7 @@
 	log_parse_category_mask(stderr_target, "DLGLOBAL,1");
 	DEBUGP(osmo_log_info->num_cat + 1, "You should see this on DLGLOBAL (a)\n");
 	DEBUGP(osmo_log_info->num_cat + 100, "You should see this on DLGLOBAL (b)\n");
+	DEBUGP(osmo_log_info->num_cat, "You should see this on DLGLOBAL (c)\n");
 
 	return 0;
 }

-- 
To view, visit https://gerrit.osmocom.org/1416
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12bf38b6c1f85e2d7bf5a15f942dfe0beed41eba
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list