[fpc-devel] Heaptrace + cwstring cause SIGSEGV at the end

Sergei Gorelkin sergei_gorelkin at mail.ru
Mon Mar 10 17:17:11 CET 2014

10.03.2014 19:40, Jonas Maebe пишет:
> On 10 Mar 2014, at 16:13, Petr Kristan wrote:
>> If memoryleak occurs and program ends, then i get SIGSEGV in cwstring.pp:481 (iconv call)
>> because cwstring unit is finalized before heaptrc.
> If you use -gh, then heaptrc will be the first unit of the uses clause and will be finalized after
> any manually added unit.
That's exactly the issue. Being finalized last, heaptrc must not do anything that depends on 
functionality from other units, except system, but it does due to recent Unicode-related changes 
(indirectly, see the stack trace).

Even further, in case of error RTL tries to print a backtrace right after finalizing all units (see 
InternalExit procedure in system.inc), which can lead to similar problems.


More information about the fpc-devel mailing list