D.gnu - Freezing bug on Linux
- teqDruid (34/34) Oct 04 2004 I was hoping that this Linux GC bug was in the back-end, so it wouldn't ...
- David Friedman (5/45) Oct 04 2004 Found the problem -- Solution: in thread.d:Thread.pauseAll, move the
- teqDruid (4/53) Oct 05 2004 Damn! I've gone over that code a few times, and didn't notice that.
- David Friedman (2/63) Oct 05 2004
I was hoping that this Linux GC bug was in the back-end, so it wouldn't be
replicated into GDC, but it would appear not. I'm going to look into it some
more, but I don't have a whole lot of experience with compilers (or pthreads, or
anything relevant to this bug) so I doubt I'll be able to figure it out. Walter
hasn't replied regarding it. I'd appriciate it if someone would help out and
take a look... It's really holding me up. Here's the code... it freezes, and can
only be killed by sending it a SIGKILL.
TIA
John
mport std.thread;
import std.gc;
int main() {
Object x;
int n;
GCStats stats;
Thread t = new Thread(delegate int() {
Object y;
while(1) {
y = new Object;
//Thread.yield();
}
return 0;
});
t.start();
while(1) {
x = new Object;
getStats(stats);
printf("%u %u %u %u\n",stats.poolsize,stats.usedsize,
stats.freeblocks,stats.pageblocks);
//Thread.yield();
// if (n++ == 1000) fullCollect();
}
return 0;
}
Oct 04 2004
teqDruid wrote:I was hoping that this Linux GC bug was in the back-end, so it wouldn't be replicated into GDC, but it would appear not. I'm going to look into it some more, but I don't have a whole lot of experience with compilers (or pthreads, or anything relevant to this bug) so I doubt I'll be able to figure it out. Walter hasn't replied regarding it. I'd appriciate it if someone would help out and take a look... It's really holding me up. Here's the code... it freezes, and can only be killed by sending it a SIGKILL. TIA JohnFound the problem -- Solution: in thread.d:Thread.pauseAll, move the "while (npause--)" loop outside of the for loop. This is in the version(linux) section (and version(GNU) for GDC). Davidmport std.thread; import std.gc; int main() { Object x; int n; GCStats stats; Thread t = new Thread(delegate int() { Object y; while(1) { y = new Object; //Thread.yield(); } return 0; }); t.start(); while(1) { x = new Object; getStats(stats); printf("%u %u %u %u\n",stats.poolsize,stats.usedsize, stats.freeblocks,stats.pageblocks); //Thread.yield(); // if (n++ == 1000) fullCollect(); } return 0; }
Oct 04 2004
Damn! I've gone over that code a few times, and didn't notice that. Thanks! Should I post the patch on the bugs NG, or do you want to? John On Mon, 04 Oct 2004 23:15:34 -0400, David Friedman wrote:teqDruid wrote:I was hoping that this Linux GC bug was in the back-end, so it wouldn't be replicated into GDC, but it would appear not. I'm going to look into it some more, but I don't have a whole lot of experience with compilers (or pthreads, or anything relevant to this bug) so I doubt I'll be able to figure it out. Walter hasn't replied regarding it. I'd appriciate it if someone would help out and take a look... It's really holding me up. Here's the code... it freezes, and can only be killed by sending it a SIGKILL. TIA JohnFound the problem -- Solution: in thread.d:Thread.pauseAll, move the "while (npause--)" loop outside of the for loop. This is in the version(linux) section (and version(GNU) for GDC). Davidmport std.thread; import std.gc; int main() { Object x; int n; GCStats stats; Thread t = new Thread(delegate int() { Object y; while(1) { y = new Object; //Thread.yield(); } return 0; }); t.start(); while(1) { x = new Object; getStats(stats); printf("%u %u %u %u\n",stats.poolsize,stats.usedsize, stats.freeblocks,stats.pageblocks); //Thread.yield(); // if (n++ == 1000) fullCollect(); } return 0; }
Oct 05 2004
Patch posted. teqDruid wrote:Damn! I've gone over that code a few times, and didn't notice that. Thanks! Should I post the patch on the bugs NG, or do you want to? John On Mon, 04 Oct 2004 23:15:34 -0400, David Friedman wrote:teqDruid wrote:I was hoping that this Linux GC bug was in the back-end, so it wouldn't be replicated into GDC, but it would appear not. I'm going to look into it some more, but I don't have a whole lot of experience with compilers (or pthreads, or anything relevant to this bug) so I doubt I'll be able to figure it out. Walter hasn't replied regarding it. I'd appriciate it if someone would help out and take a look... It's really holding me up. Here's the code... it freezes, and can only be killed by sending it a SIGKILL. TIA JohnFound the problem -- Solution: in thread.d:Thread.pauseAll, move the "while (npause--)" loop outside of the for loop. This is in the version(linux) section (and version(GNU) for GDC). Davidmport std.thread; import std.gc; int main() { Object x; int n; GCStats stats; Thread t = new Thread(delegate int() { Object y; while(1) { y = new Object; //Thread.yield(); } return 0; }); t.start(); while(1) { x = new Object; getStats(stats); printf("%u %u %u %u\n",stats.poolsize,stats.usedsize, stats.freeblocks,stats.pageblocks); //Thread.yield(); // if (n++ == 1000) fullCollect(); } return 0; }
Oct 05 2004








David Friedman <d3rdclsmail earthlink.net>