Am 02.06.2016 15:03 schrieb "Stefan Schalk" <[email protected]>:
>
>
>    Hi Sven,
>
> many thanks for your quick response and solution!
>
> I tried the new FPC sources (Revision 33878) and ran in a segmentation
fault.
> In classes.inc line 345 the SizeOf gets the length from the pointer but I
think
> the length of the structure is needed:
>
>     currently: FillChar(syncentry^, SizeOf(syncentry), 0);
>
>     suggestion: FillChar(syncentry^, SizeOf(TThreadQueueEntry), 0);
>
> Because of that, the uninitialized structure member "Next" will lead to a
> segmentation fault afterwards.
> I tried the suggestion and everything works fine (no SIGSEGV, no memory
leak).
> Can you please review my suggestion?

You're indeed right. Fixed that.

Though this whole fix won't be part of 3.0.2 anymore as it got discovered
(and fixed) too late.

As a workaround try to avoid calling Synchronize from a new external thread
each time. If it is the same thread then memory usage won't increase after
the first call.

Regards,
Sven
-- 
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to