Closed Bug 599577 Opened 14 years ago Closed 14 years ago

Stubcalls.cpp fails to compile

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: insidepoolhenry, Unassigned)

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b5pre) Gecko/20100825 SeaMonkey/2.1b1pre
Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b5pre) Gecko/20100825 SeaMonkey/2.1b1pre

Build process fails a minute or so after starting. Pentium 4 3.2 Ghz dual core, hyperthreaded CPU.

Reproducible: Always

Steps to Reproduce:
1.python client.py checkout
2. make -f client.mk clean
3.make -f client.mk build
Actual Results:  
The following has been occuring for the last week or so when building:
/home/compdata/build/mozsrc/mozilla/js/src/methodjit/StubCalls.cpp: In function ‘bool StubEqualityOp(js::VMFrame&) [with int EQ = 1, bool IFNAN = false]’:
/home/compdata/build/mozsrc/mozilla/js/src/methodjit/StubCalls.cpp:1141:   instantiated from here
/home/compdata/build/mozsrc/mozilla/js/src/methodjit/StubCalls.cpp:1070: error: no matching function for call to ‘SameType(js::Value&, js::Value&)’
/home/compdata/build/mozsrc/mozilla/js/src/methodjit/StubCalls.cpp: In function ‘bool StubEqualityOp(js::VMFrame&) [with int EQ = 0, bool IFNAN = true]’:
/home/compdata/build/mozsrc/mozilla/js/src/methodjit/StubCalls.cpp:1149:   instantiated from here
/home/compdata/build/mozsrc/mozilla/js/src/methodjit/StubCalls.cpp:1070: error: no matching function for call to ‘SameType(js::Value&, js::Value&)’
make[5]: *** [StubCalls.o] Error 1
make[4]: *** [libs_tier_js] Error 2
make[3]: *** [tier_js] Error 2
make[2]: *** [default] Error 2
make[1]: *** [default] Error 2
make: *** [build] Error 2

Expected Results:  
Successful build. Tried reducing threads in build to one: same result.

mozconfig:

ac_add_options --enable-application=suite
ac_add_options --enable-optimize

mk_add_options MOZ_CO_PROJECT=suite
mk_add_options MOZ_MAKE_FLAGS=-j1
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
For one thing, we have x86_64 builds compiling fine and can't reproduce this, for the other, this is not a SeaMonkey thing, but a JS file you're compiling, so moving there.
Assignee: nobody → general
Component: Build Config → JavaScript Engine
Product: SeaMonkey → Core
QA Contact: build-config → general
This is the buildconfig from the last successful build I had. Tried updating debian packages on Lenny. No luck. Same problem:

about:buildconfig
Source

Built from http://hg.mozilla.org/mozilla-central/rev/c6838f6cb68a
Build platform
target
x86_64-unknown-linux-gnu
Build tools
Compiler 	Version 	Compiler flags
gcc 	gcc version 4.3.2 (Debian 4.3.2-1.1) 	-Wall -W -Wno-unused -Wpointer-arith -Wcast-align -W -pedantic -Wno-long-long -fno-strict-aliasing -pthread -pipe -DNDEBUG -DTRIMMED -Os -freorder-blocks -fomit-frame-pointer
c++ 	gcc version 4.3.2 (Debian 4.3.2-1.1) 	-fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -Os -freorder-blocks -fomit-frame-pointer
Configure arguments

--enable-application=suite --enable-optimize --enable-application=suite --enable-optimize --enable-application=../suite --disable-official-branding --with-branding=../suite/branding/nightly --enable-shared-js --cache-file=.././config.cache --srcdir=/home/compdata/build/mozsrc/mozilla
I see the same problem under Debian GNU/Linux (32bit).
(The last time I compiled TB3 was early September, and could not touch
it until Oct 8th when I notice this problem.)

The error I see is essentially the same.

