https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15711

--- Comment #3 from Gerald Combs <ger...@wireshark.org> ---
Running Wireshark under Application Verifier here gives me the following log:

----
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<avrf:logfile xmlns:avrf="Application Verifier">
        <avrf:logSession TimeStarted="2019-04-30 : 11:31:54" PID="9484"
Version="2">
                <avrf:logEntry Time="2019-04-30 : 11:32:00"
LayerName="Networking" StopCode="0xE107" Severity="Error">
                        <avrf:message>A Winsock API was called before a
successful WSAStartup() or after a balancing successful WSACleanup() call was
made</avrf:message>
                        <avrf:parameter1>0 - Last sucessfull WSAStartup call by
this caller. Use dps to dump the stack if not NULL</avrf:parameter1>
                        <avrf:parameter2>0 - Last sucessfull WSACleanup call by
this caller. Use dps to dump the stack if not NULL</avrf:parameter2>
                        <avrf:parameter3>17f27dd35b0 - Last successful
WSAStartup call in this process. Use dps to dump the stack if not
NULL</avrf:parameter3>
                        <avrf:parameter4>0 - Last sucessfull WSACleanup call in
this process. Use dps to dump the stack if not NULL</avrf:parameter4>
                        <avrf:stackTrace>
                                <avrf:trace>vfnet!+7fff4db11553 ( @
0)</avrf:trace>
                                <avrf:trace>vfnet!+7fff4db19798 ( @
0)</avrf:trace>
                                <avrf:trace>cares!init_by_defaults+13b
(c:\development\vcpkg\buildtrees\c-ares\src\res-1_15_0-2c3995bf03\ares_init.c @
1918)</avrf:trace>
                                <avrf:trace>cares!ares_init_options+2c4
(c:\development\vcpkg\buildtrees\c-ares\src\res-1_15_0-2c3995bf03\ares_init.c @
218)</avrf:trace>
                               
<avrf:trace>libwireshark!host_name_lookup_init+233
(C:\Development\wireshark\epan\addr_resolv.c @ 2992)</avrf:trace>
                                <avrf:trace>libwireshark!epan_init+4f
(C:\Development\wireshark\epan\epan.c @ 204)</avrf:trace>
                                <avrf:trace>Wireshark!main+45e
(C:\Development\wireshark\ui\qt\main.cpp @ 648)</avrf:trace>
                                <avrf:trace>Wireshark!WinMain+157
(c:\users\qt\work\qt\qtbase\src\winmain\qtmain_win.cpp @ 97)</avrf:trace>
                                <avrf:trace>Wireshark!operator delete[]+216 ( @
0)</avrf:trace>
                                <avrf:trace>KERNEL32!BaseThreadInitThunk+14 ( @
0)</avrf:trace>
                                <avrf:trace>ntdll!RtlUserThreadStart+21 ( @
0)</avrf:trace>
                        </avrf:stackTrace>
                </avrf:logEntry>
        </avrf:logSession>
</avrf:logfile>
----

It looks like we've called WSAStartup and haven't called WSACleanup.

Line 1918 in ares_init.c calls toolong, which is a macro that calls SOCKERRNO,
which is a macro that calls WSAGetLastError:

https://github.com/c-ares/c-ares/blob/cares-1_15_0/ares_init.c#L1918
https://github.com/c-ares/c-ares/blob/cares-1_15_0/setup_once.h#L422

If I add the following gethostname + WSAGetLastError call to ui/qt/main.cpp
just before epan_init I'm unable to trigger the exception:

    char hn[64];
    gethostname(hn, 64);
    WSAGetLastError();

However, if I add it to epan/epan.c at the top of epan_init or
epan/addr_resolv.c just before the ares_init calls an exception is triggered at
WSAGetLastError.

-- 
You are receiving this mail because:
You are watching all bug changes.
___________________________________________________________________________
Sent via:    Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives:    https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
             mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

Reply via email to