Sign in Join

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

Mailing lists / lazarus / 2016-03

Bug in FPC 3.0 discovered

7 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

LacaK

Hello,
this is notification for users, who plan upgrade to latest Lazarus 1.6 with FPC 3.0 from older versions which came with FPC 2.6.x

There was discovered bug in FPC 3.0 (already fixed in trunk) when currency and double data types are involved in mathematical operations like addition or multiplication.
Bug can be reproduced using simple example:

var
  c: currency;
  d: double;
begin
   c:=123.45;
   d:=100;
   writeln(c*d);  // wrong result 123450000 instead of 12345
end.

Bug does not affects all platforms . For example Win32, Linux64 are not affected. But Win64 IS affected.

This bug can cause unpredictable misbehavior.
For example in database applications using fcl-db/sqlDB and NUMERIC or DECIMAL data types as described in bug report #29760

-Laco.

Reply by email

Mark Morgan Lloyd
to LacaK: this is notification for users, who plan upgrade to latest Lazarus 1.6 with FPC 3.0 from…
LacaK wrote 24 lines
Hello, this is notification for users, who plan upgrade to latest Lazarus 1.6 with FPC 3.0 from older versions which came with FPC 2.6.x There was discovered bug in FPC 3.0 (already fixed in trunk) when currency and double data types are involved in mathematical operations like addition or multiplication. Bug can be reproduced using simple example: var c: currency; d: double; begin c:=123.45; d:=100; writeln(c*d); // wrong result 123450000 instead of 12345 end. Bug does not affects all platforms . For example Win32, Linux64 are not affected. But Win64 IS affected. This bug can cause unpredictable misbehavior. For example in database applications using fcl-db/sqlDB and NUMERIC or DECIMAL data types as described in bug report #29760

Nota bene (Koenraad, Bo): *Does* affect Raspberry Pi.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mattias Gaertner
to Michael Van Canneyt: Yes. Michael.
Show quoted text 15 lines
On Fri, 11 Mar 2016, Mattias Gaertner wrote: > On Fri, 11 Mar 2016 13:57:02 +0100 > LacaK wrote: > >> [...] >> There was discovered bug in FPC 3.0 (already fixed in trunk) when >> currency and double data types are involved in mathematical operations >> like addition or multiplication. > > Is this bug http://bugs.freepascal.org/view.php?id=29760 ? Yes.

Is it already fixed in 3.0.1 and 3.1.1?

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 20 lines
On Fri, 11 Mar 2016 14:12:41 +0100 (CET) Michael Van Canneyt wrote: > > > On Fri, 11 Mar 2016, Mattias Gaertner wrote: > >> On Fri, 11 Mar 2016 13:57:02 +0100 >> LacaK wrote: >> >>> [...] >>> There was discovered bug in FPC 3.0 (already fixed in trunk) when >>> currency and double data types are involved in mathematical operations >>> like addition or multiplication. >> >> Is this bug http://bugs.freepascal.org/view.php?id=29760 ? > > Yes. Is it already fixed in 3.0.1 and 3.1.1?

3.1.1, yes.

3.0.1, I don't think so.

IMHO we should release a 3.0.2 ASAP.

Michael.

Reply by email

Edson F. Lidorio
to LacaK: this is notification for users, who plan upgrade to latest Lazarus 1.6 with FPC 3.0 from…
LacaK wrote 32 lines
Hello, this is notification for users, who plan upgrade to latest Lazarus 1.6 with FPC 3.0 from older versions which came with FPC 2.6.x There was discovered bug in FPC 3.0 (already fixed in trunk) when currency and double data types are involved in mathematical operations like addition or multiplication. Bug can be reproduced using simple example: var c: currency; d: double; begin c:=123.45; d:=100; writeln(c*d); // wrong result 123450000 instead of 12345 end. Bug does not affects all platforms . For example Win32, Linux64 are not affected. But Win64 IS affected. This bug can cause unpredictable misbehavior. For example in database applications using fcl-db/sqlDB and NUMERIC or DECIMAL data types as described in bug report #29760 -Laco. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

I think this error, also related to this issue which reported in [1]

http://bugs.freepascal.org/view.php?id=29781

Reply by email