panic: runtime error: slice bounds out of range [2668:2667]
pashagolub opened this issue · 7 comments
Project involved: https://github.com/cybertec-postgresql/pg_timetable (v4_dev branch)
Command line:
golds.exe -gen -nouses -only-list-exporteds .
Call stack:
tool_gen-docs.go:488: Generated src/github.com/cybertec-postgresql/pg_timetable/internal/pgengine/migration.go.html (size: 37847).
panic: runtime error: slice bounds out of range [2668:2667]
goroutine 4022 [running]:
go101.org/golds/internal/server.(*astVisitor).buildConfirmedLines(0xc01220d500, 0x51, 0x0, 0x0)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/page_source-code.go:717 +0x32a
go101.org/golds/internal/server.(*astVisitor).buildIdentifier(0xc01220d500, 0xc0002f3b40, 0x40, 0xa73, 0x51, 0x2, 0xc0002f3b40, 0x40, 0xa76, 0x51, ...)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/page_source-code.go:795 +0x99
go101.org/golds/internal/server.(*astVisitor).handleIdent(0xc01220d500, 0xc0099bf420)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/page_source-code.go:1426 +0x4c5
go101.org/golds/internal/server.(*astVisitor).Visit(0xc01220d500, 0xfdd7d0, 0xc0099bf420, 0xc018975368, 0xe0d29e)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/page_source-code.go:1231 +0x867
go/ast.Walk(0xfda9e0, 0xc01220d500, 0xfdd7d0, 0xc0099bf420)
C:/Program Files/Go/src/go/ast/walk.go:52 +0x6a
go/ast.Walk(0xfda9e0, 0xc01220d500, 0xfdda00, 0xc0090fb2c0)
C:/Program Files/Go/src/go/ast/walk.go:110 +0x21e5
go/ast.Walk(0xfda9e0, 0xc01220d500, 0xfdda00, 0xc0090fb2d8)
C:/Program Files/Go/src/go/ast/walk.go:110 +0x21e5
go/ast.Walk(0xfda9e0, 0xc01220d500, 0xfdd488, 0xc003b717c0)
C:/Program Files/Go/src/go/ast/walk.go:136 +0xfa5
go/ast.Walk(0xfda9e0, 0xc01220d500, 0xfdd640, 0xc011f60f80)
C:/Program Files/Go/src/go/ast/walk.go:196 +0x1a25
go/ast.walkStmtList(0xfda9e0, 0xc01220d500, 0xc012106100, 0xa, 0x10)
C:/Program Files/Go/src/go/ast/walk.go:32 +0xa5
go/ast.Walk(0xfda9e0, 0xc01220d500, 0xfdd438, 0xc014cda9c0)
C:/Program Files/Go/src/go/ast/walk.go:224 +0x1988
go/ast.Walk(0xfda9e0, 0xc01220d500, 0xfdd708, 0xc014cda9f0)
C:/Program Files/Go/src/go/ast/walk.go:344 +0xd06
go/ast.walkDeclList(0xfda9e0, 0xc01220d500, 0xc0123d6d00, 0x8, 0x8)
C:/Program Files/Go/src/go/ast/walk.go:38 +0xa5
go/ast.Walk(0xfda9e0, 0xc01220d500, 0xfdd6b8, 0xc0123d6f80)
C:/Program Files/Go/src/go/ast/walk.go:353 +0x2466
go101.org/golds/internal/server.(*docServer).analyzeSoureCode(0xc0000d2000, 0xc01cecbc75, 0x3e, 0xc01cecbcb4, 0xc, 0x0, 0x0, 0x0)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/page_source-code.go:1838 +0xe71
go101.org/golds/internal/server.(*docServer).sourceCodePage(0xc0000d2000, 0xfe38c0, 0xc01105e000, 0xc015c26200, 0xc01cecbc75, 0x3e, 0xc01cecbcb4, 0xc)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/page_source-code.go:70 +0x2e6
go101.org/golds/internal/server.(*docServer).ServeHTTP(0xc0000d2000, 0xfe38c0, 0xc01105e000, 0xc015c26200)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/server.go:217 +0xe99
go101.org/golds/internal/server.GenDocs.func1(0xc01cecbc70, 0x50, 0xc0246cfe50, 0x1, 0x3, 0x0, 0x0)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/tool_gen-docs.go:397 +0xa5
go101.org/golds/internal/server.GenDocs.func3(0xc015c2a000, 0xc007f9a060)
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/tool_gen-docs.go:445 +0xeb
created by go101.org/golds/internal/server.GenDocs
C:/Users/pasha/go/pkg/mod/go101.org/golds@v0.2.7/internal/server/tool_gen-docs.go:438 +0x35d
@pashagolub
Thanks for this report.
I managed to run the same command on a Windows machine but could not reproduce this problem. I run golds
command built upon the Golds tip and the retracted v0.2.7 version. Both generate all docs without panicking.
Which version of Golds are you using? (which could be found through running golds -version
).
Is this problem reproducible by using the tip commit on your machine?
Hi. My version is:
> golds -version
Golds v0.2.7-preview
Yes, I can reproduce it exactly with these parameters. However different combination works fine, e.g.
> golds -gen -compact -wdpkgs-listing=solo .
...
tool_gen-docs.go:498: Done (1671 pages are generated and 1677 bytes are written).
tool_gen-docs.go:501: Docs are generated in generated-20210429101916.
@pashagolub
This is very possibly a character handling bug.
I just pushed a new commit. Could you clone the repo and run go install
in the project root directory to install Golds from tip.
Then please paste the output part like the following form here.
>>>>>>> debug: file/path
....
<<<<<<<<
v0.2.8 works without error. Debug ouptput is:
PS ..\pg_timetable > golds -version
Golds v0.2.8-preview
PS ..\pg_timetable > golds.exe -gen -nouses -only-list-exporteds .
....
page_source-code.go:722: >>>>>>> debug: C:\Users\pasha\Code\pg_timetable\internal\scheduler\scheduler.go
*/
sch.l.Info("Accepting asynchronous chains execution requests...")
go sch.retrieveAsyncChain
<<<<<<<<
...
tool_gen-docs.go:501: Done (2906 pages are generated and 119937361 bytes are written).
tool_gen-docs.go:504: Docs are generated in generated-20210430104003.
@pashagolub
Thanks for the valuable info.
I will check this problem when I get enough time (about one week later).
BTW, does the generated source code page for the file C:\Users\pasha\Code\pg_timetable\internal\scheduler\scheduler.go
look okay now?
@pashagolub
After some investigations, I think this problem should be fixed in the last commit.
If you find the problem still exists, please let me know.
Thanks. Works like a charm. I will let you know if anything happened
BTW, does the generated source code page for the file
C:\Users\pasha\Code\pg_timetable\internal\scheduler\scheduler.go
look okay now?
Yes, looks fine. Thanks for your work!