Can't compile release 2.1.1 with debug option #14714

goganchic opened this Issue Dec 21, 2016 · 17 comments


None yet

2 participants

goganchic commented Dec 21, 2016 edited

Centos 7 x86_64

git clone
cd phantomjs
git checkout 2.1.1
git submodule init
git submodule update
./ -d
1 + 1
LEAK: 12 WebCoreNode <-- error

If i compile phantomjs without -d - everything works.

@goganchic goganchic changed the title from branch 2.1 do not work with -d option to Can't compile release 2.1.1 with debug option Dec 21, 2016

Sorry, could you please elaborate? What are you trying to do?

goganchic commented Dec 21, 2016 edited

I want to debug #14713. So I need debug version of phantom.js, but unfortunately it does not work :(
Maybe there is something I'm missing?

Vitallium commented Dec 21, 2016 edited

@goganchic what do you mean by it doesn't work? You just need to build it with --debug option enabled.


@Vitallium I've built phantomjs with -d option (I think it's an equivalent of --debug). I'm trying to run simple test script with recently build binary:

$ cat test.js
var x = 1 + 2;
$ ./phantomjs test.js
ASSERTION FAILED: url == m_string
platform/KURL.cpp(334) : WebCore::KURL::KURL(WebCore::ParsedURLStringTag, const WTF::String&)
1   0x1f99692 ./phantomjs() [0x1f99692]
2   0xc470d0 ./phantomjs() [0xc470d0]
3   0x1a8e470 ./phantomjs() [0x1a8e470]
4   0x1a8e361 ./phantomjs() [0x1a8e361]
5   0x1a864e1 ./phantomjs() [0x1a864e1]
6   0x9a4743 ./phantomjs() [0x9a4743]
7   0xd496be ./phantomjs() [0xd496be]
8   0x1a816ec ./phantomjs() [0x1a816ec]
9   0xa70160 ./phantomjs() [0xa70160]
10  0xa701c9 ./phantomjs() [0xa701c9]
11  0xa61670 ./phantomjs() [0xa61670]
12  0x848fbf ./phantomjs() [0x848fbf]
13  0xa61517 ./phantomjs() [0xa61517]
14  0xa61a9b ./phantomjs() [0xa61a9b]
15  0xa61412 ./phantomjs() [0xa61412]
16  0xa60cad ./phantomjs() [0xa60cad]
17  0xa5fd41 ./phantomjs() [0xa5fd41]
18  0xa5fdc7 ./phantomjs() [0xa5fdc7]
19  0xa64471 ./phantomjs() [0xa64471]
20  0xa807d6 ./phantomjs() [0xa807d6]
21  0xa83492 ./phantomjs() [0xa83492]
22  0xa82931 ./phantomjs() [0xa82931]
23  0xa9cfff ./phantomjs() [0xa9cfff]
24  0xa9e08b ./phantomjs() [0xa9e08b]
25  0x845f9c ./phantomjs() [0x845f9c]
26  0x84c343 ./phantomjs() [0x84c343]
27  0xa9d967 ./phantomjs() [0xa9d967]
28  0xa7d169 ./phantomjs() [0xa7d169]
29  0xa7cbda ./phantomjs() [0xa7cbda]
30  0xa7c75c ./phantomjs() [0xa7c75c]
31  0x864b7a ./phantomjs() [0x864b7a]
PhantomJS has crashed. Please read the bug reporting guide at
<> and file a bug report.
Segmentation fault (core dumped)

If I start this script with phantomjs which was built without -d option - everything works fine.

Vitallium commented Dec 21, 2016 edited

@goganchic ah, yes. In the old PJS you need to comment out that assert.
You can find it here:

But you also can build WebKit with asserts disabled by passing ASSERT_DISABLED option


@Vitallium thanks a lot! Can you please tell me is there some more assets which I should comment? And one more question: what does this message in the end of phantomjs output mean LEAK: 12 WebCoreNode?

Vitallium commented Dec 21, 2016 edited

AFAIR this is the only assert.

And one more question: what does this message in the end of phantomjs output mean LEAK: 12 WebCoreNode?

That means destructor wasn't called for these WebCoreNodes. You can ignore it. That's fine.

goganchic commented Dec 21, 2016 edited

@Vitallium thanks for information! And may be you know how can I build phantomjs from master branch? There is no or Makefile or something else and no submodules with dependencies.

Vitallium commented Dec 21, 2016 edited

@goganchic it's pretty simple:

  • build new QtWebKit
  • build PJS from master as a regular qmake project

@Vitallium ok, thanks!

goganchic commented Dec 21, 2016 edited

@Vitallium one more fail

ASSERTION FAILED: leftSide->category() != CalcOther && rightSide->category() != CalcOther
css/CSSCalculationValue.cpp(290) : static WTF::PassRefPtr<WebCore::CSSCalcBinaryOperation> WebCore::CSSCalcBinaryOperation::create(WTF::PassRefPtr<WebCore::CSSCalcExpressionNode>, WTF::PassRefPtr<WebCore::CSSCalcExpressionNode>, WebCore::CalcOperator)

Should I comment something more?

Vitallium commented Dec 21, 2016 edited

@goganchic no (but you can comment this assert out). Debug mode means that all asserts in WebKit will be enabled. And there are a lot of asserts :-)


@Vitallium ok, how can I set ASSERT_DISABLED option? ./ --webkit-qmake-args ASSERT_DISABLED -d ?


./ --webkit-qmake-args DEFINES+=ASSERT_DISABLED -d


do not work :(


@Vitallium can you please tell me what should I do exactly to add debug info but disable assertions in webkit?

goganchic commented Dec 22, 2016 edited

such diff worked for me:

diff --git a/Source/WTF/wtf/Assertions.h b/Source/WTF/wtf/Assertions.h
index b26fa36..7940004 100644
--- a/Source/WTF/wtf/Assertions.h
+++ b/Source/WTF/wtf/Assertions.h
@@ -48,7 +48,7 @@
 /* Disable ASSERT* macros in release mode. */

diff --git a/Source/WebCore/rendering/InlineBox.cpp b/Source/WebCore/rendering/InlineBox.cpp
index 883490b..5dad2b0 100644
--- a/Source/WebCore/rendering/InlineBox.cpp
+++ b/Source/WebCore/rendering/InlineBox.cpp
@@ -49,7 +49,7 @@ struct SameSizeAsInlineBox {

-COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), InlineBox_size_guard);
+// COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), InlineBox_size_guard);

 static bool inInlineBoxDetach;
diff --git a/Source/WebCore/rendering/InlineBox.h b/Source/WebCore/rendering/InlineBox.h
index 2f480c8..5ef1a41 100644
--- a/Source/WebCore/rendering/InlineBox.h
+++ b/Source/WebCore/rendering/InlineBox.h
@@ -272,7 +272,7 @@ public:
     // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system.
     virtual float placeEllipsisBox(bool ltr, float visibleLeftEdge, float visibleRightEdge, float ellipsisWidth, float &truncatedWidth, bool&);

+#if !NDEBUG
     void setHasBadParent();

@@ -415,7 +415,7 @@ protected:
     // For InlineFlowBox and InlineTextBox
     bool extracted() const { return m_bitfields.extracted(); }

+#if !NDEBUG
     bool m_hasBadParent;
@@ -427,7 +427,7 @@ inline InlineBox::~InlineBox()

+#if !NDEBUG
 inline void InlineBox::setHasBadParent()
     m_hasBadParent = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment