Closed Bug 516667 Opened 11 years ago Closed 11 years ago

Mozilla Firefox Cannot add bookmarks on AIX platform

Categories

(Core :: XPCOM, defect)

Other
AIX
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1
Tracking Status
status1.9.2 --- .2-fixed
status1.9.1 --- .9-fixed

People

(Reporter: shailen.n.jain, Assigned: shailen.n.jain)

References

Details

(Keywords: verified1.9.0.19, verified1.9.1, verified1.9.2)

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

With Mozilla firefox 3 on AIX platform,  when I click on 'Bookmarks->Bookmark This Page' ti shows me below error.

JavaScript error: , line 0: uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsITransactionManager.doTransaction]"  nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: file:///home/firefox/dbg/mozilla/obj-opt/dist/bin/components/nsPlacesTransactionsService.js :: doTransaction :: line 190"  data: no]


I debugged this further and found the below.

In  chrome://browser/content/browser.js, there are 2 lines as below
1.     var txn = PlacesUIUtils.ptm.createItem(uri, parent, -1,title, null, [descAnno]);
2.    PlacesUIUtils.ptm.doTransaction(txn);

I stepped inside at line#1 and it takes me to nsPlacesTransactionsService.js at the below lines

3. createItem: function placesCrtItem(aURI, aContainer, aIndex, aTitle, aKeyword, aAnnotations, aChildTransactions) {
4.     return new placesCreateItemTransactions(aURI, aContainer, aIndex, aTitle,aKeyword, aAnnotations, aChildTransactions);
5.  },


At line# 4, I examined whether the value returned is null or not and it shows that it is not null.
 
But when the value is returned to line#1 of browser.js, it is null.
Hence the line#2 of browser.js is resulting in an error saying Invaid pointer.

Can someone please advise what could be the reason for not getting the return value for 'txn' in chrome://browser/content/browser.js ?

Thanks,
Shailendra

Reproducible: Always

Steps to Reproduce:
1. Build Mozilla Firefox 3.6a1pre build on AIX with Gnome RPMS of 64 bit
version.
2.
3.
Actual Results:  
Build gives the above error.


Expected Results:  
Build should be able to add the new boomkark
Component: General → Bookmarks & History
QA Contact: general → bookmarks
Version: unspecified → 3.5 Branch
Attached patch Patch V 1 (obsolete) — Splinter Review
This is not a patch but this workaround helps adding the bookmark.

Can you please advise as what would be the reason for not getting the return value in browser.js
Attachment #400748 - Flags: review?(roc)
Attachment #400748 - Flags: review?(roc) → review?(sdwilsh)
Attachment #400748 - Flags: review?(sdwilsh) → review?(mak77)
I have added few java debugger screen shots.
Attachment #400973 - Flags: review?(mak77)
Attachment #400973 - Flags: review?(mak77)
Comment on attachment 400748 [details] [diff] [review]
Patch V 1

Sorry but clearly we can't take this workaround, this really looks like a platform issue, and could be related to tracemokey.

If i'd accept this workaround we should do the same everywhere, polluting the global space with any sort of vars.
Attachment #400748 - Flags: review?(mak77) → review-
Summary: Mozilla Firefox Cannot add bookmarks → Mozilla Firefox Cannot add bookmarks on AIX platform
cc-ing someone who could help understanding what's up and if this is a JS or tracemonkey issue for this specific platform.
Also this issue is happening with Mozilla Firefox 3.0.14 as well.

I believe tracemonkey was introduced in Mozilla Firefox 3.5 onwards.
I guess I have narrowed down the problem to below.

       Captured values for dispatchParams as below before returning from the function PrepareAndDispatch() in xptcstubs_ppc_aix64.cpp,
-----------------------------------------------------------------------------

