sphinx-build Segmentation fault (core dumped)

781 views
Skip to first unread message

Anh Nguyen

unread,
Mar 10, 2017, 10:02:02 PM3/10/17
to sphinx-users
Anybody run into this or know how to debug the source of the core dump? I'm using sphinx 1.5.3 and python 2.7.

$ sphinx-build -b html source build
Running Sphinx v1.5.3
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 4 source files that are out of date
updating environment: 4 added, 0 changed, 0 removed
Segmentation fault (core dumped)

Komiya Takeshi

unread,
Mar 11, 2017, 4:06:13 AM3/11/17
to sphinx...@googlegroups.com
Hi,

You can use -vvv or -P option for debugging.
If you feel this is bug of Sphinx-core, please report to github issues.

Thanks,
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sphinx-users...@googlegroups.com.
> To post to this group, send email to sphinx...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.

Wilfred Tyler Gee

unread,
Dec 10, 2018, 6:55:36 PM12/10/18
to sphinx-users
Hi,

I'm having this problem and have been unable to find any information about what might be causing the core dumps. Using the -P flag doesn't help because it dumps before it goes to the debugger.

It's definitely something specific to certain files within my module, but it happens on import of the file that it is attempting to build. Other pages are successfully built before the specific submodule in question and if I remove that submodule it will continue until the next core dump. It is not all but quite a few of my submodules that cause it. 

Verbose information only gives:

reading sources... [  4%] modules/pocs.camera
[app] emitting event: 'env-purge-doc'(<sphinx.environment.BuildEnvironment object at 0x7f1afbf84ba8>, 'modules/pocs.camera')
[app] emitting event: 'source-read'('modules/pocs.camera', ['pocs.camera package\n===================\n\n.. automodule:: pocs.camera\n 
[autodoc] /var/panoptes/POCS/docs/modules/pocs.camera.rst:4: input:
.. automodule:: pocs.camera
    :members:
    :undoc-members:
    :show-inheritance:

[autodoc] import pocs.camera
[1]    10294 segmentation fault (core dumped)  sphinx-build -vvv -P . _build

The file in question is here.

Any tips appreciated. Thanks!

Wilfred Tyler Gee

unread,
Dec 10, 2018, 7:03:52 PM12/10/18
to sphinx-users
Actually I'm tracing it down further into some of our included modules. Will give update when I find what the problem is. 

Wilfred Tyler Gee

unread,
Dec 10, 2018, 9:21:00 PM12/10/18
to sphinx-users
This appears to be due to the importing of the `pyplot` (i.e. `from matplotlib import pyplot as plt`) module in a non-interactive environment.  I will try to create a minimal example and then report it.

Matthew Woehlke

unread,
Dec 11, 2018, 12:37:05 PM12/11/18
to sphinx...@googlegroups.com
On 10/12/2018 21.21, Wilfred Tyler Gee wrote:
> This appears to be due to the importing of the `pyplot` (i.e. `from
> matplotlib import pyplot as plt`) module in a non-interactive environment.
> I will try to create a minimal example and then report it.

A core dump sounds like the crash is in C[++] code rather than Python
code (which is also why -P is useless; you'd need to run in *gdb*, not
pdb). Presumably matplotlib has some native code, and something is going
wrong.

I often see issues like this due to library conflicts. It is probably
not "a non-interactive environment" that is causing your problem, but
something else that was previously imported.

If possible, I would try running your build under valgrind:

$ type -P sphinx-build
/path/to/sphinx-build
$ valgrind python /path/to/sphinx-build .

If it's a library conflict, you *probably* won't get a very useful stack
trace, but sometimes just seeing what libraries show up in the trace is
enough of a clue to guess what is going wrong.

(You can also replace `valgrind` with `gdb --args`... in that case, keep
an eye on what libraries get loaded, looking for anything suspicious,
especially loading different versions of the "same" library, or loading
libraries that should go together from different places.)

--
Matthew

Wilfred Tyler Gee

unread,
Dec 11, 2018, 5:21:31 PM12/11/18
to sphinx-users
Thanks Matthew. The matplotlib import alone didn't seem to be the fix although I can't quite figure out what is going on. I'll test out some of the methods you suggested when I get a chance later today. Cheers!

bharat...@gmail.com

unread,
Dec 14, 2018, 3:42:19 AM12/14/18
to sphinx-users
Reply all
Reply to author
Forward
0 new messages