ASSERTION: password length not equal to number of asterisks

RESOLVED FIXED in mozilla28

Status

()

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gwagner, Assigned: Ehsan)

Tracking

Trunk
mozilla28
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
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
(Assignee)

Comment 2

5 years ago
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)
(Reporter)

Comment 3

5 years ago
(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.
(Assignee)

Comment 5

5 years ago
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.
(Assignee)

Updated

5 years ago
Depends on: 936665
(Assignee)

Comment 7

5 years ago
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.
(Assignee)

Comment 8

5 years ago
Created attachment 830356 [details] [diff] [review]
Patch (v1)
Attachment #830356 - Flags: review?(roc)
(Assignee)

Updated

5 years ago
No longer depends on: 936665
https://hg.mozilla.org/mozilla-central/rev/23bcdbcea3fa
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
(Assignee)

Comment 11

5 years ago
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)
(Reporter)

Comment 12

5 years ago
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.