[Mono-list] Weird Queue morphing

Pablo Baena pbaena@uol.com.ar
08 Nov 2002 14:48:14 +0000


--=-y3MUKmcxAtHFqaYBjHwV
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

The Queue class is having problems Dequeing. 
I got around this by doing queue.Peek() and then queue.Dequeue(). It
won't corrupt the queue.

I will fill a bug report if it isn't already.
Pablo

On Fri, 2002-11-08 at 17:16, Erik C wrote:

    Ok please help me figure out if my code is bad(most
    likely the case)...or if this is a bug in the Queue
    class. It looks like the Queue fills up with 20
    objects and then as I dequeue them suddenly the value
    objects changes after I've dequeued 16 of them?!?!
    
    The following debug output was made from the attached
    code(the code is an attempt of making a port scanner)
    
    thanks in advance,
    
    -Erik-
    University of Florida
    
    my compile line::
    mcs -checked -o Scanner.exe -t:exe Scanner.cs
    
    my run line::
    mono Scanner.exe -p 1-20 127.0.0.1
    
    snip of output::
    Just dequeued emptyQ=False targetQ.COunt=5 port=15
    ip=127.0.0.1
    Q size=5
    This is the Queue now:
    Port=16 IP=127.0.0.1 isOpen=False
    Port=17 IP=127.0.0.1 isOpen=False
    Port=18 IP=127.0.0.1 isOpen=False
    Port=19 IP=127.0.0.1 isOpen=False
    Port=20 IP=127.0.0.1 isOpen=False
    Just dequeued emptyQ=False targetQ.COunt=4 port=16
    ip=127.0.0.1
    Q size=4
    This is the Queue now:
    Port=1 IP=127.0.0.1 isOpen=False
    Port=2 IP=127.0.0.1 isOpen=False
    Port=3 IP=127.0.0.1 isOpen=False
    Port=4 IP=127.0.0.1 isOpen=False
    Just dequeued emptyQ=False targetQ.COunt=3 port=1
    ip=127.0.0.1
    Q size=3
    This is the Queue now:
    Port=2 IP=127.0.0.1 isOpen=False
    Port=3 IP=127.0.0.1 isOpen=False
    Port=4 IP=127.0.0.1 isOpen=False
    
    
    __________________________________________________
    Do you Yahoo!?
    U2 on LAUNCH - Exclusive greatest hits videos

http://launch.yahoo.com/u2

    

--=-y3MUKmcxAtHFqaYBjHwV
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.0.4">
</HEAD>
<BODY>
The Queue class is having problems Dequeing. 
<BR>
I got around this by doing queue.Peek() and then queue.Dequeue(). It won't corrupt the queue.
<BR>

<BR>
I will fill a bug report if it isn't already.
<BR>
Pablo
<BR>

<BR>
On Fri, 2002-11-08 at 17:16, Erik C wrote:
    <BLOCKQUOTE>
<PRE><FONT COLOR="#737373"><FONT SIZE="3"><I>Ok please help me figure out if my code is bad(most</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>likely the case)...or if this is a bug in the Queue</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>class. It looks like the Queue fills up with 20</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>objects and then as I dequeue them suddenly the value</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>objects changes after I've dequeued 16 of them?!?!</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>The following debug output was made from the attached</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>code(the code is an attempt of making a port scanner)</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>thanks in advance,</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>-Erik-</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>University of Florida</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>my compile line::</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>mcs -checked -o Scanner.exe -t:exe Scanner.cs</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>my run line::</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>mono Scanner.exe -p 1-20 127.0.0.1</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>snip of output::</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Just dequeued emptyQ=False targetQ.COunt=5 port=15</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>ip=127.0.0.1</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Q size=5</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>This is the Queue now:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=16 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=17 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=18 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=19 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=20 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Just dequeued emptyQ=False targetQ.COunt=4 port=16</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>ip=127.0.0.1</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Q size=4</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>This is the Queue now:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=1 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=2 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=3 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=4 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Just dequeued emptyQ=False targetQ.COunt=3 port=1</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>ip=127.0.0.1</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Q size=3</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>This is the Queue now:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=2 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=3 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Port=4 IP=127.0.0.1 isOpen=False</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>__________________________________________________</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Do you Yahoo!?</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>U2 on LAUNCH - Exclusive greatest hits videos</FONT></FONT></I></PRE>
    </BLOCKQUOTE>
<A HREF="http://launch.yahoo.com/u2"><FONT SIZE="3"><I>http://launch.yahoo.com/u2</FONT></I></A>
    <BLOCKQUOTE>
<PRE></PRE>
    </BLOCKQUOTE>
</BODY>
</HTML>

--=-y3MUKmcxAtHFqaYBjHwV--