Closed Bug 2068022 Opened 2 months ago Closed 2 months ago

PROCESS-CRASH - application crashed [@ strlen] | comm/mail/components/compose/test/browser/browser_sendMessage_progress.js

Categories

(Thunderbird :: Message Compose Window, defect)

defect

Tracking

(thunderbird_esr153 unaffected, thunderbird156 fixed, thunderbird157 fixed)

RESOLVED FIXED
157 Branch
Tracking Status
thunderbird_esr153 --- unaffected
thunderbird156 --- fixed
thunderbird157 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: mkmelin)

References

(Regression)

Details

(5 keywords, Whiteboard: [collect_confirm_failure])

Crash Data

Attachments

(3 external files)

Handle mime_set_url_part() returning null, which it does when the url doesn't parse.

For early returns, there were also leaks here (id, id_imap, tmpURL and the *data array).

mimemoz2.cpp (GenerateAttachmentData)

  • PR_FREEIF(urlSpec) before the reassignment, so the mime_external_attachment_url() allocation isn't dropped when the URL isn't http/https/file.
  • PR_FREEIF(urlSpec) right after NS_NewURI consumes it.

mimemrel.cpp (MimeMultipartRelated_output_child_p) - the URI-rewriting block moved into a new BuildRelatedPartUrl() helper, like for the crash-fix patch:

  • The part = strdup(spec.get()) overwrite is gone; part is freed once, right after the helper consumes it, and the result lives in an nsAutoCString. The temp/part aliasing dance at the end (dead code - temp was assigned after the overwrite, so the pointers were always equal) is deleted with it.
  • The four NS_ENSURE_SUCCESS(rv, true) early returns are now inside the helper, so the single NS_FAILED path in the caller frees both part and absolute.
  • char* name from MimeHeaders_get_name() (or the ct fallback from MimeHeaders_get()) was never freed - it leaked once per embedded related part, same as the URL. Now freed after params.Set("filename").
  • absolute was also leaked whenever partnum was empty or part came back null - only PL_HashTableAdd takes ownership.

MimeHashValue's constructor now takes const char* so it accepts spec.get().

Status: NEW → ASSIGNED

(must be a recent regression, presumably exposed from the use proper url parsing work)

Target Milestone: --- → 157 Branch

Pushed by edicharry@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/522ba276a54f
Fix crash @ ProcessBodyAsAttachment(). r=benc
https://hg.mozilla.org/comm-central/rev/083cd3ab7a23
Fix mime_set_url_part() related leaks. r=BenC
https://hg.mozilla.org/comm-central/rev/0b07d3db7954
Remove dead code in MimeMultipartAppleDouble_parse_begin. r=benc

Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED

From crash stats, looks like 156 was affected.

Comment on attachment 9633254 [details]
Bug 2068022 - Fix crash @ ProcessBodyAsAttachment(). r=#thunderbird-back-end-reviewers

Uplift Approval Request

  • Please state case for uplift consideration and ensure bug severity is set: Top crash
    (Would take all three patches)
  • User impact if declined: May crash
  • Is this code covered by automated tests?: Unknown
  • Has the fix been verified in Daily?: Yes
  • Has the fix been verified in Beta?: Yes
  • Needs manual test from QA?: Yes
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): It's mime. But no regressions reported
  • Does the fix cause any migrations to be skipped?: No
  • String changes made/needed:
Attachment #9633254 - Flags: approval-comm-beta?
Crash Signature: [@ strlen] → [@ strlen | nsCharTraits<T>::length]
Attachment #9633254 - Flags: approval-comm-beta? → approval-comm-release?
Regressed by: 2066300

Comment on attachment 9633254 [details]
Bug 2068022 - Fix crash @ ProcessBodyAsAttachment(). r=#thunderbird-back-end-reviewers

[Triage Comment]
Approved for release

Attachment #9633254 - Flags: approval-comm-release? → approval-comm-release+
Keywords: topcrash

Comment on attachment 9633255 [details]
Bug 2068022 - Fix mime_set_url_part() related leaks. r=#thunderbird-back-end-reviewers

[Triage Comment]
Approved for release

Attachment #9633255 - Flags: approval-comm-release+

Comment on attachment 9633256 [details]
Bug 2068022 - Remove dead code in MimeMultipartAppleDouble_parse_begin. r=#thunderbird-back-end-reviewers

[Triage Comment]
Approved for release

Attachment #9633256 - Flags: approval-comm-release+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: