Last Comment Bug 671423 - "non-relocatable subtraction expression" trying to compile content/canvas/src/CanvasUtils.cpp
: "non-relocatable subtraction expression" trying to compile content/canvas/src...
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: Canvas: 2D (show other bugs)
: Trunk
: x86 Mac OS X
: -- blocker (vote)
: mozilla9
Assigned To: Mike Hommey [:glandium]
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-13 14:54 PDT by Hanspeter Niederstrasser
Modified: 2011-09-23 20:56 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
CanvasUtils.s (3.55 MB, text/plain)
2011-07-13 16:19 PDT, Hanspeter Niederstrasser
no flags Details
Attempt (724 bytes, patch)
2011-07-14 06:45 PDT, Mike Hommey [:glandium]
no flags Details | Diff | Splinter Review
Manually inline DOUBLE_TO_JSVAL to avoid Xcode 3.1.4 miscompilation (1.18 KB, patch)
2011-07-14 14:48 PDT, Mike Hommey [:glandium]
jimb: review+
Details | Diff | Splinter Review

Description Hanspeter Niederstrasser 2011-07-13 14:54:01 PDT
Similar to bug 653777 and bug 624080:

10.5.8 with i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5577)

g++-4.2 -o CanvasUtils.o -c  -fvisibility=hidden -DUSE_ANGLE -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DSTATIC_EXPORTABLE_JS_API -DOSTYPE=\"Darwin9.8.0\" -DOSARCH=Darwin -DEXCLUDE_SKIA_DEPENDENCIES -DCHROMIUM_MOZILLA_BUILD  -DOS_MACOSX=1 -DOS_POSIX=1  -D_IMPL_NS_LAYOUT -I/src/mozilla-central/ipc/chromium/src -I/src/mozilla-central/ipc/glue -I../../../ipc/ipdl/_ipdlheaders  -I/src/mozilla-central/content/canvas/src -I. -I../../../dist/include -I../../../dist/include/nsprpub  -I/src/mozilla-central/obj-i386-apple-darwin9.8.0-mac/dist/include/nspr -I/src/mozilla-central/obj-i386-apple-darwin9.8.0-mac/dist/include/nss      -I/src/mozilla-central/content/canvas/src/../../../layout/xul/base/src -I/src/mozilla-central/content/canvas/src/../../../layout/style -I/src/mozilla-central/content/canvas/src/../../../layout/generic -I/src/mozilla-central/content/canvas/src/../../base/src -I/src/mozilla-central/content/canvas/src/../../html/content/src   -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 -Werror=return-type -fno-strict-aliasing -fno-common -fshort-wchar -pthread -DNO_X11 -pipe  -DNDEBUG -DTRIMMED -g -O3 -fomit-frame-pointer -I/src/mozilla-central/obj-i386-apple-darwin9.8.0-mac/dist/include/cairo -DNO_X11   -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MF .deps/CanvasUtils.pp /src/mozilla-central/content/canvas/src/CanvasUtils.cpp
{standard input}:1318:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1318:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1301:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1301:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1284:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1284:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1267:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1267:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1250:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1250:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1232:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1232:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:521:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:521:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:504:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:504:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:487:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:487:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:470:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:470:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:453:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:453:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:435:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:435:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:unknown:Undefined local symbol L00000000001$pb
{standard input}:unknown:Undefined local symbol L00000000004$pb
make[7]: *** [CanvasUtils.o] Error 1
make[7]: Leaving directory `/src/mozilla-central/obj-i386-apple-darwin9.8.0-mac/content/canvas/src'
Comment 1 Mike Hommey [:glandium] 2011-07-13 15:10:43 PDT
Like in bug 653777, please generate the corresponding .s file and attach it.
Comment 2 Hanspeter Niederstrasser 2011-07-13 16:19:59 PDT
Created attachment 545776 [details]
CanvasUtils.s
Comment 3 Mike Hommey [:glandium] 2011-07-14 00:02:04 PDT
So, the responsible code is:
http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/CanvasUtils.cpp#217

which uses DOUBLE_TO_JSVAL, which looks like this:
static JS_ALWAYS_INLINE jsval
DOUBLE_TO_JSVAL(jsdouble d)
{
    d = JS_CANONICALIZE_NAN(d);
    return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d));
}

So all in all, this is actually another case of JS_CANONICALIZE_NAN mis-inlining. Had you tried my last patch from bug 653777, which changes JS_CANONICALIZE_NAN?
Comment 4 Hanspeter Niederstrasser 2011-07-14 06:21:01 PDT
Applying attachment 545185 [details] [diff] [review] from bug 653777 just changes the line numbers in the error output.

{standard input}:1424:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1424:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1407:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1407:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1390:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1390:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1373:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1373:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1356:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1356:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:1338:non-relocatable subtraction expression, "LC1" minus "L00000000004$pb"
{standard input}:1338:symbol: "L00000000004$pb" can't be undefined in a subtraction expression
{standard input}:574:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:574:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:557:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:557:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:540:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:540:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:523:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:523:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:506:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:506:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:488:non-relocatable subtraction expression, "LC1" minus "L00000000001$pb"
{standard input}:488:symbol: "L00000000001$pb" can't be undefined in a subtraction expression
{standard input}:unknown:Undefined local symbol L00000000001$pb
{standard input}:unknown:Undefined local symbol L00000000004$pb
make[7]: *** [CanvasUtils.o] Error 1
Comment 5 Mike Hommey [:glandium] 2011-07-14 06:45:46 PDT
Created attachment 545903 [details] [diff] [review]
Attempt

Can you try this?
Comment 6 Hanspeter Niederstrasser 2011-07-14 11:31:34 PDT
(In reply to comment #5)
> Created attachment 545903 [details] [diff] [review] [review]
> Attempt
> 
> Can you try this?

Success!
Comment 7 Mike Hommey [:glandium] 2011-07-14 14:48:33 PDT
Created attachment 546007 [details] [diff] [review]
Manually inline DOUBLE_TO_JSVAL to avoid Xcode 3.1.4 miscompilation
Comment 8 Jim Blandy :jimb 2011-09-22 14:40:20 PDT
Comment on attachment 546007 [details] [diff] [review]
Manually inline DOUBLE_TO_JSVAL to avoid Xcode 3.1.4 miscompilation

Review of attachment 546007 [details] [diff] [review]:
-----------------------------------------------------------------

So, it's okay to drop the 'JS_ASSERT(JSVAL_IS_DOUBLE_IMPL(l))' that appears in DOUBLE_TO_JSVAL_IMPL because the whole point of the function is that any incoming NaN gets turned into the NaN that isn't the representation of some other kind of JavaScript value. Right?
Comment 9 Mike Hommey [:glandium] 2011-09-23 05:22:46 PDT
right
Comment 11 Ed Morley [:emorley] 2011-09-23 20:56:52 PDT
https://hg.mozilla.org/mozilla-central/rev/5ddec215cf62

Note You need to log in before you can comment on or make changes to this bug.