[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with gnustep-base-1.6.0 Testing Output

From: Chris Beaham
Subject: Problem with gnustep-base-1.6.0 Testing Output
Date: Mon, 16 Jun 2003 14:33:15 +0200

First of all, sorry for the long delay!

On Freitag, Mai 30, 2003, at 05:57  Uhr, Adam Fedor wrote:

Chris Beaham wrote:
Well this doesn't seem to be the case for Solaris 8. For example when I run diningPhilosophers I get absolutely no output to the terminal and the program does not crash; I assume that it's deadlocked and have to cntlC out of it. The same goes for thread-except, I do not receive a single exception but it terminates without crashing! I installed

I think this is the case if threads are not enabled on your system (i.e. libobjc has to be compiled with threads enabled - when you compiled gcc or if you are using gnustep-objc, when you compiled > that).

We have located the problem with the diningPhilosophers.m test program in Base and it is not a GNUstep or thread problem; the algorithm is incorrect!!!

// Instance methods
- (void)sitAtChair:(NSNumber*)position
        int i;

        // Sit down
        chair = [position intValue];

        // Its a constant battle to feed yourself
        while (1)
                // Get the fork to our left
                [forks[chair] lockWhenCondition:FOOD_SERVED];

                // Get the fork to our right
                [forks[(chair + 1) % 5] lockWhenCondition:FOOD_SERVED];

A DEADLOCK occurs when all of the forks on the left are locked; then there are no forks on the right that can be locked! This is a typical race-condition problem and does not necessarily alway show itself. On FreeBSD 5.0 it works some of the time; on Solaris 8 both Intel and SPARC, it never worked for me.

I was too stupid to look into this earlier, as I assumed that the Base Testing programs had been tested! I spent an enormous amount of time reinstalling everything and compiling gcc with different configurations because it appeared that Solaris 8 was in itself a problem.

Anyway.... diningPhilosophers works (see modified file attached) BUT we only get output to the screen (either console terminal, or X-Terminal) when running it with "truss".

        truss obj/diningPhilosophers 2>>/dev/null

This is also true for "thread-except". We don't receive any output from the threads unless we use "truss". Obviously there is some tty setting that is not getting set, is set incorrectly, can't be set, or whatever......

Has anyone seen this behavior before with Solaris8???? BTW, we are NOT using gnustep-objc-1.3.0.

I find this situation quite frustrating to be honest. Everyone is currently discussing "Re: Why is GNUstep less successful than GTK and Qt??", but how is someone new to GNUstep every going to even get anywhere/started when the actual examples/tests are flawed and not documented? IMHO the basics should be exact, stable, and documented before the more intellectual discussions can be started. I'm a believer and don't need any convincing, however I'm sure that a lot of people would have given up long before digging into the code itself, even if it is very short and readable.

I have attached a suggest fix to diningPhilosophers.m that my colleague did; it adds another lock around the locking of the forks. There may be a better way to implement this, but atleast this gets it running.

There are also some other small problems with Solaris 8: source /usr/local/GNUstep/System/Makefiles/GNUstep.csh does not work and the autogsdoc crashs with an Illegal Instruction when I try and generate the docu.. I have been reluctant to document these problems in detail because others appear to have gotten everything(?) running; though I really question this. Their Voodoo must be stronger than mine, or they haven't taken the time to examine the code that's already been provided!

Let me know where GNUstep.csh doesn't work if you can. This is rarely used (most people use GNUstep.sh) so it isn't checked often.

I patched Solaris on Friday and this problem disapperead, so there must have been a csh problem/feature somewhere.

Anyway, it's all in vain, I switched today to Bash today!

A gdb backtrace of autogsdoc would be helpful. Solaris has some pecular behavior that doesn't appear on other OS (namely you can't assign NULL to a struct - it causes a crash).

I haven't had time to look into this yet, however I will let you know if anything is discovered.



Attachment: diningPhilosophers.m
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]