Bug 14258 – SIGSEGV in dpldocs

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-03-08T03:13:00Z
Last change time
2015-06-18T16:54:17Z
Assigned to
sludwig
Creator
dlang-bugzilla

Attachments

IDFilenameSummaryContent-TypeSize
1481log.txtgdb logtext/plain11751

Comments

Comment #0 by dlang-bugzilla — 2015-03-08T03:13:42Z
Created attachment 1481 gdb log When attempting to build the docs from a non-interactive shell, using a clean checkout and environment, dpldocs get stuck and eats all RAM. I get a different result (a SIGSEGV) if I run it under GDB in an interactive shell. See attached log. I'm guessing it gets stuck on a recursive template expansion, or something? This has been happening for a few weeks now, I think, and is currently blocking updating dlang.org/library/ (I've been procrastinating investigating/filing this).
Comment #1 by dlang-bugzilla — 2015-03-08T03:53:17Z
I think it's having trouble with this expansion: LIX=$(LI $1)$(LIX $+) Its usage might have been introduced here: https://github.com/D-Programming-Language/phobos/commit/743303055d74cdd3e482a3af3e99af93755f3af6
Comment #2 by bugzilla — 2015-03-09T09:55:28Z
(In reply to Vladimir Panteleev from comment #1) > I think it's having trouble with this expansion: > > LIX=$(LI $1)$(LIX $+) That idiom is used regularly.
Comment #3 by code — 2015-03-09T19:13:42Z
Thanks for reducing this, will try to fix it soon.
Comment #4 by dlang-bugzilla — 2015-03-10T01:59:31Z
I haven't actually reduced it, just added some debug logging to dpldocs and looked with git blame.
Comment #5 by sludwig — 2015-03-10T12:06:09Z
The crash occurs because the proper termination conditions for recursive macro calls are not implemented. I'll do that. There could be an additional issue in the GC/array implementation, though, as I would have expected an OutOfMemoryError instead of a segmentation fault (except if the segfault is caused by a stack overflow).
Comment #6 by dlang-bugzilla — 2015-03-10T12:08:31Z
Except for address space exhaustion, OutOfMemoryError will never realistically occur in any OS with overcommit.
Comment #7 by sludwig — 2015-03-10T12:43:56Z
My systems all have limited swap space - what would the OS do when all that memory is filled with data (note that the array that is piled up is actually written to)? I've added the termination conditions now and will file a PR as soon as the new DDOX version is up on code.dlang.org.
Comment #8 by dlang-bugzilla — 2015-03-10T12:46:43Z
On Linux, what usually happens upon attempting to commit (write to) a page that has been overcommitted (COW of a zero page), when there are no free pages and no pages to swap or reclaim, the OOM killer is invoked and the most memory-hungry process dies with a SIGSEGV.
Comment #9 by sludwig — 2015-03-10T12:51:02Z
Hm, you are right of course, totally forgot about that.
Comment #10 by github-bugzilla — 2015-03-10T12:59:39Z
Commit pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/cc8d8123ef0dff1705e729d1faad2b710639771f Merge pull request #925 from s-ludwig/master Issue 14258 - SIGSEGV in dpldocs
Comment #11 by bugzilla — 2015-03-11T23:46:55Z
(In reply to github-bugzilla from comment #10) > Commit pushed to master at > https://github.com/D-Programming-Language/dlang.org > > https://github.com/D-Programming-Language/dlang.org/commit/ > cc8d8123ef0dff1705e729d1faad2b710639771f > Merge pull request #925 from s-ludwig/master > > Issue 14258 - SIGSEGV in dpldocs Does this mean this can be marked as fixed?
Comment #12 by dlang-bugzilla — 2015-03-12T03:38:58Z
Yes, I confirmed it's fixed in git.
Comment #13 by github-bugzilla — 2015-06-18T16:54:17Z