Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-12

Mac/PPC: Division by zero

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

EarMaster - Bent Olsen

Hi,

Some month ago someone gave me a tip how to avoid problems with divisions by zero, and on PowerPC we are using:

  SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow,
exUnderflow, exPrecision]);

This fixed some problem we had months back, but now we get a similar problem with couple of users, which reports the application will not start (just bouncing in the dock and disappears).

When we guide these users to start the application from a Terminal, the result is:

[FORMS.PP] ExceptionOccurred
Sender=EDivByZero
Exception=Division by zero
Stack trace:
[FORMS.PP] ExceptionOccurred

The application is otherwise very stable on i386 and most PPC we have tested, and this only occurs on PowerPC (I believe).

Has anybody experienced the same problem? And are there any settings we should be aware of in a forms resource file, which could cause a problem creating a form?

Any hint would be much appreciated.

Best regards, and Merry Christmas
Normann

Reply by email

Geoffrey Barton
to EarMaster - Bent Olsen
EarMaster - Bent Olsen wrote 36 lines
Hi, Some month ago someone gave me a tip how to avoid problems with divisions by zero, and on PowerPC we are using: SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]); This fixed some problem we had months back, but now we get a similar problem with couple of users, which reports the application will not start (just bouncing in the dock and disappears). When we guide these users to start the application from a Terminal, the result is: [FORMS.PP] ExceptionOccurred Sender=EDivByZero Exception=Division by zero Stack trace: [FORMS.PP] ExceptionOccurred The application is otherwise very stable on i386 and most PPC we have tested, and this only occurs on PowerPC (I believe). Has anybody experienced the same problem? And are there any settings we should be aware of in a forms resource file, which could cause a problem creating a form?

I had a div zero problem on a program compiled and running on an intelmac under 10.5 when run on a ppc G4 10.5.
It seemed to occur when a file was opened using reset(infile,1). The solution was to bracket the reset with an explicit setting of the filemode variable:-

     assignfile(infile,selectedfile);
     oldfilemode:=filemode;
     filemode:=read_only;
     reset(infile,1);
     filemode:=oldfilemode;

Happily the modified program also runs on the intelmac.

Geoffrey

Reply by email