(dbx) p dispatchParams[0]
(val = (i8 = 0, i16 = 0, i32 = 1, i64 = 4594144240, u8 = '\0', u16 = 0, u32 = 1, u64 = 4594144240, f = 1.40129846e-45, d = 2.2698088410234428e-314, b = 1, c = '\0', wc = 0, p = 0x0000000111d513f0))
(dbx) p dispatchParams[1]
(val = (i8 = 0, i16 = 0, i32 = 0, i64 = 2, u8 = '\0', u16 = 0, u32 = 0, u64 = 2, f = 0.0, d = 9.8813129168249309e-324, b = 0, c = '\0', wc = 0, p = 0x0000000000000002))
(dbx) p dispatchParams[2]
(val = (i8 = -1, i16 = -1, i32 = -1, i64 = -1, u8 = '\377', u16 = 65535, u32 = 4294967295, u64 = 18446744073709551615, f = -NaNQ, d = -NaNQ, b = -1, c = '\377', wc = 65535, p = 0xffffffffffffffff))
(dbx) p dispatchParams[3]
(val = (i8 = 15, i16 = 4095, i32 = 268435455, i64 = 1152921504606829568, u8 = '^O', u16 = 4095, u32 = 268435455, u64 = 1152921504606829568, f = 2.52435475e-29, d = 1.2882297539169369e-231, b = 268435455, c = '^O', wc = 4095, p = 0x0fffffffffffbc00))
(dbx) p dispatchParams[4]
(val = (i8 = 0, i16 = 0, i32 = 1, i64 = 4571052720, u8 = '\0', u16 = 0, u32 = 1, u64 = 4571052720, f = 1.40129846e-45, d = 2.2584001142811867e-314, b = 1, c = '\0', wc = 0, p = 0x000000011074bab0))
(dbx) p dispatchParams[5]
(val = (i8 = 0, i16 = 0, i32 = 1, i64 = 4599071568, u8 = '\0', u16 = 0, u32 = 1, u64 = 4599071568, f = 1.40129846e-45, d = 2.2722432645140344e-314, b = 1, c = '\0', wc = 0, p = 0x0000000112204350))
(dbx) p dispatchParams[6]
(val = (i8 = 0, i16 = 0, i32 = 1, i64 = 4599071952, u8 = '\0', u16 = 0, u32 = 1, u64 = 4599071952, f = 1.40129846e-45, d = 2.2722434542352424e-314, b = 1, c = '\0', wc = 0, p = 0x00000001122044d0))
(dbx) p dispatchParams[7]
(val = (i8 = 15, i16 = 4095, i32 = 268435455, i64 = 1152921504606829568, u8 = '^O', u16 = 4095, u32 = 268435455, u64 = 1152921504606829568, f = 2.52435475e-29, d = 1.2882297539169369e-231, b = 268435455, c = '^O', wc = 4095, p = 0x0fffffffffffbc00))

Similarly captured values for dispatchParams after the function call  NS_InvokeByIndex() in js/src/xpconnect/src/xpcwrappednative.cpp as below.
---------------------------------------------------------------------------

(dbx)  p dispatchParams[0]
    nsXPTCMiniVariant:(val = (i8 = 0, i16 = 0, i32 = 1, i64 = 4594144240, u8 = '\0', u16 = 0, u32 = 1, u64 = 4594144240, f = 1.40129846e-45, d = 2.2698088410234428e-314, b = 1, c = '\0', wc = 0, p = 0x0000000111d513f0))
(ptr = 0x00000001104917a4, type =
            XPTTypeDescriptorPrefix:(flags = '\222')
        (),
 flags = '^D')
(dbx)  p dispatchParams[1]
    nsXPTCMiniVariant:(val = (i8 = 0, i16 = 0, i32 = 0, i64 = 2, u8 = '\0', u16 = 0, u32 = 0, u64 = 2, f = 0.0, d = 9.8813129168249309e-324, b = 0, c = '\0', wc = 0, p = 0x0000000000000002))
(ptr = 0x09000000068e5468, type =
            XPTTypeDescriptorPrefix:(flags = '^C')
        (),
 flags = '\0')
(dbx)  p dispatchParams[2]
    nsXPTCMiniVariant:(val = (i8 = -1, i16 = -1, i32 = -1, i64 = -1, u8 = '\377', u16 = 65535, u32 = 4294967295, u64 = 18446744073709551615, f = -NaNQ, d = -NaNQ, b = -1, c = '\377', wc = 65535, p = 0xffffffffffffffff))
(ptr = 0x09000000067f4cc0, type =
            XPTTypeDescriptorPrefix:(flags = '^C')
        (),
 flags = '\0')
(dbx)  p dispatchParams[3]
    nsXPTCMiniVariant:(val = (i8 = 15, i16 = 4095, i32 = 268435455, i64 = 1152921504606829568, u8 = '^O', u16 = 4095, u32 = 268435455, u64 = 1152921504606829568, f = 2.52435475e-29, d = 1.2882297539169369e-231, b = 268435455, c = '^O', wc = 4095, p = 0x0fffffffffffbc00))
(ptr = 0x09001000a0ba4708, type =
            XPTTypeDescriptorPrefix:(flags = '\271')
        (),
 flags = '^P')
(dbx)  p dispatchParams[4]
    nsXPTCMiniVariant:(val = (i8 = 0, i16 = 0, i32 = 1, i64 = 4571052720, u8 = '\0', u16 = 0, u32 = 1, u64 = 4571052720, f = 1.40129846e-45, d = 2.2584001142811867e-314, b = 1, c = '\0', wc = 0, p = 0x000000011074bab0))
(ptr = 0x0fffffffffffb6c0, type =
            XPTTypeDescriptorPrefix:(flags = '\271')
        (),
 flags = '^P')
(dbx)  p dispatchParams[5]
    nsXPTCMiniVariant:(val = (i8 = 0, i16 = 0, i32 = 1, i64 = 4599071568, u8 = '\0', u16 = 0, u32 = 1, u64 = 4599071568, f = 1.40129846e-45, d = 2.2722432645140344e-314, b = 1, c = '\0', wc = 0, p = 0x0000000112204350))
(ptr = 0x00000005ffffffff, type =
            XPTTypeDescriptorPrefix:(flags = '\222')
        (),
 flags = '^D')
(dbx)  p dispatchParams[6]
    nsXPTCMiniVariant:(val = (i8 = 0, i16 = 0, i32 = 1, i64 = 4599071952, u8 = '\0', u16 = 0, u32 = 1, u64 = 4599071952, f = 1.40129846e-45, d = 2.2722434542352424e-314, b = 1, c = '\0', wc = 0, p = 0x00000001122044d0))
(ptr = 0x0000000111aa1471, type =
            XPTTypeDescriptorPrefix:(flags = '\222')
        (),
 flags = '^D')
(dbx)  p dispatchParams[7]
    nsXPTCMiniVariant:(val = (i8 = 0, i16 = 0, i32 = 0, i64 = 0, u8 = '\0', u16 = 0, u32 = 0, u64 = 0, f = 0.0, d = 0.0, b = 0, c = '\0', wc = 0, p = (nil)))
(ptr = 0x0fffffffffffb690, type =
            XPTTypeDescriptorPrefix:(flags = '\222')
        (),
 flags = '^E')

The return value is set to 'null' as the dispatchParams[7] is having 'null' values after making call to NS_InvokeByIndex() as shown above.

Couple of things that I noted here is that

   1. dispatchParams[7] was not null before returning from PrepareAndDispatch()

   2. dispatchParams[3] and dispatchParams[7] values are exactly same.

Can someone please advise ?

Thanks,
Shailendra
Did you compile with optimization?
If yes, did you used the -qalias=noansi flag?
Yes I compiled with optimization. Also I did use the -qalias=noansi flag
I ran into a similar JavaScript error with Seamonkey 2.0 source.
No optimization at all, a full debug build in 32bit.
So xptcstubs_ppc_aix64.cpp isn't used at all, but xptcstubs_ppc_aix.cpp instead.
Attached patch Patch V 2Splinter Review
The complete patch for both 64-bit and 32-bit. This resolves the adding bookmark issue on AIX platform
Attachment #400748 - Attachment is obsolete: true
Attachment #418493 - Flags: review?(lw)
Can you fix the issue the stubs for using -qobjmodel=ibm too?
I guess they have similiar issues.
Incredible job tracking that down!  Unfortunately, I have little xpcom knowledge  and should not be the reviewer for this patch.
Those files patched by https://bugzilla.mozilla.org/attachment.cgi?id=418493 only affect building on AIX with IBM XLC compiler. No other platforms hit in any way.

At the moment I'm building a Firefox 3.0.16 on AIX 5.1 / IBM XLC 7.0.0.10 for testing/confirming Shailen's patch. Even if I don't understand what incrementing those two numbers by 24 in the 32bit assembly unit and 32 in the 64bit unit actually does. But I can confirm the bug without the patch.
Comment on attachment 418493 [details] [diff] [review]
Patch V 2

