View Issue Details

IDProjectCategoryView StatusLast Update
0036458FPCPackagespublic2019-12-23 18:00
ReporterEric HeijnenAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSMacOS CatalinaOS Version10.15.1
Product Version3.0.4Product Build2019/11/01 
Target VersionFixed in Version3.3.1 
Summary0036458: TRegistry.readFloat causes stack corruption on MacOS
DescriptionI'm porting an windows app over to Mac and use the registry class to save/load userdefined variables.
A few of them(2) are floating point values, and I use TRegistry.readFloat to read it out, but when doing so the stack gets corrupted
Steps To Reproduceuses registry;
...
var
  r: Tregistry;
  v: double;
begin
  r:=TRegistry.Create;
  r.RootKey := HKEY_CURRENT_USER;
  if r.OpenKey('\Software\Float Tester',true) then
    r.WriteFloat('FloatTest',100.5);

  v:=r.ReadFloat('FloatTest');
  r.free;
end
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

Thaddy de Koning

2019-12-19 16:21

reporter   ~0119953

Note there were quite significant - recent - modifications to TRegistry.
This should already be fixed in 3.2.0 because most of it was back-ported from trunk.
Also note I do not use TRegistry in Mac at all so I might be wrong.

Eric Heijnen

2019-12-19 16:22

reporter   ~0119954

Last edited: 2019-12-19 16:26

View 2 revisions

Also affects ReadBinaryData
When you tell it to read 3 bytes, it overwrites 6 bytes
when you tell it to read 5 bytes, it overwrites 10 bytes

Bart Broersma

2019-12-19 18:20

reporter   ~0119960

Please try with trunk version.

Eric Heijnen

2019-12-19 20:53

reporter   ~0119961

Last edited: 2019-12-19 22:22

View 5 revisions

The trunk version works properly

Bart Broersma

2019-12-19 22:35

reporter   ~0119965

OK, nice.

Thaddy de Koning

2019-12-20 09:53

reporter   ~0119969

I expected that. Tnx Bart for the mods. Can close?

Michael Van Canneyt

2019-12-23 14:19

administrator   ~0120040

Closing as requested.

Issue History

Date Modified Username Field Change
2019-12-19 12:06 Eric Heijnen New Issue
2019-12-19 16:21 Thaddy de Koning Note Added: 0119953
2019-12-19 16:22 Eric Heijnen Note Added: 0119954
2019-12-19 16:26 Eric Heijnen Note Edited: 0119954 View Revisions
2019-12-19 18:20 Bart Broersma Note Added: 0119960
2019-12-19 20:53 Eric Heijnen Note Added: 0119961
2019-12-19 22:21 Eric Heijnen Note Edited: 0119961 View Revisions
2019-12-19 22:21 Eric Heijnen Note Edited: 0119961 View Revisions
2019-12-19 22:21 Eric Heijnen Note Edited: 0119961 View Revisions
2019-12-19 22:22 Eric Heijnen Note Edited: 0119961 View Revisions
2019-12-19 22:35 Bart Broersma Note Added: 0119965
2019-12-20 09:53 Thaddy de Koning Note Added: 0119969
2019-12-23 14:19 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-12-23 14:19 Michael Van Canneyt Status new => resolved
2019-12-23 14:19 Michael Van Canneyt Resolution open => fixed
2019-12-23 14:19 Michael Van Canneyt Fixed in Version => 3.3.1
2019-12-23 14:19 Michael Van Canneyt FPCTarget => 3.2.0
2019-12-23 14:19 Michael Van Canneyt Note Added: 0120040