This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

configtool hang and illegal op issues


I'm beginning eCos development with some colleagues,
so I'm not sure if there is a workaround for these
issues.  I'm using Windows ME.  Perhaps this is a bad
OS for eCos development?  It seems from reading this
list that more people have problems with Windows 9x. 
Any comments on OS choice?

The issue occurs when you try to build the library
from the configtool, which subsequently hangs.  There
seem to be references to this issue on the list:
http://sources.redhat.com/ml/ecos-discuss/2001-02/msg00078.html
http://sources.redhat.com/ml/ecos-discuss/2001-05/msg00396.html
http://sources.redhat.com/ml/ecos-discuss/2000-12/msg00101.html

I'm building the configtool from the top of CVS
(8-3-01)  ThreadFunc() in Subprocess.cpp is looping
forever.  Here is the excerpt:

void CSubprocess::ThreadFunc()
{

  TRACE(_T("Reading from process %d\n"),m_idProcess);
  
  DWORD dwAvail;
  
  while (!m_bKillThread &&
m_pfnContinue(m_pContinuationFuncParam) &&
::PeekNamedPipe(m_hrPipe, NULL, 0, 0, &dwAvail,
NULL)){
//TRACE(_T("P%d\n"),dwAvail);
    if(dwAvail){
      dwAvail=MIN(dwAvail,80); // Read a maximum of 80
characters at a time
      DWORD dwRead;
      char *buf=new char[dwAvail+1];
//TRACE(_T("R%d\n"),dwAvail);
      if(!::ReadFile(m_hrPipe, buf, dwAvail, &dwRead,
NULL)){
        TRACE(_T("ReadFile returns false\n"));
        delete [] buf;
        break;
      }
      buf[dwRead]='\0';
      Output(String::CStrToUnicodeStr(buf));
      delete [] buf;
    } else if(!ProcessAlive()){
     
TRACE(_T("m_bThreadTerminated=%d\n"),m_bThreadTerminated);
      break;
    } else {
      CeCosThreadUtils::Sleep(250);
    }
  }

There seems to be no way out of this loop except for
ProcessAlive() and m_pfnContinue which are both
hardcoded to return TRUE as far as I can tell.  If I
add a check for the exit code, the problem is
resolved:

void CSubprocess::ThreadFunc()
{
  TRACE(_T("Reading from process %d\n"),m_idProcess);
  
  DWORD dwAvail, dwExitCode;
  
  while (!m_bKillThread &&
m_pfnContinue(m_pContinuationFuncParam) &&
::PeekNamedPipe(m_hrPipe, NULL, 0, 0, &dwAvail,
NULL)){
//TRACE(_T("P%d\n"),dwAvail);
    if(dwAvail){
      dwAvail=MIN(dwAvail,80); // Read a maximum of 80
characters at a time
      DWORD dwRead;
      char *buf=new char[dwAvail+1];
//TRACE(_T("R%d\n"),dwAvail);
      if(!::ReadFile(m_hrPipe, buf, dwAvail, &dwRead,
NULL)){
        TRACE(_T("ReadFile returns false\n"));
        delete [] buf;
        break;
      }
      buf[dwRead]='\0';
      Output(String::CStrToUnicodeStr(buf));
      delete [] buf;
    } else if(!ProcessAlive()){
     
TRACE(_T("m_bThreadTerminated=%d\n"),m_bThreadTerminated);
      break;
    } else if (::GetExitCodeProcess(m_hProcess,
&dwExitCode) && dwExitCode!=STILL_ACTIVE) 
		break;
	else {
      CeCosThreadUtils::Sleep(250);
    }
  }


I also noticed that when saving the eCos project, I
get an illegal operation.  This is resolved by
commenting out the lines in eval_tcl_command() in
build.cxx that are encapsulated with #ifdef MSC_VER. 
I'm using ActiveTcl8.3.3.2-7.

--bill



__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]