public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Stability Problem with Cygwin Pthreads
@ 2003-11-03  1:22 Arash Partow
  2003-11-03 11:20 ` Cliff Hones
  0 siblings, 1 reply; 7+ messages in thread
From: Arash Partow @ 2003-11-03  1:22 UTC (permalink / raw)
  To: cygwin

Hi,

for the people that are interested, this is where the threads
seem to be CONTINUALLY crashing:



/cygdrive/c/cygwin\bin>addr2line -e cygwin1.dll 0x610de964
../../../../../../cygwin-snapshot-20031028-1/newlib/libc/machine/i386/memcpy.S:53


.L11:
shrl $2,ecx
.p2align 2
rep          <------------
movsl

movl ebx,ecx
andl $3,ecx


from what i can see the memcpy is moving data from esi to edi
(ecx/4)'times (word blocks), however i don't think in the rep
(REPZ) of the ecx ever gets to zero, or before it does it tries
to copy data from a place which it does not have access to.



Regards


Arash Partow



__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net

_________________________________________________________________
Hot chart ringtones and polyphonics. Go to  
http://ninemsn.com.au/mobilemania/default.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Stability Problem with Cygwin Pthreads
  2003-11-03  1:22 Stability Problem with Cygwin Pthreads Arash Partow
@ 2003-11-03 11:20 ` Cliff Hones
  0 siblings, 0 replies; 7+ messages in thread
From: Cliff Hones @ 2003-11-03 11:20 UTC (permalink / raw)
  To: Arash Partow; +Cc: cygwin

Arash Partow wrote:
> for the people that are interested, this is where the threads
> seem to be CONTINUALLY crashing:
> 
> /cygdrive/c/cygwin\bin>addr2line -e cygwin1.dll 0x610de964
> ../../../../../../cygwin-snapshot-20031028-1/newlib/libc/machine/i386/memcpy.S:53
> 
> .L11:
> shrl $2,ecx
> .p2align 2
> rep          <------------
> movsl
> 
> movl ebx,ecx
> andl $3,ecx
> 
> from what i can see the memcpy is moving data from esi to edi
> (ecx/4)'times (word blocks), however i don't think in the rep
> (REPZ) of the ecx ever gets to zero, or before it does it tries
> to copy data from a place which it does not have access to.

Seeing this, and recalling that the crashes are indeterminate,
suggests to me the possibility that the problem may be caused
by thread switches during the execution of the REP MOVSL
instruction.  REP instructions are interruptable, and can
be safely restarted from where they left off, *but*
indeterminate behaviour will occur if the processor string
direction flag (in EFLAGS, set by CLD/STD) is not saved
and restored correctly during a thread switch following
an interrupt.

Not knowing the internal workings of Cygwin (or Windows) threads,
I don't know if this could be the problem, and unfortunately
I don't have the time to research it, but I offer it as a
hopefully useful suggestion.

-- 
Cliff


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Stability Problem with Cygwin Pthreads
@ 2003-11-03  5:28 Marcus Van Der Beek
  0 siblings, 0 replies; 7+ messages in thread
From: Marcus Van Der Beek @ 2003-11-03  5:28 UTC (permalink / raw)
  To: cygwin

Hi Arash,

I've built the cygwin1.dll with debugging info off, and I have
been able to replicate your problem. It seems to be comeing from
inside the string allocator in stl but a more deeper anlysis
shows the problem to be coming from the i386 memcpy, i don't
think the memcpy has been written properly.

Other than that i don't think there is much else anyone other
than the cygwin developers can do to correct this problem.


Other dlls i tested and saw the crash are:

the cygwin1.dll snapshot from the 28th,27th,25th,
the cygwin1.dll from latest release (as of last night)


btw i've noticed a new snapshot just now made on nov 2nd, haven't
tried that out yet, but it seems there have been some changes made
to pthreads.


Marcus





>Can anyone tell me why such a thing would happen and what are the
>fundamental difference between debug mode of cygwin dll and release
>versions other than the obvious debug info and extra asserts that go
>into the dll ?


>Also if possible could people download the ThreadTest source code
>and also download the latest cygwin dll snapshot and tell me if
>they see the test application crash or not, then if you know how
>to build cygwin also download the cygwin source and rebuild the dll
>with debug info and then see if it crashes, also rebuild it without
>debug info and see if it crashes or not.



>If a few people could try this out and give me their results, it
>would help understand what is going wrong with these 3 different
>builds. I hoping to resolve this issue with the help of the cygwin
>community before the next major release.

>Arash

_________________________________________________________________
Hot chart ringtones and polyphonics. Go to  
http://ninemsn.com.au/mobilemania/default.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Stability Problem with Cygwin Pthreads
@ 2003-11-03  0:29 Marcus Van Der Beek
  0 siblings, 0 replies; 7+ messages in thread
From: Marcus Van Der Beek @ 2003-11-03  0:29 UTC (permalink / raw)
  To: cygwin

Hi

>
>>I tested your program and found out that the crashes were in compiler 
>>generated code (especially in STL code).  Upgrading to the latest version 
>>of everything (GCC in particular) solved everything for me without using 
>>any Cygwin snapshots.


I've found that it crashes too, I've tried compiling the test app
with a cygwin1.dll whicyh i had built in debug mode, and it works fine,
i built again but this time with debug off, and it crashes, I've tried
running the app with the latest release cygwin1.dll, it crashes and i've
tried the snapshot dlls from 25th, 27th, 28th. They all seem to crash.

