Wireshark mailing list archives

Re: wslog, windows, pytest, and heap corruption


From: Jirka Novak <j.novak () netsystem cz>
Date: Fri, 31 Dec 2021 00:36:41 +0100

Dear John,

I was working on a MR for moving the text2pcap/text_import debug over to the ws_log features and I ran into a seemingly bizarre problem. Setting the log level to a non-default value causes the pytest procedures to fail with heap corruption on the Gitlab Windows CI.
...

I'm touching similar issue just on Windows platform when running extcap from Wireshark. Extcap dies when logging level is set to file and file size increases by subsequent ws_log related writes over 4192 bytes.

I found that if I disable part of code, it works fine including writing messages to log. Can you try it too:

wsutil/wslog.c in log_write_dispatch() comment out second call of log_write_do_log():

diff --git a/wsutil/wslog.c b/wsutil/wslog.c
index f0f87eaa6e..8e49b6200c 100644
--- a/wsutil/wslog.c
+++ b/wsutil/wslog.c
@@ -965,11 +965,14 @@ static void log_write_dispatch(const char *domain, enum ws_log_level level,
                         user_format, user_ap, registered_log_writer_data);
     }
     else {
+       // TODO: Fix it
+    /*
log_write_do_work(console_file(level), console_color_enabled(level),
                             get_localtime(tstamp.tv_sec, &cookie),
                             tstamp.tv_nsec,
                             domain, level, file, line, func,
                             user_format, user_ap);
+                           */
     }

A few weeks ago I worked with João Valverde on changes in logging for extcaps, but I don't think we touched this part.
João Valverde, can you check our findings?

                                                Best regards,

                                                        Jirka Novak
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: