[Lazarus] Debugging the rtl/fcl - segfault in sdfdataset
Luca Olivetti
luca at wetron.es
Fri Jul 17 12:32:46 CEST 2020
El 17/7/20 a les 12:12, Michael Van Canneyt via lazarus ha escrit:
>
>
> On Fri, 17 Jul 2020, Luca Olivetti via lazarus wrote:
>
>> El 17/7/20 a les 11:46, Luca Olivetti via lazarus ha escrit:
>>
>>>
>>> In fact, if you look at the bug report, it's enough to use the old
>>> version of Fielddefs.Add (i.e. the one without the encoding) to "fix"
>>> the problem, but it's not because of the default (I changed it to
>>> 'utf-8', or maybe it's actually 'utf-8' that causes the problem).
>>
>> Yes, setting it to '437' or 'iso8859-1' avoids the segfault.
>
> Haha... The mystery is unraveling :-)
>
> Note that these are single-byte codepages.
> Are you using fixed-length of CSV ? Because in the case of fixed-length,
> UTF8 makes no sense...
I'm not using the CSV at all, I load an empty file and fill the dataset
by other means (Dataset.Fields[f].AsString:=....).
However I put a breakpoint on every SetAsString and none is
triggered....(the assumption here is that a buffer of length n*4 is
actually of length n, that would explain the heap corruption and I
wanted to see where it happens).
I any case it doesn't matter if it makes sense or not, it should work,
maybe with a wrong encoding but definitely it shouldn't segfault.
Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007
More information about the lazarus
mailing list