Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!well!shiva From: shiva@well.sf.ca.us (Kenneth Porter) Newsgroups: comp.os.os2.misc Subject: Problem with DosReallocSeg() and multiple threads Keywords: DosReallocSeg _beginthread malloc bug Message-ID: <21987@well.sf.ca.us> Date: 6 Dec 90 07:07:54 GMT Distribution: comp Lines: 17 I'm running OS/2 1.2 on a Dell 386/20 and hitting a problem with DosReallocSeg() and multi-threading. If multiple threads try to realloc a segment, DosReallocSeg returns a garbage error code. I first found this while tracing through a _beginthread() that never returned. It was calling DosReallocSeg by way of malloc when it was allocating the new thread's stack. A quick test program which spawns two threads each of which realloc a segment allocated by thread 1 will quickly demonstrate the bug. The garbage error code returned is code-sensitive; ie. small edits change the value returned. Pending the arrival of 1.3, what can I do about this? Has anyone more information about this problem, what strokes it, and how it can be fixed? Ken (shiva@well.sf.ca.us)