Now from what i can see and as Arash Partow has pointed out the problem
seems to be in the memcpy routine, addr2line of the address given when it
crashes on my win2k box points to the memcpy.s in i386. My assembler isn't
good but it seems the code tried to access unallocated mem, with within a
context switch. its just a theory....


Marcus

_________________________________________________________________
Hot chart ringtones and polyphonics. Go to  
http://ninemsn.com.au/mobilemania/default.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Stability Problem with Cygwin Pthreads
@ 2003-11-03  0:20 Arash Partow
  0 siblings, 0 replies; 7+ messages in thread
From: Arash Partow @ 2003-11-03  0:20 UTC (permalink / raw)
  To: cygwin; +Cc: J.Kraaijeveld

Hi Joost,


>I tested your program and found out that the crashes were in compiler 
>generated code (especially in STL code).  Upgrading to the latest version 
>of everything (GCC in particular) solved everything for me without using 
>any Cygwin snapshots.

I've updated everything too, atm i'm using the "new"
gcc 3.3.1-3, yet it still crashes, plus i don't think
the changes made recently to the snapshots exist in the
cygwin release.

However i too do think there is an issue with cygwin's Pthreads
and the stl string class, more so i think there is an issue
with the underlying infrastructure that it uses, ie: the i386
assembler code.

I've found many times when using the cygwin1.dll i've built
the crashes occur in those libraries. however due to the fact
that the release dll does not have debugging on i wasn't able
to investigate where abouts the crashes were residing from within
gdb.

The fact still remains, debug built dlls work, snapshot and release dlls
don't, why? does anyone know?

Regards


Arash

_________________________________________________________________
Hot chart ringtones and polyphonics. Go to  
http://ninemsn.com.au/mobilemania/default.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Stability Problem with Cygwin Pthreads
@ 2003-11-02 16:18 Joost Kraaijeveld
  0 siblings, 0 replies; 7+ messages in thread
From: Joost Kraaijeveld @ 2003-11-02 16:18 UTC (permalink / raw)
  To: Arash Partow, cygwin; +Cc: tpfaff

> Also if possible could people download the ThreadTest source code
> and also download the latest cygwin dll snapshot and tell me if
> they see the test application crash or not, then if you know how
> to build cygwin also download the cygwin source and rebuild the dll
> with debug info and then see if it crashes, also rebuild it without
> debug info and see if it crashes or not.
I tested your program and found out that the crashes were in compiler generated code (especially in STL code).  Upgrading to the latest version of everything (GCC in particular) solved everything for me without using any Cygwin snapshots.

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
email: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Stability Problem with Cygwin Pthreads
@ 2003-11-02  7:17 Arash Partow
  0 siblings, 0 replies; 7+ messages in thread
From: Arash Partow @ 2003-11-02  7:17 UTC (permalink / raw)
  To: cygwin; +Cc: tpfaff

Hi All,

This post is about cygwins pthreads. people following this issue
will know there have been some stability issues with cygwin's
pthreads and since last week A LOT of them have been resolved.
Yet as more of these problems are resolved more problems in the
same area.


My issue is, I have compiled the dll from the snapshots (in debug mode),
the dll I compiled is fine it does not crash the pthread test application
I run, however when I re-compile the dll without debug on or if I use the
pre-built snapshot dll cygwin1-20031028.dll.bz2 the pthread test
application crashes (continually without fail!).

Can anyone tell me why such a thing would happen and what are the
fundamental difference between debug mode of cygwin dll and release
versions other than the obvious debug info and extra asserts that go
into the dll ?


Also if possible could people download the ThreadTest source code
and also download the latest cygwin dll snapshot and tell me if
they see the test application crash or not, then if you know how
to build cygwin also download the cygwin source and rebuild the dll
with debug info and then see if it crashes, also rebuild it without
debug info and see if it crashes or not.

Thread Test source: http://www.partow.net/downloads/ThreadTest-Prototype.zip
Snapshot dll      : http://cygwin.com/snapshots/cygwin1-20031028.dll.bz2
Cygwin source     : http://cygwin.com/snapshots/cygwin-src-20031028.tar.bz2

If a few people could try this out and give me their results, it
would help understand what is going wrong with these 3 different
builds. I hoping to resolve this issue with the help of the cygwin
community before the next major release.

My current setup is win2k sp4, gcc 3.3.1 (cygming special)


Any help or advice would be very much appreciated.


Regards


Arash




PS: I have stack traces from GDB, but seeing as though it would be
    easier to see the problems for yourselves i haven't appended
    any, but in the off chance anyone would like stack traces and
    such please e-mail me and i will only be too happy to oblige.







__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net

_________________________________________________________________
Hot chart ringtones and polyphonics. Go to  
http://ninemsn.com.au/mobilemania/default.asp


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-11-03 11:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-03  1:22 Stability Problem with Cygwin Pthreads Arash Partow
2003-11-03 11:20 ` Cliff Hones
  -- strict thread matches above, loose matches on Subject: below --
2003-11-03  5:28 Marcus Van Der Beek
2003-11-03  0:29 Marcus Van Der Beek
2003-11-03  0:20 Arash Partow
2003-11-02 16:18 Joost Kraaijeveld
2003-11-02  7:17 Arash Partow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).