I have a linux application (a console application) that runs fine on ubuntu, under the debugger or not. But when a friends runs it in docker - also ubuntu - it totally fails with one of a series of weird memory corruption issues. it fails somewhere in the code below, but that seems solid to me, and I can't see why it would lead to memory corruption for him and not me. Does anyone have any idea what I should be looking for?
procedure initialiseTZData(filename : String);
var
stream : TFileStream;
z : TZDecompressionStream;
tar : TTarArchive;
entry : TTarDirRec;
bi : TBytesStream;
begin
GTimeZoneData := TPascalTZ.create;
stream := TFileStream.Create(filename, fmOpenRead);
try
z := TZDecompressionStream.Create(stream, 15+16);
try
tar := TTarArchive.Create(z);
try
while tar.FindNext(entry) do
begin
if (StringArrayExists(TZ_FILES_STANDARD, entry.name)) then
begin
bi := TBytesStream.Create;
try
tar.ReadFile(bi);
bi.position := 0;
GTimeZoneData.ParseDatabaseFromStream(bi);
finally
bi.free;
end;
end;
end;
finally
tar.free;
end;
finally
z.free;
end;
finally
stream.Free;
end;
GLocalTZ := TTimeZone.create('');
end;