Sign in Join

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

Mailing lists / fpc-devel / 2005-07

HEAP Memory Manager BUG

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Helmut Hartl

Hello,

We are trying to port a Project around 220.000 Lines of code from Delphi/Kylix to FPC. Primary it runs :-), our main problems were Variant Support (Various conversions behaving not as in Delphi/Kylix). We made an own Variant Manager (to not break the existing one ) which is closer to Delphi, we would like to contribute if we are done with it.

The biggest problem still not solved is a BUG in the heap memory manager wich causes various SIGSEGV in various pieces of code i reported it yesterday as BUG 4189. (http://www.freepascal.org/bugs/showrec.php3?ID=4189)

I want to supply additional info:

Program test;
var s:string;
begin
 setlength(s,3);
 setlength(s,655360); -> CRASHES WITH SIGSEGV 
 writeln('OK');
end;
Compile with: fpc -Sdh test.pas

Program crashes under linux and win32 with current SVN 2.1.1 Problem seems to be in:

function SysTryResizeMem(var p: pointer; size: ptrint): boolean;

We "FIXED" it by changing function to:

function SysTryResizeMem(var p: pointer; size: ptrint): boolean; var
  pcurrsize,
  oldsize,
  currsize : ptrint;
  pcurr : pmemchunk_var;
begin
  SysTryResizeMem := false;
exit;      <----------- Don't Resize
 .....

Thanks for the good work,

Helmut

Reply by email

Peter Vreman
to Helmut Hartl
you wrote 30 lines
Hello, We are trying to port a Project around 220.000 Lines of code from Delphi/Kylix to FPC. Primary it runs :-), our main problems were Variant Support (Various conversions behaving not as in Delphi/Kylix). We made an own Variant Manager (to not break the existing one ) which is closer to Delphi, we would like to contribute if we are done with it. The biggest problem still not solved is a BUG in the heap memory manager wich causes various SIGSEGV in various pieces of code i reported it yesterday as BUG 4189. (http://www.freepascal.org/bugs/showrec.php3?ID=4189) I want to supply additional info: Program test; var s:string; begin setlength(s,3); setlength(s,655360); -> CRASHES WITH SIGSEGV writeln('OK'); end; Compile with: fpc -Sdh test.pas Program crashes under linux and win32 with current SVN 2.1.1 Problem seems to be in: function SysTryResizeMem(var p: pointer; size: ptrint): boolean; We "FIXED" it by changing function to:

Fixed

Peter

Reply by email