Last Comment Bug 706787 - Crash on s390x (nsXPCComponents::AttachNewComponentsObject() fails).
: Crash on s390x (nsXPCComponents::AttachNewComponentsObject() fails).
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: 8 Branch
: Other Linux
: -- normal (vote)
: mozilla11
Assigned To: Martin Stránský
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-01 04:06 PST by Martin Stránský
Modified: 2011-12-05 10:39 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (2.59 KB, patch)
2011-12-01 14:58 PST, Martin Stránský
stransky: review-
Details | Diff | Splinter Review
v2 (2.62 KB, patch)
2011-12-02 06:33 PST, Martin Stránský
mh+mozilla: review+
Details | Diff | Splinter Review

Description Martin Stránský 2011-12-01 04:06:44 PST
On s390x, the nsXPCComponents::AttachNewComponentsObject() fails in optimized builds, it causes xpcshell crash and firefox fails to build there. s390 works fine.

###!!! ASSERTION: This is not supposed to fail!: 'Error', file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/js/src/xpconnect/src/nsXPConnect.cpp, line 984
###!!! ASSERTION: Failed to initialize nsScriptSecurityManager: 'NS_SUCCEEDED(rv)', file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/caps/src/nsScriptSecurityManager.cpp, line 3455
WARNING: NS_ENSURE_TRUE(sPreferences) failed: file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/modules/libpref/src/Preferences.cpp, line 1396
###!!! ASSERTION: Could not initialize nsContentUtils: 'Error', file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/layout/build/nsLayoutStatics.cpp, line 163
WARNING: Not Initialized: file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/content/html/content/src/nsHTMLDNSPrefetch.cpp, line 122
WARNING: NS_ENSURE_TRUE(sPreferences) failed: file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/modules/libpref/src/Preferences.cpp, line 1438
WARNING: NS_ENSURE_TRUE(sPreferences) failed: file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/modules/libpref/src/Preferences.cpp, line 1438
###!!! ASSERTION: ReleaseStatics called without Initialize!: 'sLiveShells', file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/layout/base/nsPresShell.cpp, line 9368
+++ Failed to get ScriptSecurityManager service, running without principals###!!! ASSERTION: We are assuming that nsScriptSecurityManager::Init() has been run: 'cb', file /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/js/src/xpconnect/shell/xpcshell.cpp, line 1914

Program received signal SIGSEGV, Segmentation fault.
main (argc=5, argv=0x3ffff8aab48, envp=0x3ffff8aab78)
    at /root/rpmbuild/BUILD/xulrunner-8.0/mozilla-release/js/src/xpconnect/shell/xpcshell.cpp:1915
1915	        NS_ASSERTION(!cb->findObjectPrincipals, "Your pigeon is in my hole!");
Comment 1 Martin Stránský 2011-12-01 14:58:04 PST
Created attachment 578411 [details] [diff] [review]
patch

Actually it's the same as Bug 696393, but for s390x. Works fine although I'm unsure about the params of vtable_func.
Comment 2 Mike Hommey [:glandium] 2011-12-02 00:59:16 PST
Comment on attachment 578411 [details] [diff] [review]
patch

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

This looks good, provided the ABI is similar to that of s390 as documented on
ftp://archive.download.redhat.com/pub/redhat/linux/7.2/en/os/s390/doc/l390abi0.pdf
which is about the only document I found about the linux s390 ABI. (and I found no corresponding document for s390x)

What you can do to gain some more confidence is to build and run the test in xpcom/reflect/xptcall/tests and check the output. It's unfortunately not very easy to get what is an error and what is not in that test, so it's probably best to compare the output to the one you get on e.g. x86-64.
Comment 3 Mike Hommey [:glandium] 2011-12-02 01:00:39 PST
(Note that Debian is currently in the process of adding s390x as a supported architecture, and we're going to have s390x chroots available soon, so I'll be able to help there soon)
Comment 4 Martin Stránský 2011-12-02 01:13:54 PST
Comment on attachment 578411 [details] [diff] [review]
patch

Thanks for pointing me to the test. Unfortunately the patch is broken, the TestXPTCInvoke segfaults on s390x.
Comment 5 Martin Stránský 2011-12-02 06:33:38 PST
Created attachment 578566 [details] [diff] [review]
v2

Better one, passes xpcom tests (IMHO).
Comment 6 Petr Cerny [:hrosik] 2011-12-02 06:39:06 PST
to Mike Hommey [:glandium] from comment #2)
> Comment on attachment 578411 [details] [diff] [review] [diff] [details] [review]
> patch
> 
> Review of attachment 578411 [details] [diff] [review] [diff] [details] [review]:
> -----------------------------------------------------------------
> 
> This looks good, provided the ABI is similar to that of s390 as documented on
> ftp://archive.download.redhat.com/pub/redhat/linux/7.2/en/os/s390/doc/
> l390abi0.pdf
> which is about the only document I found about the linux s390 ABI. (and I
> found no corresponding document for s390x)

ftp://legacy.redhat.com/pub/redhat/linux/7.1/es/os/s390x/doc/lzsabi0.pdf

or 

http://www.linuxbase.org/spec/ELF/zSeries/index_s390.html (once/if they get it working again)
Comment 7 Mike Hommey [:glandium] 2011-12-02 08:40:07 PST
Comment on attachment 578566 [details] [diff] [review]
v2

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

Seems good. 5 integer registers, one of which is used for "this", and 4 double registers.
Comment 9 Petr Cerny [:hrosik] 2011-12-05 06:04:04 PST
(In reply to Dão Gottwald [:dao] from comment #8)
> http://hg.mozilla.org/integration/mozilla-inbound/rev/2e6ab844f770

Just a small nitpicking: unused variable "PRUint64 result;"
http://hg.mozilla.org/integration/mozilla-inbound/rev/2e6ab844f770#l1.24
Comment 10 Matt Brubeck (:mbrubeck) 2011-12-05 10:39:50 PST
https://hg.mozilla.org/mozilla-central/rev/2e6ab844f770

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