1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 18:55:38 +02:00

Bug 269223 - Spawner broken pipe problem

This commit is contained in:
Anton Leherbauer 2009-03-19 13:21:44 +00:00
parent 5ae5f6b33a
commit bd18850a17
4 changed files with 975 additions and 963 deletions

View file

@ -12,6 +12,7 @@ JDK_INCLUDES= "$(JAVA_HOME)/include"
JDK_OS_INCLUDES= "$(JAVA_HOME)/include/$(OS)" JDK_OS_INCLUDES= "$(JAVA_HOME)/include/$(OS)"
CC=g++ CC=g++
DEBUG_FLAGS = -D_UNICODE -DDEBUG_MONITOR -DREAD_REPORT
CFLAGS = -DUNICODE -I$(JDK_INCLUDES) -I$(JDK_OS_INCLUDES) CFLAGS = -DUNICODE -I$(JDK_INCLUDES) -I$(JDK_OS_INCLUDES)
CXX=g++ CXX=g++
CXXFLAGS=$(CFLAGS) CXXFLAGS=$(CFLAGS)

View file

@ -868,7 +868,7 @@ void _cdecl waitProcTermination(void* pv)
cleanUpProcBlock(pInfo + i); cleanUpProcBlock(pInfo + i);
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, _T("waitProcTermination: set PID %i to 0\n"), swprintf(buffer, _T("waitProcTermination: set PID %i to 0\n"),
pid, pInfo[i].pid,
GetLastError()); GetLastError());
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif

View file

@ -125,6 +125,17 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_rea
nBuffOffset = 0; nBuffOffset = 0;
break; break;
} }
else
{
// buffer overflow?
// according to msdn this happens in message read mode only
#ifdef DEBUG_MONITOR
_stprintf(buffer, _T("Buffer full - %i, bytes read: %i\n"), fd, nNumberOfBytesRead);
OutputDebugStringW(buffer);
#endif
// nNumberOfBytesRead can be 0 here for unknown reason (bug 269223)
nNumberOfBytesRead = nNumberOfBytesToRead;
}
} }
} }
if(nNumberOfBytesRead > 0) if(nNumberOfBytesRead > 0)
@ -138,7 +149,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_rea
CloseHandle(overlapped.hEvent); CloseHandle(overlapped.hEvent);
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
#ifdef READ_REPORT #ifdef READ_REPORT
_stprintf(buffer, _T("End read %i\n"), fd); _stprintf(buffer, _T("End read %i - bytes read: %d\n"), fd, nBuffOffset);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
#endif #endif