make[5]: Entering directory `/home/ishikawa/TB-3HG/objdir-tb3/mozilla/js/src'
StubCalls.cpp
/usr/bin/g++ -DDEBUG_4GB_CHECK -o StubCalls.o -c  -I./../../dist/system_wrappers_js -include /home/ishikawa/TB-3HG/new-src/mozilla/js/src/config/gcc_hidden.h -DOSTYPE=\"Linux2.6\" -DOSARCH=Linux -DEXPORT_JS_API -D__STDC_LIMIT_MACROS -DJS_HAS_CTYPES -DDLL_PREFIX=\"lib\" -DDLL_SUFFIX=\".so\" -Ictypes/libffi/include -I.  -I/home/ishikawa/TB-3HG/new-src/mozilla/js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub  -I/home/ishikawa/TB-3HG/objdir-tb3/mozilla/dist/include/nspr   -I/home/ishikawa/TB-3HG/new-src/mozilla/js/src -I/home/ishikawa/TB-3HG/new-src/mozilla/js/src/assembler -I/home/ishikawa/TB-3HG/new-src/mozilla/js/src/yarr  -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -pedantic -Wno-long-long -fno-strict-aliasing -pthread -pipe  -DDEBUG -D_DEBUG -DTRACING -g -O3 -fstrict-aliasing -fomit-frame-pointer -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1   -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/StubCalls.pp /home/ishikawa/TB-3HG/new-src/mozilla/js/src/methodjit/StubCalls.cpp
/home/ishikawa/TB-3HG/new-src/mozilla/js/src/methodjit/StubCalls.cpp: In function 'bool StubEqualityOp(js::VMFrame&) [with int EQ = 1, bool IFNAN = false]':
/home/ishikawa/TB-3HG/new-src/mozilla/js/src/methodjit/StubCalls.cpp:1133:   instantiated from here
/home/ishikawa/TB-3HG/new-src/mozilla/js/src/methodjit/StubCalls.cpp:1062: error: no matching function for call to 'SameType(js::Value&, js::Value&)'
/home/ishikawa/TB-3HG/new-src/mozilla/js/src/methodjit/StubCalls.cpp: In function 'bool StubEqualityOp(js::VMFrame&) [with int EQ = 0, bool IFNAN = true]':
/home/ishikawa/TB-3HG/new-src/mozilla/js/src/methodjit/StubCalls.cpp:1141:   instantiated from here
/home/ishikawa/TB-3HG/new-src/mozilla/js/src/methodjit/StubCalls.cpp:1062: error: no matching function for call to 'SameType(js::Value&, js::Value&)'
make[5]: *** [StubCalls.o] Error 1

StubEqualityOp calls in lines 1133 and 1141 of StubCalls.cpp are as follows:

 1130	JSBool JS_FASTCALL
 1131	stubs::Equal(VMFrame &f)
 1132	{
 1133	    if (!StubEqualityOp<JS_TRUE, false>(f))
 1134	        THROWV(JS_FALSE);
 1135	    return f.regs.sp[-2].toBoolean();
 1136	}
 1137	
 1138	JSBool JS_FASTCALL
 1139	stubs::NotEqual(VMFrame &f)
 1140	{
 1141	    if (!StubEqualityOp<JS_FALSE, true>(f))
 1142	        THROWV(JS_FALSE);
 1143	    return f.regs.sp[-2].toBoolean();
 1144	}
 1145	

On a hunch, I created the preprocessed StubCalls.cpp using the following command
after changing the working directory to
`/home/ishikawa/TB-3HG/objdir-tb3/mozilla/js/src'  (I am using MOZOBJ)

# the command to create the preprocessed file is uploaded as t-preprocess.sh

I am attaching the preprocessed source file. StubCalls-preprocessed.cpp

Looking through it, I found the following.

SameType is defined in as part of Class Value

    inline
    friend bool SameType(const Value &lhs, const Value &rhs) {
        return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data);
    }

(Could it be inline feature may play havoc with the compilation? No.
I took out inline. Still the same compilation error.)

StubEqualityOp calls SameType as follows. 

