https://bugs.winehq.org/show_bug.cgi?id=51835
Bug ID: 51835 Summary: Using PInvoke on pcap_findalldevs crashes Product: Wine Version: 6.18 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: critical Priority: P2 Component: wpcap Assignee: wine-bugs@winehq.org Reporter: marc_aurel@me.com Distribution: ---
Created attachment 70732 --> https://bugs.winehq.org/attachment.cgi?id=70732 End of the log before crash
The library in question is https://github.com/ravahn/machina
As soon as a c# assembly uses the library and starts capturing on a PCapCaptureSocket, pcap_findalldevs(IntPtr ByRef, System.Text.StringBuilder) is invoked and crashes the program, whereas it works fine on windows.
https://bugs.winehq.org/show_bug.cgi?id=51835
--- Comment #1 from marc_aurel@me.com --- Created attachment 70733 --> https://bugs.winehq.org/attachment.cgi?id=70733 Visual Studio solution
https://bugs.winehq.org/show_bug.cgi?id=51835
--- Comment #2 from marc_aurel@me.com --- This was in a 64-bet wine prefix with .Net framework 4.8 installed
https://bugs.winehq.org/show_bug.cgi?id=51835
marc_aurel@me.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |marc_aurel@me.com
https://bugs.winehq.org/show_bug.cgi?id=51835
marc_aurel@me.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |ArchLinux
https://bugs.winehq.org/show_bug.cgi?id=51835
--- Comment #3 from Hans Leidekker hans@meelstraat.net --- (In reply to marc_aurel from comment #2)
This was in a 64-bet wine prefix with .Net framework 4.8 installed
I don't see a crash with the patches applied from bug 51818. The test app sets up a filter and then waits for packets in a pcap_next_ex() call just like on Windows.
It does find a different interface. pcap_findalldevs() returns the loopback interface on Linux first, on Windows I get a non-loopback interface.
https://bugs.winehq.org/show_bug.cgi?id=51835
--- Comment #4 from Hans Leidekker hans@meelstraat.net ---
0580:trace:wpcap:wine_pcap_findalldevs (0x32f424 0x32f260)
There's no wine_pcap_findalldevs in current Wine. Can you try current git Wine with the patches from bug 51818 on top?
https://bugs.winehq.org/show_bug.cgi?id=51835
--- Comment #5 from marc_aurel@me.com --- Sorry, I messed up a bit during testing but I can confirm that on current wine git with the patches from https://bugs.winehq.org/show_bug.cgi?id=51818 PInvoke works fine for wine-mono and native .net on linux
https://bugs.winehq.org/show_bug.cgi?id=51835
marc_aurel@me.com changed:
What |Removed |Added ---------------------------------------------------------------------------- OS|Linux |Mac OS X Version|6.18 |6.0
--- Comment #6 from marc_aurel@me.com --- I last tested on wine 6.0 on OS X where your patch also fixed bug 51818, but still crashes in the .net call, so I was led to believe that was the case for linux as well… Since native binaries work just fine in that scenario, is there anything I can do (maybe to how the struct for pcap_if is declared in the library) to make this work?
https://bugs.winehq.org/show_bug.cgi?id=51835
--- Comment #7 from marc_aurel@me.com --- (In reply to Hans Leidekker from comment #4)
0580:trace:wpcap:wine_pcap_findalldevs (0x32f424 0x32f260)
There's no wine_pcap_findalldevs in current Wine. Can you try current git Wine with the patches from bug 51818 on top?
I don’t have a wine_pcap_findalldevs in my 6.0 source either, I guess I need to clean my build directory and recompile
https://bugs.winehq.org/show_bug.cgi?id=51835
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de Severity|critical |normal
--- Comment #8 from Fabian Maurer dark.shadow4@web.de --- Not critical.
https://bugs.winehq.org/show_bug.cgi?id=51835
--- Comment #9 from marc_aurel@me.com --- This is most likely a duplicate of bug 51818 as well since it is solved by the same patch (even backported to 6.0) and regresses on wine-git
https://bugs.winehq.org/show_bug.cgi?id=51835
marc_aurel@me.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|6.0 |6.18 OS|Mac OS X |Linux
https://bugs.winehq.org/show_bug.cgi?id=51835
marc_aurel@me.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|UNCONFIRMED |RESOLVED
--- Comment #10 from marc_aurel@me.com --- I'm closing the bug as duplicate
*** This bug has been marked as a duplicate of bug 51818 ***
https://bugs.winehq.org/show_bug.cgi?id=51835
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing duplicate.