Sas6.56 Bug?

Sas6.56 Bug?

Post by David Eva » Thu, 23 May 1996 04:00:00



Have I found a Sas bug?  I have recently begun compiling my "project" on a
BUSY machine.  (Running a bbs with 3 lines active and 3 telnet ports)  It
actually works fine except when I have a VERY busy system.

I really don't know where to start looking for the bug.  

Its not a memory error (I have about 13+ megs free at any given moment)
I am using the optimizer (for speed and 68040 code).

If I dump users off my system, the critter compiles without a hitch.  It seems
to be related to task switching.  If I have more then 2 users online, the
system goes directly to a black screen which requires a powerdown and powerup
(all tasks frozen).

Should I ditch the optimizer? (Assuming its causing the problems??)  The code
really isn't time critical so optimization is not 100% necessary.  Should I go
back to "generic" code (all machines)?

Hope someone can give me a clue where to start looking!

 
 
 

Sas6.56 Bug?

Post by Michael van El » Fri, 24 May 1996 04:00:00



>Should I ditch the optimizer?

I'd say you should ditch the BBS system.

--
                                Michael van Elst


                                "A potential Snark may lurk in every tree."

 
 
 

Sas6.56 Bug?

Post by David Eva » Sat, 25 May 1996 04:00:00




ME> >Should I ditch the optimizer?

ME> I'd say you should ditch the BBS system.

Now thats not a constructive answer!!

 
 
 

Sas6.56 Bug?

Post by Wessel Danke » Sun, 26 May 1996 04:00:00



> If I have more then 2 users online, the system goes directly to a black
> screen which requires a powerdown and powerup
> (all tasks frozen).

I had the same sort of problem when I was still using an unexpanded A1200 with
no Fast RAM. The screen went blank, but everything else (including the
optimizer) just continued functioning. Every time I rebooted the machine, and
I would find the compiled+optimized program.

I find this very strange. Does the optimizer close Workbench or something,
when it starts to run out of memory?

--
Wessel Dankers


 
 
 

Sas6.56 Bug?

Post by Bryan Ewe » Wed, 29 May 1996 04:00:00


 > Have I found a Sas bug?  I have recently begun compiling my "project" on
a
 > BUSY machine.  (Running a bbs with 3 lines active and 3 telnet ports)  It
 > actually works fine except when I have a VERY busy system.

 > Should I ditch the optimizer?

A local programmer, not just authoring on a BBS but also _authoring_ a BBS,
opted for turning off SAS/C's optimization because of intermittant crashes.
I'd say safe bet to give it a shot, at least.

--
Bryan Ewert                              Amiga Users of Calgary

 
 
 

Sas6.56 Bug?

Post by Michael van El » Wed, 29 May 1996 04:00:00





>ME> >Should I ditch the optimizer?
>ME> I'd say you should ditch the BBS system.
>Now thats not a constructive answer!!

Well, I don't how you can replace the BBS system, but it should
be _obvious_ that this piece of software causes problems. And
the only cure for that is to avoid using it.

--
                                Michael van Elst


                                "A potential Snark may lurk in every tree."

 
 
 

Sas6.56 Bug?

Post by David Eva » Sun, 02 Jun 1996 04:00:00



ME> Well, I don't how you can replace the BBS system, but it should
ME> be _obvious_ that this piece of software causes problems. And
ME> the only cure for that is to avoid using it.

The bbs isn't the problem.  Its the compiler.  Using the same hardware AND
OTHER SOFTWARE, the compiler still causes resets.  I am implying/stating that
there is a BUG in the optimizer of Sas6.56 and hopeing someone has a clue how
to work around it.

 
 
 

Sas6.56 Bug?

Post by Michael van El » Sun, 02 Jun 1996 04:00:00



>I am implying/stating that
>there is a BUG in the optimizer of Sas6.56 and hopeing someone has a clue how
>to work around it.

Well, you can state this as often as you want.... But if only you
experience this then it is obvious that your system is the cause
and not the compiler.

--
                                Michael van Elst


                                "A potential Snark may lurk in every tree."

 
 
 

Sas6.56 Bug?

Post by Doug Walk » Tue, 04 Jun 1996 04:00:00





>ME> Well, I don't how you can replace the BBS system, but it should
>ME> be _obvious_ that this piece of software causes problems. And
>ME> the only cure for that is to avoid using it.

>The bbs isn't the problem.  Its the compiler.  Using the same hardware AND
>OTHER SOFTWARE, the compiler still causes resets.  I am implying/stating that
>there is a BUG in the optimizer of Sas6.56 and hopeing someone has a clue how
>to work around it.

It is possible that this is a bug in SAS/C, but from what I've seen
posted it looks equally likely that the bug is in the BBS software
and just shows up when using SAS/C.  Since the Amiga is a single-address-
space machine, the BBS program can quite easily cause another program
to fail.  I've seen several occurrences of external programs causing
SAS/C, and only SAS/C, to fail due to a bug in the external program.

It's unlikely that you will get a fix for this, so you can choose to
run an older version, upgrade or eliminate your BBS software while
running SAS/C, or get another machine to do your development on.
(I doubt if it's pleasant for callers to user your BBS while the
Global Optimizer is eating all your CPU anyway.)

--

 *|_o_o|\\    
 *|. o.| ||    Any opinions are mine, not those of
  | o  |//           SouthPeak Interactive
  ======
 Something's Brewing at http://www.southpeak.com!

 
 
 

Sas6.56 Bug?

Post by David Eva » Tue, 04 Jun 1996 04:00:00




ME> >I am implying/stating that
ME> >there is a BUG in the optimizer of Sas6.56 and hopeing someone has a clue
ME> how
ME> >to work around it.

ME> Well, you can state this as often as you want.... But if only you
ME> experience this then it is obvious that your system is the cause
ME> and not the compiler.

I agree!  However the purpose of my origional message was to determine if
others where experiancing the same problems.  This would help eliminate the
fact that its my system.

 
 
 

Sas6.56 Bug?

Post by B?rge N? » Fri, 07 Jun 1996 04:00:00


Quote:>>ME> >Should I ditch the optimizer?
>Well, I don't how you can replace the BBS system, but it should
>be _obvious_ that this piece of software causes problems.

I'm walking right into this minefield, but anyway: the peephole optimizer
in 6.56 _is_ reading free memory it shouldn't... (can't remember if it
writes too). This doesn't show up in all sources though.

-B?rge N?st

 
 
 

Sas6.56 Bug?

Post by Wessel Danke » Fri, 07 Jun 1996 04:00:00



>>>ME> >Should I ditch the optimizer?
>>Well, I don't how you can replace the BBS system, but it should
>>be _obvious_ that this piece of software causes problems.
> I'm walking right into this minefield, but anyway: the peephole optimizer
> in 6.56 _is_ reading free memory it shouldn't... (can't remember if it
> writes too). This doesn't show up in all sources though.

And I suspect it from accessing (write-only) DMA registers as well, causing
the the screen to go black on ChipMem-only machines.

--
Wessel Dankers

 
 
 

Sas6.56 Bug?

Post by Steve Krueg » Sat, 08 Jun 1996 04:00:00



|> >>>ME> >Should I ditch the optimizer?
|>
|> >>Well, I don't how you can replace the BBS system, but it should
|> >>be _obvious_ that this piece of software causes problems.
|>
|> > I'm walking right into this minefield, but anyway: the peephole optimizer
|> > in 6.56 _is_ reading free memory it shouldn't... (can't remember if it
|> > writes too). This doesn't show up in all sources though.
|>
|> And I suspect it from accessing (write-only) DMA registers as well, causing
|> the the screen to go black on ChipMem-only machines.
|>

Do you have any test cases that produce this result? If so, please
send them to me, and I will provide a fix.

sk

 
 
 

1. Bug in Sas/C6.56

More bugs in Sas/C 6.56.. And this one is sick. :(

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    FILE    *fp;
    char    buf;

    if(!(fp = fopen("fil", "r+")))
        exit(1);

    if(-1 == fseek(fp, -1, SEEK_END))
        exit(2);

    if(!fread(&buf, 1, 1, fp))
        exit(3);

    if(!fwrite(&buf, 1, 1, fp))
        exit(4);

    exit(0);

A file named "fil" must exist, and be non-empty.

This program will, if compiled with sas/c (sc resopt test.c link) exit
with returncode 4 when run.  With gcc (gcc test.c) if works as expected,
and returns 0.

The following works:

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    FILE    *fp;
    char    buf;

    if(!(fp = fopen("fil", "r+")))
        exit(1);

    if(-1 == fseek(fp, 0, SEEK_END))
        exit(2);

    if(!fwrite(&buf, 1, 1, fp))
        exit(4);

    exit(0);

The difference: seeking to the end of file, and no read.

Workaround: Put

fseek(fp, ftell(fp), SEEK_SET);

before the fwrite().  Yuk, that stinks. :)

======
Sas people:  Are sas working on '060 optimizing for the compiler?
Not on the Amiga, obviously, but on your other 68k platforms (are
there any? Mac?)
Any chance of a 6.57 patch?

----
______________________________________________________________

THOR homepage: http://www.cs.uit.no/~kjelli/thor.html

2. WAP phones for the Casio E-105

3. SAS6.5 sscanf() %n bug?

4. !PANIC N2! EDIFout don't work properly

5. Blizzard 1260 & 56 MHz?

6. W2K (client)& WNT (server)

7. DEC RZ-56 jumper settings?

8. CCNA and CCO login account

9. FS -- 56 KBS Modem $59 -- 7.1 GIG HD $303 -- 32 meg RAM $64

10. 4-Sale: ***AMAX II (v2.56) with 128K

11. ** WIN A US ROBOTICS 56.6KB MODEM **

12. Pace 56 Solo Upgrade