template <JSBool EQ, bool IFNAN>
static inline bool
StubEqualityOp(VMFrame &f)
{
    JSContext *cx = f.cx;
    JSFrameRegs &regs = f.regs;

    Value rval = regs.sp[-1];
    Value lval = regs.sp[-2];

    JSBool cond;

    [ ... omission ...]

    if (SameType(lval, rval)) {
        JS_ASSERT(!lval.isString());    /* this case is handled above */
        if (lval.isDouble()) {


There don't seem to be genuinely strange thing about SameType call.
(Except that I am not sure if SameType is visible to the call
here. Looking through the preprocesse file very briefly, I am not
entirely sure. It is a complex file consisting of many classes,
namespaces, etc.)

There are two people in the world who encounter the problem.
But to think other people didn't encounter this problem. Very strange, indeed.
So can the compilation error be Debian GNU/Linux-dependent thing?

(It is possible that during configuration some text utility tools such
as sed, egrep, grep, etc. may not behave in exactly the supposed
manner under Debian GNU/Linux, and some dynamically-created header
files, etc. may not be quite right?)

t-test.sh

To test this theory, can other people under linux using GCC run the
preprocessed file using the attached command to see if they can finish
without error?  (The attached command is essentially the compilation
command that I used after removing any include-related directives.)

I upload the script as t-test.sh (Please modify the name of the
downloaded preprocessed file in it.)

Using this script I get the following error:

sh t-test.sh
/tmp/tmp.cpp: In static member function 'static char std::numeric_limits<char>::min()':
/tmp/tmp.cpp:22704: warning: overflow in implicit constant conversion
/tmp/tmp.cpp: In function 'bool StubEqualityOp(js::VMFrame&) [with int EQ = 1, bool IFNAN = false]':
/tmp/tmp.cpp:44056:   instantiated from here
/tmp/tmp.cpp:43985: error: no matching function for call to 'SameType(js::Value&, js::Value&)'
/tmp/tmp.cpp: In function 'bool StubEqualityOp(js::VMFrame&) [with int EQ = 0, bool IFNAN = true]':
/tmp/tmp.cpp:44064:   instantiated from here
/tmp/tmp.cpp:43985: error: no matching function for call to 'SameType(js::Value&, js::Value&)'
g++ (Debian 4.3.2-1.1) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Linux debian-vm 2.6.26-2-686 #1 SMP Thu Aug 19 03:44:10 UTC 2010 i686 GNU/Linux


BTW: Note the second parameter (to specify type) to either call
StubEquality of is boolean constant, either 'true" or 'false', which
is not referenced at all in the code. Funny.
t-test.sh

To test this theory, can other people under linux using GCC run the
preprocessed file using the attached command to see if they can finish
without error?  (The attached command is essentially the compilation
command that I used after removing any include-related directives.)

I upload the script as t-test.sh (Please modify the name of the
downloaded preprocessed file in it.)

See the sample output in the previous comment.
The command to produce the preprocessed StubCalls.cpp
See the second previous comment.
(In reply to comment #5)
> Created attachment 482093 [details]
> The command to produce the preprocessed StubCalls.cpp
> 
> The command to produce the preprocessed StubCalls.cpp
> See the second previous comment.

On a hunch, I upgraded the GCC version to the latest one: gcc 4.5.1.
(Debian is know for its conservatism regarding the upgrade of many software packages.) So I had to download GCC 4.5.1 and install it: along with GMP, MPFR, and MPC. Don't forget to run ldconfig after the installation of these additional packages. You will see very strange error message concerning the failure to compute the suffix of object file.

But still no go.
I am stumped.
Obviously the definition of SameType() is not visible (in terms of scope) where
the call is made. (Or the type/# of arguments do not match. Hard to believe.)

I think I can rule out the compiler issue now that 
4.5.1 also fails to compile the preprocess source file.
I wonder what makes the environments of the original reporter's and mine (both Debian GNU/Linux) different from others.

My desperate guess is the minor variation in the header files included from system libraries and some very minor deviation of the tools such as sed, grep and others to produce a slightly different source files and configuration files (?).


The error message from the run of t-test.sh with GCC 4.5.1 is below. 
sh t-test.sh
/tmp/tmp.cpp: In static member function 'static char
std::numeric_limits<char>::min()':
/tmp/tmp.cpp:22704: warning: overflow in implicit constant conversion
/tmp/tmp.cpp: In function 'bool StubEqualityOp(js::VMFrame&) [with int
EQ = 1, bool IFNAN = false]':
/tmp/tmp.cpp:44056:   instantiated from here
/tmp/tmp.cpp:43985: error: no matching function for call to
'SameType(js::Value&, js::Value&)'
/tmp/tmp.cpp: In function 'bool StubEqualityOp(js::VMFrame&) [with int
EQ = 0, bool IFNAN = true]':
/tmp/tmp.cpp:44064:   instantiated from here
/tmp/tmp.cpp:43985: error: no matching function for call to
'SameType(js::Value&, js::Value&)'
g++ (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Linux debian-vm 2.6.26-2-686 #1 SMP Thu Aug 19 03:44:10 UTC 2010 i686
GNU/Linux
ishikawa@debian-vm:/tmp$


PS: I am removing all the lines that start with "#". These removed lines may contain pragrams. But I doubt if the removal affect the particular bug discussed here. (The warning at 22704 may be the result of removal.)
I have no idea exactly what has changed.

I bit the bullet and deleted ./mozilla subdirectory and
refreshed it with "python client.py checkout".

Then this problem disappeared!

But then later, I hit a similar strange problem under c-sdk, and
so cleared directory/c-sdk and refreshed it with "python client.py checkout".

From a few posts I saw in mozilla.dev.build and based on my above observation,
there may have been a hardware or network issue in late September and early
October which corrupted the checkout process.

Running "python client.py checkout" never solved the problem until
I removed ./mozilla and ./directory/c-sdk.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
I changed the status to RESOLVED and WORKSFORME.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: