Closed Bug 1495698 Opened 2 years ago Closed 2 years ago

Freeze by using HTML signatures referencing non-existent image


(Thunderbird :: Message Compose Window, defect)

Not set


(thunderbird_esr6063+ fixed, thunderbird63 fixed, thunderbird64 fixed)

Thunderbird 64.0
Tracking Status
thunderbird_esr60 63+ fixed
thunderbird63 --- fixed
thunderbird64 --- fixed


(Reporter: mariomey, Assigned: jorgk-bmo)



(Keywords: hang, regression)


(2 files, 1 obsolete file)

Attached file firma.html
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
Build ID: 20180920131237

Steps to reproduce:

Debian 9 Mate 64x

I have 3 identities in my account. All of them has HTML signature. Some days ago, I could select any of them and signature worked OK. But I updated my system.
Now, the main one works... but, when I select any of the other... Thunderbirds freezes: I have to kill it.
Y have my signatures as html files, loaded by "Attach the signature from a file instead)...".
But, if I uncheck that option and paste html code in "Signature text" with "Use HTML..." checked, Thunderbird freezes.
If I uncheck "Use HTML....", it doesn't freeze... but signature appears as code.

I attach one signature HTML file.

Actual results:

Thunderbird freezes.

Expected results:

Show HTML signatures right using code or file.
If tested this with your signature. That contains:
<p class="firma"><img src="file:///home/mario/circo3d-grafica/mails-headers-firmas/firma.png" alt="" border="0" width="250" height="75"></p>

I get a hang too, and I obviously don't have the file. If I change the source to a file I have, it works fine, and then changing it to an invalid filename it hangs again.

The debug window shows and endless loop:
[9476, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80520012: file c:/mozilla-source/comm-central/comm/mailnews/compose/src/nsMsgCompose.cpp, line 4284

Hmm, I thought I had already fixed this one in bug 1477401. I'll fix it.

To get you going again, make sure that the file exists on your machine.
Assignee: nobody → jorgk
Component: Untriaged → Message Compose Window
Ever confirmed: true
Duplicate of this bug: 1496143
Summary: Freeze by using HTML signatures in alternative identities → Freeze by using HTML signatures in alternative identities referencing non-existent image
Summary: Freeze by using HTML signatures in alternative identities referencing non-existent image → Freeze by using HTML signatures referencing non-existent image
Looks like we broke this in bug 1477401. This restores the original code
  offset = fPos - 1;
but takes care not to loop endlessly if fPos==0, which is what the other bug tried to address.
Attachment #9014342 - Flags: review?(acelists)
Comment on attachment 9014342 [details] [diff] [review]

Review of attachment 9014342 [details] [diff] [review]:

OK, while there, please fix the "incompelte" at the start of that loop.
And also it is kinda unusual to have nsAutoString as argument to a function (nsMsgCompose::ReplaceFileURLs). So please change to nsAString if it compiles.
Attachment #9014342 - Flags: review?(acelists) → review+
There is no nsAString::Rfind(). You'd need to use PromiseFlatString() on the argument. I can change it to nsString().
Is it a regression?
Severity: normal → critical
Keywords: hang
Yes, see comment #3.
Blocks: 1477401
Keywords: regression
Thanks, fixed the typo and made it nsString.
Attachment #9014342 - Attachment is obsolete: true
Attachment #9014596 - Flags: review+
Comment on attachment 9014596 [details] [diff] [review]
1495698-hang-non-existent-image.patch (v2)

Review of attachment 9014596 [details] [diff] [review]:

What is the 'hand' in the commit message? Typo?
Pushed by
Fix hang when HTML signature references non-existent image. r=aceman
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 64.0
Attachment #9014596 - Flags: approval-comm-esr60+
Attachment #9014596 - Flags: approval-comm-beta+
Duplicate of this bug: 1503539
Duplicate of this bug: 1503520
You need to log in before you can comment on or make changes to this bug.