[Winpcap-users] Deadlock on pcap_open_live() ?

Dupuit Cyril cyrildupuit at hotmail.com
Wed Mar 31 15:00:11 PDT 2010


Yes, I am able to create a small application that is able to show this
issue but I am not sure what you need :
- Source code (a bit ugly...)
- Binary (no, it's filtered, sorry !)

I give you an archive in 7z file format that contains the source code
but it's impossible to give you the binary file.

This small application opens a dialog box. You need to select your
interface (the first by default) and click OK.

The function pcap_open_file() is called in another thread and the
application is locked.

Hope that can help you.

If you have some problems to use this simple application (GTK
dependancies, ...) or if the 7z file is filtered, don't hesitate to
contact me.

Thank you in advance,

Cyril



Le 31/03/2010 19:22, Gianluca Varenni a écrit :
> I suspect that it's one of the bugs present in Microsoft NetMon, the COM 
> component that we use under the hoods to sniff from dialup/VPN connections.
>
> Are you able to create a small GTK based application showing the issue? I'd 
> like to test it here.
>
> Have a nice day
> GV
>
>
>
> --------------------------------------------------
> From: "Dupuit Cyril" <cyrildupuit at hotmail.com>
> Sent: Wednesday, March 31, 2010 9:58 AM
> To: <winpcap-users at winpcap.org>
> Subject: Re: [Winpcap-users] Deadlock on pcap_open_live() ?
>
>   
>> Hello,
>>
>> My application is used to sniff packets from ethernet like Wireshark.
>>
>> I offer a choice to the user which interface to use to capture packets.
>> To do that, I use a specific thread used to compute some statistics to
>> help him to do the best choice (with a GTK based dialog box).
>>
>> Sometimes, my application can send packets in a specific case (like
>> broadcast or multicast).
>>
>> My application don't use directly COM objects but I am not shure that
>> GTK uses or not COM interface.
>>
>> Hope that can help you to better understand my problem,
>>
>> Cyril
>>
>> Le 31/03/2010 17:18, Gianluca Varenni a écrit :
>>     
>>> Is your application COM based?
>>>
>>> Have a nice day
>>> GV
>>>
>>> --------------------------------------------------
>>> From: "Dupuit Cyril" <cyrildupuit at hotmail.com>
>>> Sent: Tuesday, March 30, 2010 2:28 PM
>>> To: <winpcap-users at winpcap.org>
>>> Subject: [Winpcap-users] Deadlock on pcap_open_live() ?
>>>
>>>
>>>       
>>>> Hello,
>>>>
>>>> I am developping an application that uses multiple threaded
>>>> environnement on Windows XP.
>>>>
>>>> One of these threads opens a network interface to count the number of
>>>> packets per second and compute statistics.
>>>>
>>>> This architecture works fine for a real network interface (ie realteck,
>>>> 3 com, ...) but fails with the first interface (Adapter for generic
>>>> dialup and VPN capture).
>>>>
>>>> I have made a little change on my code to use the same thread than my
>>>> application.
>>>> The result is good. My application works without deadlok.
>>>>
>>>> If I resume :
>>>> - Multithreaded :
>>>>     main thread                            Statistic thread
>>>>            -> Do something...                      -> pcap_open_live()
>>>> on the first interface (Adapter for generic dialup and VPN capture)
>>>>
>>>>  => Result is a deadlock in the pcap_open_live() function. The function
>>>> is blocked.
>>>>
>>>> - Single threaded :
>>>>    main thread
>>>>         -> pcap_open_live() on the first interface.
>>>>  => Result is an handle on the file openned (no deadlock detected).
>>>>
>>>> I have tried this solution only on WinPcap 4.1.1. I don't know if this
>>>> problem appears in another version of WinPcap.
>>>>
>>>> Can you help me ?
>>>>
>>>> Thank you in adavance,
>>>>
>>>> Cyril
>>>>
>>>> _______________________________________________
>>>> Winpcap-users mailing list
>>>> Winpcap-users at winpcap.org
>>>> https://www.winpcap.org/mailman/listinfo/winpcap-users
>>>>
>>>>         
>>> _______________________________________________
>>> Winpcap-users mailing list
>>> Winpcap-users at winpcap.org
>>> https://www.winpcap.org/mailman/listinfo/winpcap-users
>>>
>>>
>>>
>>>       
>> _______________________________________________
>> Winpcap-users mailing list
>> Winpcap-users at winpcap.org
>> https://www.winpcap.org/mailman/listinfo/winpcap-users 
>>     
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
>
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestForWinPcapWithoutExe.7z
Type: application/octet-stream
Size: 7609 bytes
Desc: not available
Url : http://www.winpcap.org/pipermail/winpcap-users/attachments/20100401/22d068b1/attachment.obj 


More information about the Winpcap-users mailing list