crash in dosprintf when you enable logging nsIMM32HandlerWidgets

RESOLVED FIXED in Firefox 42

Status

()

Core
Widget: Win32
--
critical
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

({crash, inputmethod, regression})

Trunk
mozilla43
x86
Windows NT
crash, inputmethod, regression
Points:
---

Firefox Tracking Flags

(firefox41 unaffected, firefox42+ fixed, firefox43+ fixed)

Details

(crash signature)

Attachments

(1 attachment)

This bug was filed from the Socorro interface and is 
report bp-3b4a98c8-1034-4d94-85dd-ffe912150818.
=============================================================

Crash at: mozilla::widget::IMMHandler::GetCharacterRectOfSelectedTextAt(nsWindow*, unsigned int, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits>&, mozilla::WritingMode*)
http://hg.mozilla.org/mozilla-central/annotate/a6eeb28458fd/widget/windows/IMMHandler.cpp#l2171

I failed to merge the two logging code at bug 1186015.

>   1.2356 -      MOZ_LOG(gIMM32Log, LogLevel::Info,
>   1.2357 -        ("IMM32: GetCharacterRectOfSelectedTextAt, aOffset=%lu, SUCCEEDED\n",
>   1.2358 -         aOffset));
>   1.2359 -      MOZ_LOG(gIMM32Log, LogLevel::Info,
>   1.2360 -        ("IMM32: GetCharacterRectOfSelectedTextAt, "
>   1.2361 +      MOZ_LOG(gIMMLog, LogLevel::Error,
>   1.2362 +        ("IMM: GetCharacterRectOfSelectedTextAt, FAILED, due to "
>   1.2363           "aCharRect={ x: %ld, y: %ld, width: %ld, height: %ld }, "
>   1.2364           "charRect.GetWritingMode()=%s",
>   1.2365 -         aCharRect.x, aCharRect.y, aCharRect.width, aCharRect.height,
>   1.2366 +         aOffset, aCharRect.x, aCharRect.y, aCharRect.width, aCharRect.height,
>   1.2367           GetWritingModeName(charRect.GetWritingMode()).get()));

We should fix this simple regression both on m-c and aurora.
Created attachment 8649746 [details] [diff] [review]
Fix mismatch of printf style string and following arguments of MOZ_LOG() in IMMHandler::GetCharacterRectOfSelectedTextAt()

I forgot to add aOffset=%d into the string and the log isn't caused by Error, it's logging the result.
Attachment #8649746 - Flags: review?(m_kato)
Oops, it should be %u.
Comment on attachment 8649746 [details] [diff] [review]
Fix mismatch of printf style string and following arguments of MOZ_LOG() in IMMHandler::GetCharacterRectOfSelectedTextAt()

Review of attachment 8649746 [details] [diff] [review]:
-----------------------------------------------------------------

Yes, we should use %u instead.
Attachment #8649746 - Flags: review?(m_kato) → review+
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/55214e2237a3708dbbdf467f34d2b40d2d4792e3
changeset:  55214e2237a3708dbbdf467f34d2b40d2d4792e3
user:       Masayuki Nakano <masayuki@d-toybox.com>
date:       Thu Aug 20 11:40:14 2015 +0900
description:
Bug 1196124 Fix mismatch of printf style string and following arguments of MOZ_LOG() in IMMHandler::GetCharacterRectOfSelectedTextAt() r=m_kato
https://hg.mozilla.org/mozilla-central/rev/55214e2237a3
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox43: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Masayuki - do you want to request uplift to 42? 

Tracking since this is a regression, though it's a minor issue.
tracking-firefox42: ? → +
tracking-firefox43: ? → +
Comment on attachment 8649746 [details] [diff] [review]
Fix mismatch of printf style string and following arguments of MOZ_LOG() in IMMHandler::GetCharacterRectOfSelectedTextAt()

Approval Request Comment
[Feature/regressing bug #]: bug 1186015
[User impact if declined]: some IME developers and testers may hit this bug when they try to log IMMHandler's behavior.
[Describe test coverage new/current, TreeHerder]: I tested manually because this is a logging code's bug, not tested on automated tests.
[Risks and why]: Low because logging doesn't work in daily use.
[String/UUID change made/needed]: nothing.
Attachment #8649746 - Flags: approval-mozilla-aurora?
Comment on attachment 8649746 [details] [diff] [review]
Fix mismatch of printf style string and following arguments of MOZ_LOG() in IMMHandler::GetCharacterRectOfSelectedTextAt()

Early in the aurora cycle, why not taking it!
Attachment #8649746 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.