[prev in list] [next in list] [prev in thread] [next in thread] 

List:       winpcap-users
Subject:    Re: [Winpcap-users] pcap_compile leak?
From:       "Paul Heil" <paul.heil () gmail ! com>
Date:       2007-09-26 14:32:18
Message-ID: 2fc4ff370709260732t4a6223f6o7a0762854458c98e () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


So, the problem isn't that I've forgotten to release memory in my code, it's
a register leak in the PCAP
code? That I can work around, so that's good news for me. I just
wanted to make sure I wasn't doing something wrong.


Thanks,
Paul

On 9/25/07, Guy Harris <guy@alum.mit.edu> wrote:
>
>
> On Sep 25, 2007, at 3:52 PM, Paul Heil wrote:
>
> > I have a pcap application that uses a filter (as below). The 15th
> > time I call pcap_compile(), it fails with the error "too many
> > registers needed to evaluate expression".
>
> Wow.  I thought I fixed that one in *2001*:
>
>         revision 1.161
>         date: 2001-12-18 01:10:49 -0800;  author: guy;  state:
> Exp;  lines:
> +2 -1
>         Free up both "registers" (scratch memory locations, really) used
> by an
>         arithmetic expression in a filter; otherwise, we leak registers
> when
>         compiling arithmetic expressions.
>
> > I'm using PCAP v4.0.1 and developer pack 4.0.1.
>
> WinPcap 4.0.1 should be based on a version of libpcap with that fix
> (which first showed up in libpcap 0.8); perhaps there's another place
> where the code generator leaks registers.
>
> > Is there a call other than pcap_freecode() I should be using to free
> > the memory allocated in the pcap_compile() command?
>
> No.  This leak isn't a memory leak, so pcap_freecode() won't help.
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users@winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
>

[Attachment #5 (text/html)]

So, the problem isn&#39;t that I&#39;ve forgotten to release memory in my code, \
it&#39;s a register leak in the PCAP \
code?&nbsp;That&nbsp;I&nbsp;can&nbsp;work&nbsp;around,&nbsp;so&nbsp;that&#39;s&nbsp;go \
od&nbsp;news&nbsp;for&nbsp;me.&nbsp;I&nbsp;just&nbsp;wanted&nbsp;to&nbsp;make&nbsp;sure&nbsp;I&nbsp;wasn&#39;t&nbsp;doing&nbsp;something&nbsp;wrong. \
 <br><br>Thanks,<br>Paul<br><br><div><span class="gmail_quote">On 9/25/07, <b \
class="gmail_sendername">Guy Harris</b> &lt;<a \
href="mailto:guy@alum.mit.edu">guy@alum.mit.edu</a>&gt; wrote:</span><blockquote \
class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; \
margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: \
1px; border-left-style: solid; padding-left: 1ex"> <br>On Sep 25, 2007, at 3:52 PM, \
Paul Heil wrote:<br><br>&gt; I have a pcap application that uses a filter (as below). \
The 15th<br>&gt; time I call pcap_compile(), it fails with the error &quot;too \
many<br>&gt; registers needed to evaluate expression&quot;. <br><br>Wow.&nbsp;&nbsp;I \
thought I fixed that one in \
*2001*:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;revision \
1.161<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;date: 2001-12-18 01:10:49 \
-0800;&nbsp;&nbsp;author: guy;&nbsp;&nbsp;state: Exp;&nbsp;&nbsp;lines:<br>+2 \
-1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free up both \
&quot;registers&quot; (scratch memory locations, really) used by an \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arithmetic expression in a \
filter; otherwise, we leak registers \
when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compiling arithmetic \
expressions.<br><br>&gt; I&#39;m using PCAP v4.0.1 and developer pack \
4.0.1.<br><br>WinPcap 4.0.1 should be based on a version of libpcap with that fix \
<br>(which first showed up in libpcap 0.8); perhaps there&#39;s another \
place<br>where the code generator leaks registers.<br><br>&gt; Is there a call other \
than pcap_freecode() I should be using to free<br>&gt; the memory allocated in the \
pcap_compile() command? <br><br>No.&nbsp;&nbsp;This leak isn&#39;t a memory leak, so \
pcap_freecode() won&#39;t \
help.<br>_______________________________________________<br>Winpcap-users mailing \
list<br><a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org \
</a><br><a href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br></blockquote></div><br>




_______________________________________________
Winpcap-users mailing list
Winpcap-users@winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic