Closed ayanamizuta closed 7 months ago
I also encounter this issue whenever I am not careful to blank out any pageState
objects from the variable I pass to jsonify
. Once the issue occurs, it can be quite hard to track down because there is no indication as to where it occurs.
The work-around I have been using for years is to merge the map I pass to jsonify
with a map that overwrites the pageState
object with nil
or "omitted"
:
jsonify (dict "indent" " ") (merge $tplParams (dict "Page" "omitted") )
The reason I have not reported this issue myself is that I only use jsonify
to generate more readable output of maps for debugging, which is certainly not its intended use case.
This was fixed in v0.123.0.
git clone --single-branch -b hugo-github-issue-11827 https://github.com/jmooring/hugo-testing hugo-github-issue-11827
cd hugo-github-issue-11827
hugo server
Then visit http://localhost:1313/ja/
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Thank you for maintaining Hugo! I'd like to report a behavior that seems to be a bug.
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
YES (with v0.121.1)
How to reproduce
directory structure
file contents
The following files are updated from
hugo new site
.hugo.toml
layouts/_default/baseof.html
layouts/index.html
content/ja/about.md
content/en/about.md
Behavior
the
hugo
command crashes with the following log messagelog (558 lines)
``` Start building sites … hugo v0.121.1-00b46fed8e47f7bb0a85d7cfc2d9f1356379b740 linux/amd64 BuildDate=2023-12-08T08:47:45Z VendorInfo=gohugoio WARN found no layout file for "html" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN found no layout file for "html" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN .Path when the page is backed by a file is deprecated. We plan to use Path for a canonical source path and you probably want to check the source is a file. To get the current behaviour, you can use a construct similar to the one below: {{ $path := "" }} {{ with .File }} {{ $path = .Path }} {{ else }} {{ $path = .Path }} {{ end }} runtime: goroutine stack exceeds 1000000000-byte limit runtime: sp=0xc023002470 stack=[0xc023002000, 0xc043002000] fatal error: stack overflow runtime stack: runtime.throw({0x263d474?, 0xc00053fe68?}) /usr/local/go/src/runtime/panic.go:1077 +0x5c fp=0xc00053fe18 sp=0xc00053fde8 pc=0x43ab5c runtime.newstack() /usr/local/go/src/runtime/stack.go:1107 +0x5ac fp=0xc00053ffc8 sp=0xc00053fe18 pc=0x45516c traceback: unexpected SPWRITE function runtime.morestack runtime.morestack() /usr/local/go/src/runtime/asm_amd64.s:593 +0x8f fp=0xc00053ffd0 sp=0xc00053ffc8 pc=0x46ebef goroutine 133 [running]: github.com/mitchellh/hashstructure.(*walker).visit(0xc023002868, {0x228d020?, 0xc0452014a0?, 0x194?}, 0x0) /root/project/gomodcache/github.com/mitchellh/hashstructure@v1.1.0/hashstructure.go:131 +0x15e5 fp=0xc023002480 sp=0xc023002478 pc=0x8cdcc5 github.com/mitchellh/hashstructure.(*walker).visit(0xc023002868, {0x21e54a0?, 0xc0451fe7c8?, 0x18?}, 0x0) /root/project/gomodcache/github.com/mitchellh/hashstructure@v1.1.0/hashstructure.go:368 +0x125d fp=0xc023002828 sp=0xc023002480 pc=0x8cd93d github.com/mitchellh/hashstructure.Hash({0x21e54a0, 0xc0451fe7c8}, 0x3?) /root/project/gomodcache/github.com/mitchellh/hashstructure@v1.1.0/hashstructure.go:108 +0x1c5 fp=0xc0230028c8 sp=0xc023002828 pc=0x8cc6a5 github.com/gohugoio/hugo/identity.HashUint64({0xc023002958?, 0x3?, 0x0?}) /root/project/hugo/identity/identityhash.go:47 +0x5a fp=0xc023002908 sp=0xc0230028c8 pc=0x8ce91a github.com/gohugoio/hugo/common/loggers.(*logOnceHandler).HandleLog(0xc0003693c8, 0xc000432120) /root/project/hugo/common/loggers/handlersmisc.go:88 +0x139 fp=0xc0230029a0 sp=0xc023002908 pc=0x8cfc39 github.com/gohugoio/hugo/common/loggers.(*stopHandler).HandleLog(0xc0000ba5a0?, 0xc000432120?) /root/project/hugo/common/loggers/handlersmisc.go:109 +0x5e fp=0xc0230029f8 sp=0xc0230029a0 pc=0x8cff3e github.com/bep/logg.(*logger).log(0xc000174360, 0xc0000ba5a0, {0x3c28dc0, 0xc045201470}) /root/project/gomodcache/github.com/bep/logg@v0.4.0/logger.go:154 +0x114 fp=0xc023002aa8 sp=0xc0230029f8 pc=0x528654 github.com/bep/logg.(*Entry).Logf(0xc0000ba5a0, {0xc0452254a0, 0x156}, {0x0, 0x0, 0x0}) /root/project/gomodcache/github.com/bep/logg@v0.4.0/entry.go:113 +0xbe fp=0xc023002ad8 sp=0xc023002aa8 pc=0x527a1e github.com/gohugoio/hugo/common/loggers.(*logAdapter).Warnln(0xc0009e6f80, {0xc0451c3f00?, 0x0?, 0x0?}) /root/project/hugo/common/loggers/logger.go:274 +0x44 fp=0xc023002b18 sp=0xc023002ad8 pc=0x8d2064 github.com/gohugoio/hugo/hugolib.(*pageMeta).Path(0xc000053680) /root/project/hugo/hugolib/page__meta.go:229 +0x88 fp=0xc023002b48 sp=0xc023002b18 pc=0x2002b08 github.com/gohugoio/hugo/hugolib.(*pageState).Path(0xc00049ca50?)