-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common clang/gcc compiler bug causes make to hang when generating htmldoc.pdf #349
Comments
|
Launched this under GDB, found that the code is stuck at Then I found that in Makedefs the CC and CXX are set to clang and clang++. Don't know how to fix this, I don't understand what the line does. |
|
@lockywolf Hmm, never seen this problem before. What OS? |
|
Also happens on FreeBSD 13.0 with clang 8 during package builds: Updating the package to 1.9.5 does not help. |
|
I can also reproduce the problem on Void Linux with latest master and building with clang 8 via |
|
Can one of you try current Github master (what will eventually become 1.9.6)? |
|
Same problem as before. |
|
The problem seems to be in parser_pre() and it goes away if I disable optimizations on it via diff --git a/htmldoc/ps-pdf.cxx b/htmldoc/ps-pdf.cxx
index f7981b7..bdb5940 100644
--- a/htmldoc/ps-pdf.cxx
+++ b/htmldoc/ps-pdf.cxx
@@ -5352,6 +5352,7 @@ parse_paragraph(tree_t *t, /* I - Tree to parse */
* 'parse_pre()' - Parse preformatted text and produce rendering list output.
*/
+__attribute__ ((optnone))
static void
parse_pre(tree_t *t, /* I - Tree to parse */
float left, /* I - Left margin */Specifically as @lockywolf has already pointed out it seems to be stuck in this loop [1]: [1] https://github.com/michaelrsweet/htmldoc/blob/master/htmldoc/ps-pdf.cxx#L5503 |
|
I have now tried building on Fedora 29 with gcc 8.3.1, in addition to Ubuntu 18.04 with gcc 7.3.0 and Clang 6.0, and macOS with clang 10.0.1. NONE of these exhibit these symptoms, and there is absolutely nothing wrong with the code in question, so this is a compiler bug. Please try building with the "--enable-debug" configure option, which will just use "-g" to disable optimizations. |
|
(Alternately you can build with GCC or a newer version of clang) |
|
Yes, this is probably a bug in Clang 8. Apple has its own version of Clang, so there might be some Switching to GCC or older Clang is only a short term solution.
With no optimizations it works, but we have already established [1] https://en.wikipedia.org/wiki/Xcode#Latest_versions |
|
Please file a bug against clang/llvm |
|
I've filed a bug for FreeBSD first: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237515 Marking col as volatile works around this problem too, so this is what I've applied to FreeBSD's htmldoc package for now. --- htmldoc/ps-pdf.cxx.orig 2018-04-10 11:56:03 UTC
+++ htmldoc/ps-pdf.cxx
@@ -5361,7 +5361,7 @@ parse_pre(tree_t *t, /* I - Tree to parse */
line[10240],
*lineptr,
*dataptr;
- int col;
+ volatile int col;
float width,
height,
rgb[3]; |
|
I submitted a clang/llvm bug with a minimized test case here: https://bugs.llvm.org/show_bug.cgi?id=41998 |
|
FWIW, the clang/llvm bug has now been fixed here: llvm/llvm-project@2d756c4. It didn't make it into 8.0.1, but will at least end up in 9.0.0. I have backported the fix to FreeBSD. |
|
Reopening - latest Xcode from Apple includes a buggy version of Clang, and there have been a bunch of dupes now... Will investigate refactoring this code that hasn't needed changes for the last 15 years... |
I cannot compile neither htmldoc 1.9.5 nor 1.8.30.
The make process gets stuck at 'Formatting htmldoc.pdf' forever. Waited for several hours, with no result.
Tried both local and built-in libraries.
How can I debug this issue?
The text was updated successfully, but these errors were encountered: