Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-03

Access violation in build_lcl_docs --outfmt chm

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thomas Moritz

Hello,

this is the output:

HTML Files written. Collecting other files and compressing...this could take some time Generating Table of contents...
Generating Index...
Finishing compressing...
Exception at 00000000004FFF6F: EAccessViolation:
Access violation.

'lcl.chm' has 0 Byte

openSUSE 12.1 x86_64
fpc 2.7.1 svn 20450
lazarus svn 35641

Best regards
Th. Moritz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120301/483feda9/attachment.html>

Reply by email

Mattias Gaertner
to Thomas Moritz
Show quoted text 16 lines
Hello, this is the output: HTML Files written. Collecting other files and compressing...this could take some time Generating Table of contents... Generating Index... Finishing compressing... Exception at 00000000004FFF6F: EAccessViolation: Access violation. 'lcl.chm' has 0 Byte openSUSE 12.1 x86_64 fpc 2.7.1 svn 20450 lazarus svn 35641

It is a bug in the 2.7.1 version of the chmwriter. Can you create a backtrace?

Maybe Andrew Haines can help.

Mattias

Reply by email

Andrew Haines
to Mattias Gaertner
Mattias Gaertner wrote 25 lines
On Thu, 01 Mar 2012 17:31:47 +0100 Thomas Moritz wrote: > Hello, > > this is the output: > > HTML Files written. Collecting other files and compressing...this could take some time > Generating Table of contents... > Generating Index... > Finishing compressing... > Exception at 00000000004FFF6F: EAccessViolation: > Access violation. > > 'lcl.chm' has 0 Byte > > openSUSE 12.1 x86_64 > fpc 2.7.1 svn 20450 > lazarus svn 35641 It is a bug in the 2.7.1 version of the chmwriter. Can you create a backtrace? Maybe Andrew Haines can help.

I managed to reproduce this. I cannot look into it for a couple of days though. I wonder if something has changed in fpc because it worked until I updated all of fpc but my chm folder was already up to date.

I got a backtrace by compiling the packages/chm and util/fpdoc with make OPT=-gl

Program received signal SIGSEGV, Segmentation fault. 0x00000000005072e5 in WRITEHEADER (this=0x7ffff33f9c80, ISPLACEHOLDER=false) at src/chmfiftimain.pas:291
291 FHeaderRec.LeafNodeCount := TLeafNode(FActiveLeafNode).LeafNodeCount; (gdb) bt
#0 0x00000000005072e5 in WRITEHEADER (this=0x7ffff33f9c80, ISPLACEHOLDER=false) at src/chmfiftimain.pas:291
#1 0x00000000005078d8 in WRITETOSTREAM (this=0x7ffff33f9c80) at src/chmfiftimain.pas:384
#2 0x00000000004f111b in WRITEFIFTIMAIN (this=0x7ffff7f54420) at src/chmwriter.pas:1275
#3 0x00000000004f16c2 in WRITEFINALCOMPRESSEDFILES (this=0x7ffff7f54420) at src/chmwriter.pas:1365
#4 0x00000000004ef2d4 in GETDATA (this=0x7ffff7f54420, COUNT=65536, BUFFER=0x7ffff2756050 '') at src/chmwriter.pas:674 #5 0x00000000004ef003 in _GETDATA (ARG=0x7ffff7f54420, COUNT=65536, BUFFER=0x7ffff2756050) at src/chmwriter.pas:636
#6 0x000000000050523f in LZX_GET_CHARS (LZI=0x7ffff283fe40, N=65536, BUF=0x7ffff2756050 '') at src/paslzxcomp.pas:467
#7 0x000000000050d4d9 in FILL_BLOCKBUF (LZI=0x7ffff283fe40, MAXCHARS=65536) at src/paslznonslide.pas:174
#8 0x000000000050d92e in LZ_COMPRESS (LZI=0x7ffff283fe40, NCHARS=65536) at src/paslznonslide.pas:430
#9 0x0000000000506780 in LZX_COMPRESS_BLOCK (LZXD=0x7ffff3ef47d0, BLOCK_SIZE=65536, SUBDIVIDE=true (4294967295)) at src/paslzxcomp.pas:1000 #10 0x00000000004f0076 in STARTCOMPRESSINGSTREAM (this=0x7ffff7f54420) at src/chmwriter.pas:915
#11 0x00000000004efbb5 in EXECUTE (this=0x7ffff7f54420) at src/chmwriter.pas:821
#12 0x0000000000481a8a in WRITEHTMLPAGES (this=0x7ffff39a3560) at dw_htmlchm.inc:499
#13 0x000000000049168f in WRITEDOC (this=0x7ffff39a3560) at dw_html.pp:3455 #14 0x00000000004a1605 in CREATEOUTPUT (this=0x7ffff7f7e040, APACKAGE=0x7ffff7f9e2e0, ENGINE=0x7ffff7f7e180) at mkfpdoc.pp:175 #15 0x00000000004a1cce in CREATEDOCUMENTATION (this=0x7ffff7f7e040, APACKAGE=0x7ffff7f9e2e0, PARSEONLY=false) at mkfpdoc.pp:228 #16 0x0000000000402450 in DORUN (this=0x7ffff7f86040) at fpdoc.pp:359 #17 0x0000000000465d50 in CUSTAPP$_$TCUSTOMAPPLICATION_$__$$_RUN () #18 0x00000000004026d2 in main () at fpdoc.pp:375
(gdb)

