Change in osmo-uecups[master]: daemon: enable multithread logging in main()
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-uecups/+/27003 ) Change subject: daemon: enable multithread logging in main() ...................................................................... daemon: enable multithread logging in main() It may happen that multiple threads trying to log at the same time, and the msgb containing a logging message gets corrupted in libosmocore's _file_wq_write_cb(): msgb(0x7f5ca2a38150): msgb too small to pull 240 (len 120) Aborted (core dumped) ''' rc = write(ofd->fd, msgb_data(msg), msgb_length(msg)); if (rc < 0) return rc; if (rc != msgb_length(msg)) { // 240 != 120 /* pull the number of bytes we have already written */ msgb_pull(msg, rc); // <-- we abort() here /* ask write_queue to re-insert the msgb at the head of the queue */ return -EAGAIN; } ''' The return value of write() cannot be greater than the given length. Most likely, the msgb gets corrupted during the write() system call. Enabling multithread logging in libosmocore solves the problem. Change-Id: Ib14d0e36e8cd72465bfe55d19b68dbe3423f7f05 Related: SYS#5602 Fixes: OS#5424 --- M daemon/main.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/daemon/main.c b/daemon/main.c index fec6f84..788ed70 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -726,6 +726,7 @@ osmo_init_ignore_signals(); osmo_init_logging2(g_tall_ctx, &log_info); + log_enable_multithread(); g_daemon = gtp_daemon_alloc(g_tall_ctx); OSMO_ASSERT(g_daemon); -- To view, visit https://gerrit.osmocom.org/c/osmo-uecups/+/27003 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-uecups Gerrit-Branch: master Gerrit-Change-Id: Ib14d0e36e8cd72465bfe55d19b68dbe3423f7f05 Gerrit-Change-Number: 27003 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-MessageType: merged
participants (1)
-
laforge