[fpc-pascal] How to analyze a core dump?
Vincent Snijders
vsnijders at quicknet.nl
Wed Jun 27 19:40:28 CEST 2007
On Wed, 27 Jun 2007 19:38:03 +0200
Luca Olivetti <luca at ventoso.org> wrote:
> En/na Luca Olivetti ha escrit:
> > En/na Cesar Romero ha escrit:
> >> Where S is initialized?
> >> I only see L initialized.
> >>
> >> []s
> >>
> >>
> >> Cesar Romero
> >>>
> >>> 442: L:=length(s);
> >>> 443: if L<1 then exit;
> >>> 444: case s[1] of
> >>>
> >>> so I can't see how it could possibly be uninitialized.
> >
> > nothwithstanding the fact that if length(s)<1 line 444 won't be
> > executed, so the "uninitialized" should be flagged in line 442, I know
> > that this chunk is inside
> >
> > procedure TButlerPhone.Receive(s: string);
> >
> > so s is a parameter.
> > This procedure is called exclusively from
> >
> > procedure TStatusThread.Receive;
> > begin
> > FOwner.Receive(FData)
> > end;
> >
> > (FOwner is a TButlerPhone)
> >
> > which in turn is called only here:
> >
> > FData:=copy(buffer,i+2,L-1);
> > if buffer[i+L+1]=checksum(FData) then
> > begin
> > if not terminated then synchronize(@Receive);
> > end else
> >
>
> And another writeln confirms that L is 1 when valgrind complains, so the
> string is definitely initialized.
Did you write to that string or merely set its length using SetLength?
Vincent
More information about the fpc-pascal
mailing list