Regards,

Andrew

Reply by email

Mattias Gaertner
to Andrew Haines
Show quoted text 30 lines
On 03/01/12 13:51, Mattias Gaertner wrote: > On Thu, 01 Mar 2012 17:31:47 +0100 > Thomas Moritz wrote: > >> Hello, >> >> this is the output: >> >> HTML Files written. Collecting other files and compressing...this could take some time >> Generating Table of contents... >> Generating Index... >> Finishing compressing... >> Exception at 00000000004FFF6F: EAccessViolation: >> Access violation. >> >> 'lcl.chm' has 0 Byte >> >> openSUSE 12.1 x86_64 >> fpc 2.7.1 svn 20450 >> lazarus svn 35641 > > It is a bug in the 2.7.1 version of the chmwriter. > Can you create a backtrace? > > Maybe Andrew Haines can help. > I managed to reproduce this. I cannot look into it for a couple of days though. I wonder if something has changed in fpc because it worked until I updated all of fpc but my chm folder was already up to date.

Compile with -Criot and check all places where widestrings and ansistrings come together.

Mattias

Reply by email

Thomas Moritz
to Mattias Gaertner: On Thu, 01 Mar 2012 17:31:47 +0100 It is a bug in the 2.7.1 version of the chmwriter. Can…

Am Donnerstag, 1. M?rz 2012, 19:51:17 schrieb Mattias Gaertner:

Hello Mattias,

Show quoted text 20 lines
> this is the output: > > HTML Files written. Collecting other files and > compressing...this could take some time Generating Table of > contents... > Generating Index... > Finishing compressing... > Exception at 00000000004FFF6F: EAccessViolation: > Access violation. > > 'lcl.chm' has 0 Byte > > openSUSE 12.1 x86_64 > fpc 2.7.1 svn 20450 > lazarus svn 35641 It is a bug in the 2.7.1 version of the chmwriter. Can you create a backtrace? Maybe Andrew Haines can help.

Meanwhile, Andrew had already written ...
To debug I must rewrite my 'fpc.spec'.
Otherwise, gdb gives nothing useful.

Best regards
Th. Moritz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120302/3c2e9dc8/attachment-0001.html>

Reply by email

Andrew Haines
to Andrew Haines: I managed to reproduce this. I cannot look into it for a couple of days though. I wonder…
Andrew Haines wrote 38 lines
On 03/01/12 13:51, Mattias Gaertner wrote: > On Thu, 01 Mar 2012 17:31:47 +0100 > Thomas Moritz wrote: > >> Hello, >> >> this is the output: >> >> HTML Files written. Collecting other files and compressing...this could take some time >> Generating Table of contents... >> Generating Index... >> Finishing compressing... >> Exception at 00000000004FFF6F: EAccessViolation: >> Access violation. >> >> 'lcl.chm' has 0 Byte >> >> openSUSE 12.1 x86_64 >> fpc 2.7.1 svn 20450 >> lazarus svn 35641 > > It is a bug in the 2.7.1 version of the chmwriter. > Can you create a backtrace? > > Maybe Andrew Haines can help. > I managed to reproduce this. I cannot look into it for a couple of days though. I wonder if something has changed in fpc because it worked until I updated all of fpc but my chm folder was already up to date. I got a backtrace by compiling the packages/chm and util/fpdoc with make OPT=-gl Program received signal SIGSEGV, Segmentation fault. 0x00000000005072e5 in WRITEHEADER (this=0x7ffff33f9c80, ISPLACEHOLDER=false) at src/chmfiftimain.pas:291 291 FHeaderRec.LeafNodeCount := TLeafNode(FActiveLeafNode).LeafNodeCount;

