I don’t know how to faithfully reproduce this panic each time. But I get this almost always when I am batch producing the markdown content files for Hugo using ox-hugo.
The terminal looks like this:
Change detected, rebuilding site
2018-11-06 17:29:26.155 -0500
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/multiple-example-blocks-inside-quote-block.md": WRITE
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/source-block-inside-quote-block-and-another-source-block.md": WRITE
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/example-blocks-inside-quote-block-and-another-example-block.md": WRITE
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/source-block-followed-by-a-quote-block-containing-another-source-block.md": WRITE
Total in 3916 ms
Change detected, rebuilding site
2018-11-06 17:29:31.966 -0500
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/parsing-date-from-closed-property.md": WRITE
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/parsing-date-for-a-post-which-begins-with-a-subheading.md": WRITE
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/invalid-date.md": WRITE
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/lastmod-date-org-time-stamp.md": WRITE
Source changed "/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content/posts/lastmod-date-hugo-compatible-date.md": WRITE
Total in 3902 ms
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xcb0d59]
goroutine 1215 [running]:
github.com/gohugoio/hugo/hugolib.(*HugoSites).GetContentPage(0x0, 0xc00054c120, 0x8f, 0x1)
/home/kmodi/go.apps/src/github.com/gohugoio/hugo/hugolib/hugo_sites.go:129 +0x29
github.com/gohugoio/hugo/commands.(*commandeer).handleEvents(0xc0002d0180, 0xc004d0d7e0, 0xc0042946b8, 0xc001e50c00, 0x14, 0x20, 0xc0041b4360)
/home/kmodi/go.apps/src/github.com/gohugoio/hugo/commands/hugo.go:969 +0x912
github.com/gohugoio/hugo/commands.(*commandeer).newWatcher.func1(0xc004d0d7e0, 0xc0002d0180, 0xc0042946b8, 0xc0041b4360)
/home/kmodi/go.apps/src/github.com/gohugoio/hugo/commands/hugo.go:730 +0x1d8
created by github.com/gohugoio/hugo/commands.(*commandeer).newWatcher
/home/kmodi/go.apps/src/github.com/gohugoio/hugo/commands/hugo.go:726 +0x26e
make: *** [Makefile:153: server] Error 2
Is that backtrace adequate to debug and fix this issue?
I believe have been seeing this on and off (again, not consistently) since Hugo v0.50.
cd to that terminal and run make server HUGO_BASE_DIR=test/site PORT=5555 (this basically runs hugo server in the correct site directory)
Open another terminal and cd to that same cloned git repo dir.
Run make test. This will start a series of Markdown content file production (~400 files) [this step requires Emacs 25.1+ to be installed on your system].
The hugo server running in the first terminal will die somewhere in between while make test is running.
Sorry, I don’t have a smaller recipe to reproduce this problem, but hoping that the panic backtrace helps.
No, the config file isn’t touched at all in this. The make test just generates a lot of content Markdown files in short time. Only the content/ dir files are modified.
Thanks for trying. Most likely (I’ll need to see the full backtrace) it’s failing because you have a much older Emacs version, which is the default on macOS. The top of the backtrace should be mentioning a package called “vc-git”. To fix that, you need at least Emacs 25.1.
I did brew install emacs… so it should be pretty new. If you can create a failing case that does not require special setup, I will look at it. It doesn’t look like a situation that will hit the “common man”.
Few more questions so that at least I can understand what’s going on.
What is your emacs version (output of emacs --version)? I am not a macOS user, so not sure if something special needs to be done to force update an existing package.
Also, please post the full backtrace of that error you get.
OK, I will see if I can come up with a bash script that just loops through all the files in the content/ dir and just does touch on each .md file … may be that reproduces the problem …