[ECOS] RE: New revision of select() hangs my code

Dan Jakubiec dan@systech.com
Mon Nov 25 11:23:00 GMT 2002


Thanks for looking into that, Nick.  My configuration info is:


1) I'm using the Linux synthetic target with the new_net template.  I'm
running with the synthetic I/O auxiliary under RedHat 8.0.

2) My stack is 16384 bytes and I am calling select directly out of my
top-level function.

3) I updated my CVS at the end of last week (which is what caused my
problem).  Until I picked up the changes, the code had been working fine.


I'll run the experiments you suggested.  Thanks for the help!

-- Dan


-----Original Message-----
From: Nick Garnett [mailto:nickg@ecoscentric.com]
Sent: Saturday, November 23, 2002 8:59 AM
To: Dan Jakubiec
Cc: 'ecos-discuss@source.redhat.com'
Subject: Re: New revision of select() hangs my code


Dan Jakubiec <dan@systech.com> writes:

> I just grabbed the latest version of
> ecos/packages/io/fileio/current/src/select.cxx (I went from rev 1.8 to
1.9).
> The changes in this file break my current code which uses the select()
call.
> I looked through the code changes, but didn't see anything obviously
wrong.
> 
> Nick Garnett:  Would you mind having a look at this to see if you can see
> something?
> 

I cannot see anything wrong with your code. I even built it into a
test program and ran it, it seems to do the right thing -- I cannot
reproduce the problem. I've attached my test program for you to try
out. I ran it on a PC using the standard net template, and got the
following output:

Main: calling pthread_join(thread1)
Thread2: calling sleep(5)
Thread1: calling socket()
Thread1: calling bind()
Thread1: calling listen()
Thread1: calling accept()
Thread2: calling socket()
Thread2: calling connect()
Thread2: writing data to stream
Thread1: calling sleep(5)
got data
got data
got data
Finished flushing data

If I set the #if in pthread_entry2() to zero, I get the same, without
the "got data" lines.

You don't say what configuration you are using, maybe there is
something in that which is upsetting things. Try the standard net
template, and check that your CVS checkout is up to date. Also check
that you are not getting stack overflows -- it may be that select() is
using a little more stack than it used to.



-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list