Ok I used Graeme's fpc git repo and git bisect and was able to find the revision that now causes chmwriter to crash

Revision 20196 is the culprit.

commit b36ea3c90ec702643aa0505799683a3b7f9c3ce1
Author: Sergei Gorelkin
Date: Mon Jan 30 09:09:49 2012 +0000

* Changed generic StrCopy and StrECopy to use IndexByte+Move: o Makes behavior predictable in cases when source and destination strings happen to overlap.
o Removes need in CPU-specific implementations, at least for CPUs having optimized IndexByte and Move implementations.

git-svn-id: http://svn.freepascal.org:/svn/fpc/trunk at 20196 3ad0048d-3df7-0310-abae-a5850022a9f2

I can't look at this further today but will keep looking when I have some time in a few days. Maybe the answer is obvious to someone else.

Regards,

Andrew

Reply by email

Mattias Gaertner
to Andrew Haines
Show quoted text 60 lines
On 03/01/12 18:15, Andrew Haines wrote: > On 03/01/12 13:51, Mattias Gaertner wrote: >> On Thu, 01 Mar 2012 17:31:47 +0100 >> Thomas Moritz wrote: >> >>> Hello, >>> >>> this is the output: >>> >>> HTML Files written. Collecting other files and compressing...this could take some time >>> Generating Table of contents... >>> Generating Index... >>> Finishing compressing... >>> Exception at 00000000004FFF6F: EAccessViolation: >>> Access violation. >>> >>> 'lcl.chm' has 0 Byte >>> >>> openSUSE 12.1 x86_64 >>> fpc 2.7.1 svn 20450 >>> lazarus svn 35641 >> >> It is a bug in the 2.7.1 version of the chmwriter. >> Can you create a backtrace? >> >> Maybe Andrew Haines can help. >> > > I managed to reproduce this. I cannot look into it for a couple of days > though. I wonder if something has changed in fpc because it worked until > I updated all of fpc but my chm folder was already up to date. > > I got a backtrace by compiling the packages/chm and util/fpdoc with make > OPT=-gl > > Program received signal SIGSEGV, Segmentation fault. > 0x00000000005072e5 in WRITEHEADER (this=0x7ffff33f9c80, > ISPLACEHOLDER=false) at src/chmfiftimain.pas:291 > 291 FHeaderRec.LeafNodeCount := TLeafNode(FActiveLeafNode).LeafNodeCount; Ok I used Graeme's fpc git repo and git bisect and was able to find the revision that now causes chmwriter to crash Revision 20196 is the culprit. commit b36ea3c90ec702643aa0505799683a3b7f9c3ce1 Author: Sergei Gorelkin Date: Mon Jan 30 09:09:49 2012 +0000 * Changed generic StrCopy and StrECopy to use IndexByte+Move: o Makes behavior predictable in cases when source and destination strings happen to overlap. o Removes need in CPU-specific implementations, at least for CPUs having optimized IndexByte and Move implementations. git-svn-id: http://svn.freepascal.org:/svn/fpc/trunk at 20196 3ad0048d-3df7-0310-abae-a5850022a9f2 I can't look at this further today but will keep looking when I have some time in a few days. Maybe the answer is obvious to someone else.

The chm units uses ansi and widestrings. FPC now has string encodings, so you now have to be more careful when mixing strings of different kind. For performance and avoiding conversion bugs it is better to use only one type of strings.

Mattias

Reply by email

Andrew Haines
to Mattias Gaertner
Mattias Gaertner wrote 11 lines
On Tue, 06 Mar 2012 22:23:07 -0500 Andrew Haines wrote: > Revision 20196 is the culprit. > The chm units uses ansi and widestrings. FPC now has string encodings, so you now have to be more careful when mixing strings of different kind. For performance and avoiding conversion bugs it is better to use only one type of strings.

I tried using strings instead of widestrings but no change. But then I noticed that a "^" was missing for StrECopy in fpc r20196. Adding that fixed the crash. I submitted a bug report with a patch http://bugs.freepascal.org/view.php?id=21443

Whew! Such a large amount of misery for such a small bug :)

Regards,

Andrew

Reply by email