Not that I know much about this but this code either, but we don't ship on AIX.
Attachment #418493 - Flags: review?(lw) → review+
Crowder, this looks related to the bug we were chasing on arm (just fyi).
A comment what the patch really does would be nice, btw. We had a similar issue on arm so I am assuming we started using more arguments and that overrun some arguments area.
Andreas:  Yeah, likely we've got a similar issue with our pointer-math on ARM.  :(
(In reply to comment #10)
> Created an attachment (id=418493) [details]
> Patch V 2
> 
> The complete patch for both 64-bit and 32-bit. This resolves the adding
> bookmark issue on AIX platform

I can verify this patch works with Firefox 3.0.16 compiled from CVS on AIX 5.1ML9 with IBM XLC/C++ 7.0.0.10 as 64bit app and it is the first Firefox 3.0.x I've compiled without any issues. Next a 32bit build to follow...
> I can verify this patch works with Firefox 3.0.16 compiled from CVS on AIX
> 5.1ML9 with IBM XLC/C++ 7.0.0.10 as 64bit app and it is the first Firefox 3.0.x
> I've compiled without any issues. Next a 32bit build to follow...

The 32bit build works flawlessly, too. THX Shailen for this patch :-)
Keywords: checkin-needed
Assignee: nobody → shailen.n.jain
Component: Bookmarks & History → XPConnect
Product: Firefox → Core
QA Contact: bookmarks → xpconnect
Version: 3.5 Branch → Trunk
moa=me, FWIW!
Status: UNCONFIRMED → NEW
Ever confirmed: true
Depends on: 535894
Can this patch be added to 1.9.0 and 1.9.1 branches ?
Attachment #418493 - Flags: superreview?(benjamin)
Attachment #418493 - Flags: approval1.9.2.1?
Attachment #418493 - Flags: approval1.9.1.8?
Attachment #418493 - Flags: approval1.9.0.18?
Plz push to this patch to the stable branches after approval.

Risc: 
 None for any platforms except AIX as the touched files aren't used for anything but AIX. This patch is a must have for AIX, if not in the repository this patch must be applied locally. Over the last 2 or 3 years I'm not aware of other porting efforts to AIX except Shailen's for 64bit and mine for 32bit.

Benefit: 
 Stable port for AIX is available, so the AIX platform has a secure Web browser for the first time since Firefox 2.0.0.20 with reproducable build instructions.

 If the patch is applied locally I have to contribute the local patch together with the build instructions. The other porting hunks in the combined patch are more or less straightforward, but this one is very hard/impossible to understand/evaluate/trust.
I can confirm that https://bugzilla.mozilla.org/attachment.cgi?id=418493 also works fine on AIX 4.3.3ML11 with the old VisualAge C++ 6.0 compiler.
Andreas isn't an XPCOM peer, according to http://www.mozilla.org/about/owners.html#xpcom, so removing checkin-needed until bsmedberg can review.
Status: NEW → ASSIGNED
Component: XPConnect → XPCOM
Keywords: checkin-needed
OS: Other → AIX
QA Contact: xpconnect → xpcom
Attachment #418493 - Flags: approval1.9.2.1?
Attachment #418493 - Flags: approval1.9.1.8?
Attachment #418493 - Flags: approval1.9.0.18?
Blocks: 537588
Attachment #418493 - Flags: superreview?(benjamin) → superreview+
The patch doesn't apply cleanly.
Keywords: checkin-needed
Recreated the patch by locally applying Shailen's patch and then "hg diff -U8 -p"
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/3655cb58d2cc
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Comment on attachment 422729 [details] [diff] [review]
Cleaned to Comment #26

Risc: None for any platform except AIX as the patched sources are not used at all by any other platform.

This patch is well tested on AIX with IBM compilers from 6.0 through 10.1 and from AIX 4.3.3, 5.1, 5.2 and 5.3, AIX 5.x 32- and 64bit.
Attachment #422729 - Flags: approval1.9.2.2?
Attachment #422729 - Flags: approval1.9.1.9?
Attachment #422729 - Flags: approval1.9.0.19?
Comment on attachment 422729 [details] [diff] [review]
Cleaned to Comment #26

a=beltzner for 1.9.2.2, 1.9.1.9, 1.9.0.19
Attachment #422729 - Flags: approval1.9.2.2?
Attachment #422729 - Flags: approval1.9.2.2+
Attachment #422729 - Flags: approval1.9.1.9?
Attachment #422729 - Flags: approval1.9.1.9+
Attachment #422729 - Flags: approval1.9.0.19?
Attachment #422729 - Flags: approval1.9.0.19+
Whiteboard: [checkin to 1.9.1] [checkin to cvs]
https://hg.mozilla.org/releases/mozilla-1.9.1/rev/b38043e20dce
mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_aix.s.m4 	1.2
mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_aix64.s.m4 	1.2
Whiteboard: [checkin to 1.9.1] [checkin to cvs]
Duplicate of this bug: 523063
You need to log in before you can comment on or make changes to this bug.