Closed Bug 1728586 Opened 3 years ago Closed 2 years ago

Hang when entering blank server name in account settings

Categories

(Thunderbird :: Account Manager, defect)

Thunderbird 91
Unspecified
Linux
defect

Tracking

(thunderbird_esr91+ affected)

RESOLVED WORKSFORME
Tracking Status
thunderbird_esr91 + affected

People

(Reporter: henry-x, Unassigned)

References

Details

(Keywords: hang)

Steps to reproduce

  1. Open Account Settings and navigate to Server Settings for an account.
  2. Clear the input for Server Name.
  3. Click Copies and Folders.
  4. Close the "Server Settings" dialog, warning to enter a valid server name.

Result

Thunderbird then hangs and becomes unresponsive.

Expect

The dialog to close without hanging.

It might also make sense to replace the warning dialog, with a message next to the input instead.

A regression?

Keywords: hang

Bug 1658781 is related. Maybe you can spot the problem?

Summary: Hang when entering invalid server name → Hang when entering blank server name in account settings
Blocks: tb91found
Version: unspecified → Thunderbird 91

Which OS?

Flags: needinfo?(henry)

(In reply to Wayne Mery (:wsmwk) from comment #3)

Which OS?

This is on linux, can you not reproduce on other platforms?

Flags: needinfo?(henry)
OS: Unspecified → Linux

I did some debugging.

First, the prompt comes from checkUserServerChanges via onAccept https://searchfox.org/comm-central/rev/5d49baed2e8cbcdac07bddc0ff879a1ef60bd53c/mailnews/base/prefs/content/AccountManager.js#263

These methods do not hang. onAccept is triggered by the "change" event on the input.

Looking at the steps to reproduce again:

  1. Open Account Settings and navigate to Server Settings for an account.
  2. Clear the input for Server Name. At this point the input is not valid, but the "change" event has not yet been triggered because the input still has focus and no key has been pressed.
  3. Click Copies and Folders. I imagine this click would trigger: input looses focus (which triggers the "change" event); unload of the current page; load of the next page.
  4. Close the "Server Settings" dialog, warning to enter a valid server name. The prompt is shown during in the "change" onAccept handler and will not return until the dialog is closed.

Note that if, instead of step 3, you defocus the input by clicking somewhere else on the same page, then the window will not hang after step 4. So I think this is something to do with a page load or unload.

Also, I think that whilst the "change" prompt is showing, the main thread still cycles the event loop (https://searchfox.org/mozilla-central/rev/75e9d727ce5ba2c14653cf8fb0f1367f085271b7/toolkit/components/prompts/src/Prompter.jsm#1057), but the "change" handler still won't return until the prompt is closed.

So my initial speculation is that the hanging is caused by some page load or unload method being called whilst the "change" handler is still running.

Danny, can you reproduce?

So my initial speculation is that the hanging is caused by some page load or unload method being called whilst the "change" handler is still running.

So you expect not OS related ?

Blocks: 1737268
Flags: needinfo?(dannyfox)

As an update: I can no longer reproduce this. I do have a different computer now, still linux, but newer OS version (fedora 36).

So you expect not OS related?

I'm not sure. It could be a timing issue. Or maybe it was fixed in mozilla-central, or Gnome, etc.

Hi Wayne...

As a safety precaution, I created a new account to test this, as I have had issues in the past with changing something here and not being able to get it back...

Using TB 91.10.0, running under Windows 7 Pro 32-bit and Bitdefender AV:
(i) I could clear out the Server Name string, but as soon as I tried to go off-page (by clicking "Copies & Folders", as suggested), TB automatically restored the field and went to the new page. Returning to Server Settings, everything was unchanged.
(ii) If I cleared the Server Name string and clicked some other field on the same page (such as User Name, right below), the Server Name was restored as the focus changed to the new field.
(iii) There was never any warning message about a blank string, and TB did not hang during either of these procedures.

Using TB 102.0 new release, running under Windows 7 Pro 32-bit and Norton 360 AV:
(i) I could blank out the Server Name string, but as soon as I tried to go off-page (by clicking "Copies & Folders", as suggested), TB warned that the field was blank. When I ACK'd, the field was restored and we remained on the Server Settings page with no focus.
(ii) If I cleared the Server Name string and clicked some other field on the page (such as User Name, right below), TB again warned that the field was blank. When I ACK'd, the Server Name field was restored and focus changed to the new field.
(iii) TB did not hang during either of these procedures.

(Now I just have to figure out how to delete the test account :)

Flags: needinfo?(dannyfox)

WFM per reporter

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.