Closed Bug 933883 Opened 11 years ago Closed 11 years ago

ASSERTION: password length not equal to number of asterisks

Categories

(Core :: DOM: Editor, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: gwagner, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

Constant assertion on b2g emulator tests:
https://tbpl.mozilla.org/php/getParsedLog.php?id=29959039&tree=Pine&full=1#error0

01:14:42     INFO -  --DOMWINDOW == 32 (0x4401175c) [serial = 887] [outer = 0x0] [url = http://mochi.test:8888/tests/layout/forms/test/test_bug378670.html]
01:14:42     INFO -  --DOMWINDOW == 31 (0x4400f14c) [serial = 795] [outer = 0x0] [url = http://mochi.test:8888/tests/layout/base/tests/bug612271-2.html]
01:14:47     INFO -  --DOMWINDOW == 30 (0x44e81cbc) [serial = 835] [outer = 0x0] [url = http://mochi.test:8888/tests/layout/base/tests/bug646382-1.html]
01:14:47     INFO -  [Child 709] WARNING: NS_ENSURE_TRUE(selCon) failed: file ../../../../gecko/editor/libeditor/base/nsEditor.cpp, line 612
01:14:47     INFO -  [Child 709] WARNING: NS_ENSURE_TRUE(selcon) failed: file ../../../../gecko/editor/libeditor/base/nsEditor.cpp, line 634
01:14:47     INFO -  [Child 709] WARNING: NS_ENSURE_SUCCESS(res, __null) failed with result 0xC1F30001: file ../../../../gecko/editor/libeditor/base/nsEditor.cpp, line 643
01:14:47     INFO -  [Child 709] WARNING: NS_ENSURE_TRUE(selection) failed: file ../../../../gecko/editor/libeditor/text/nsTextEditRules.cpp, line 1284
01:14:47     INFO -  [Child 709] WARNING: NS_ENSURE_TRUE(mRootElement) failed: file ../../../../gecko/editor/libeditor/base/nsEditor.cpp, line 2156
01:14:47     INFO -  [Child 709] WARNING: NS_ENSURE_TRUE(rootElement) failed: file ../../../../gecko/editor/libeditor/text/nsPlaintextEditor.cpp, line 913
01:14:47     INFO -  [Child 709] ###!!! ASSERTION: password length not equal to number of asterisks: 'mPasswordText.Length() == uint32_t(txtLen)', file ../../../../gecko/editor/libeditor/text/nsTextEditRules.cpp, line 1268
01:14:47     INFO -  824 INFO TEST-END | /tests/layout/forms/test/test_bug542914.html | finished in 10436ms
01:14:47     INFO -  ++DOMWINDOW == 31 (0x4400f14c) [serial = 904] [outer = 0x4401053c]
01:14:47     INFO -  825 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/forms/test/test_bug542914.html | Assertion count 1 is greater than expected range 0-0 assertions.

This blocks enabling debug emulator tests.
Ehsan, please take a look here
Assignee: nobody → ehsan
Flags: needinfo?(ehsan)
Component: Layout → Editor
Version: unspecified → Trunk
Hmm, what's on the Pine branch, Gregor?  Can you please let me know what build environment I should use to reproduce this?

Thanks!
Flags: needinfo?(ehsan) → needinfo?(anygregor)
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #2)
> Hmm, what's on the Pine branch, Gregor?  Can you please let me know what
> build environment I should use to reproduce this?
> 
> Thanks!

The pine branch has debug emulator tests enabled. We want to get them on all trees but we have to fix all the assertions before. I don't know if there is an easy way to run the tests locally and it probably will be horrible slow.
jgriffin knows all the details about it.
Flags: needinfo?(anygregor)
This describes how to run the tests locally:  https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Mochitests

And yes, they are horribly slow...each chunk can take an hour of time, using a debug emulator.
Thanks!  So, I only need B2G_DEBUG=1 in my .userconfig to get one of these builds, right?

(I'm building for ICS locally if that matters.)
Yep, B2G_DEBUG should do the trick.
Depends on: 936665
OK, I figured out why this assertion happens.  Inside this test, we synthesize an 'x' key, which triggers the asterisk inserting timer.  Now, this timer is fired way after the input element has been removed from the document, and ASSERT_PASSWORD_LENGTHS_EQUAL tries to read the value from the editor class, which walks the DOM under the editor's root node, which doesn't exist any longer since we have lost our frame by that point, which makes GetTextLength() fail, and then we would compare mPasswordText.Length() against a value of 0.

The fix is simple, we should only call GetTextLength() when GetRoot() doesn't return null.
Attached patch Patch (v1)Splinter Review
Attachment #830356 - Flags: review?(roc)
No longer depends on: 936665
https://hg.mozilla.org/mozilla-central/rev/23bcdbcea3fa
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Gregor, can you please verify that this is indeed fixed? (The assertion goes away in my local build.)

I have a hard time finding this test failure message on Pine either before or after my patch...
Flags: needinfo?(anygregor)
The assertion went away when I pushed your patch. Thanks Ehsan!
Flags: needinfo?(anygregor)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: