D1 garbage collector + threads + malloc = garbage?

2009-12-11 Thread Bane
Bug with GC fullCollect() in multithreaded environment. Grauzone explained it here http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=99610 Test case that freezes app (tested on 1.053): import std.c.stdlib; import std.stdio; import std.gc; import std.thread; i

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-11 Thread Leandro Lucarella
Bane, el 11 de diciembre a las 06:00 me escribiste: > Bug with GC fullCollect() in multithreaded environment. Grauzone explained it > here > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=99610 > > Test case that freezes app (tested on 1.053): > > > import

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-11 Thread Sean Kelly
Leandro Lucarella Wrote: > Bane, el 11 de diciembre a las 06:00 me escribiste: > > Bug with GC fullCollect() in multithreaded environment. Grauzone explained > > it here > > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=99610 To be perfectly safe, it's a t

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-11 Thread Walter Bright
Sean Kelly wrote: Leandro Lucarella Wrote: Bane, el 11 de diciembre a las 06:00 me escribiste: Bug with GC fullCollect() in multithreaded environment. Grauzone explained it here http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=99610 To be perfectly safe,

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-11 Thread Walter Bright
Leandro Lucarella wrote: I want to be sure the bug is present before the patch and fixed after the patch before submiting the patch via Bugzilla. It's a good fix, I checked in a patch for it.

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Bane
Leandro Lucarella Wrote: > Bane, el 11 de diciembre a las 06:00 me escribiste: > > Bug with GC fullCollect() in multithreaded environment. Grauzone explained > > it here > > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=99610 > > > > Test case that freezes

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Leandro Lucarella
Leandro Lucarella, el 12 de diciembre a las 11:18 me escribiste: > Walter Bright, el 11 de diciembre a las 20:51 me escribiste: > > Leandro Lucarella wrote: > > >I want to be sure the bug is present before the patch and fixed after the > > >patch before submiting the patch via Bugzilla. > > > > It

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Leandro Lucarella
Walter Bright, el 11 de diciembre a las 20:51 me escribiste: > Leandro Lucarella wrote: > >I want to be sure the bug is present before the patch and fixed after the > >patch before submiting the patch via Bugzilla. > > It's a good fix, I checked in a patch for it. Great, thanks! -- Leandro Luca

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Sean Kelly
Walter Bright Wrote: > Sean Kelly wrote: > > Leandro Lucarella Wrote: > > > >> Bane, el 11 de diciembre a las 06:00 me escribiste: > >>> Bug with GC fullCollect() in multithreaded environment. Grauzone > >>> explained it here > >>> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digit

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Bane
> I wanted to reproduce it to make a bug report to attach the patch but > I couldn't. I replaced msleep() with usleep() (and multiplied the values > by 1000) because I'm in Linux, but that's all I changed. I have an old AMD > Athlon 1.8GHz. How do you reproduce it? > > I want to be sure the bug is

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Bane
Walter Bright Wrote: > Leandro Lucarella wrote: > > I want to be sure the bug is present before the patch and fixed after the > > patch before submiting the patch via Bugzilla. > > It's a good fix, I checked in a patch for it. Thanx :) I tested it with patched phobos on winxp/centos and it work

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Walter Bright
Sean Kelly wrote: Walter Bright Wrote: Sean Kelly wrote: Leandro Lucarella Wrote: Bane, el 11 de diciembre a las 06:00 me escribiste: Bug with GC fullCollect() in multithreaded environment. Grauzone explained it here http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Walter Bright
Leandro Lucarella wrote: If you could add a small description of what the commit is about besides pointing the NG discussion/Bugzilla number, as you are doing with DMD now, it would be really great! =) Just click on the link! (At least, that's how the changelog works.) Also, I added a comment

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Sean Kelly
Walter Bright Wrote: > Sean Kelly wrote: > > Walter Bright Wrote: > > > >> Sean Kelly wrote: > >>> Leandro Lucarella Wrote: > >>> > Bane, el 11 de diciembre a las 06:00 me escribiste: > > Bug with GC fullCollect() in multithreaded environment. > > Grauzone explained it here > >

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Walter Bright
Sean Kelly wrote: Walter Bright Wrote: No, because the thread doing the GC collection has locked the GC. Any other thread attempting to alloc will wait on that lock. There is only one GC lock. Yeah, but it releases the lock when the collection completes, and the it retries the allocation to ac

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-12 Thread Sean Kelly
Walter Bright Wrote: > Sean Kelly wrote: > > Walter Bright Wrote: > >> No, because the thread doing the GC collection has locked the GC. > >> Any other thread attempting to alloc will wait on that lock. There > >> is only one GC lock. > > > > Yeah, but it releases the lock when the collection com

Re: D1 garbage collector + threads + malloc = garbage?

2009-12-13 Thread Leandro Lucarella
Walter Bright, el 12 de diciembre a las 10:29 me escribiste: > Leandro Lucarella wrote: > >If you could add a small description of what the commit is about besides > >pointing the NG discussion/Bugzilla number, as you are doing with DMD now, > >it would be really great! =) > > Just click on the li