This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCJ application runs not too bad with shared libs, but crasheswithstatic libs - seems to be in _Jv_MonitorEnter


On Fri, 22 Nov 2002, Scott Gilbertson wrote:
> I commented out the sysconf call in is_mp (so is_mp always returns false),
> and the thing seems pretty solid now (i.e., I've hammered at it for about
> 10-15 minutes without a crash).  I also made a little C program that prints
> the results of the same sysconf call, to see if there's something screwy
> with my setup, but the little program runs just fine.

It's possible the sysconf call is buggy with threads.  I'd guess your
little C program isn't multithreaded.

Since sysconf reads /proc, it'll be sensitive to kernel version too.
Interestingly, GC_get_nprocs avoids it:

#ifdef GC_LINUX_THREADS
/* Return the number of processors, or i<= 0 if it can't be determined. */
int GC_get_nprocs()
{
    /* Should be "return sysconf(_SC_NPROCESSORS_ONLN);" but that   */
    /* appears to be buggy in many cases.               */
    /* We look for lines "cpu<n>" in /proc/stat.            */
...

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]