Closed Bug 707440 Opened 13 years ago Closed 13 years ago

Crash [@ CFStringGetLength ] when pressing ⌘ + ⇧ + 2 while using Japanese keyboard layout

Categories

(Camino Graveyard :: Accessibility, defect)

1.9.2 Branch
x86
macOS
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: contact, Unassigned)

Details

Crash Data

Camino crashes when I press ⌘ + ⇧ + 2. (I have a French keyboard so 2 is above é, I don't know if it matters.)
I don't know what this shortcurt is supposed to do, I did not find it in the menus or the system prefs.
I am using ⌘ + ⇧ + 1 to switch keyboard layouts so this is really annoying.

Here a some crash logs :
https://crash-stats.mozilla.com/report/index/5674d509-0015-4169-99a1-f2c0c2111203
https://crash-stats.mozilla.com/report/index/09ff92e8-0950-4d45-a822-ea0702111203
https://crash-stats.mozilla.com/report/index/19305457-9daa-4151-aaec-f895c2111203
Oh, I just noticed that it happens only when I am using a Japanese keyboard layout (hiragana, katakana, etc).
But I did not find this shortcut in Kotoeri.
I'm pretty sure this is a Cocoa Widgets bug.

It looks to me like the string creation on line 4113 of nsChildView.mm

http://hg.mozilla.org/releases/mozilla-1.9.2/annotate/575262e41103/widget/src/cocoa/nsChildView.mm#l4113

can fail for undetermined reasons, and nsChildView isn't checking to ensure that string creation succeeded before using the string.

nsChildView should ensure string creation succeeds, and we should also figure out why that call is failing in this specific case, too.

Josh, does that sound about right?

(I'd confirm this, but I don't think I can attempt to reproduce it, since I don't have any Jp keyboard layouts installed on my system any more.)
Summary: Crash when pressing ⌘ + ⇧ + 2 → Crash [@ CFStringGetLength ] when pressing ⌘ + ⇧ + 2 while using Japanese keyboard layout
Is that 10.4.x only ?
I can't reproduce this on 10.6.8.
I can't reproduce on 10.5.8, either, but that doesn't surprise me at all; it's been pretty common over the years to see crashes inside system functions on 10.4 and not elsewhere.
Crash Signature: [@ CFStringGetLength ]
Pierre, if you're set up to build, try making yourself a custom build with the following fix in |KeyTranslateToUnicode| in nsChildView.mm.

Change:

  CFStringRef str =
    ::CFStringCreateWithBytes(kCFAllocatorDefault, buf, len,
                              (CFStringEncoding)aEncoding, false);
  ch = ::CFStringGetLength(str) == 1 ?
         ::CFStringGetCharacterAtIndex(str, 0) : 0;
  ::CFRelease(str);


to read:

  CFStringRef str =
    ::CFStringCreateWithBytes(kCFAllocatorDefault, buf, len,
                              (CFStringEncoding)aEncoding, false);
  if (str) {
    ch = ::CFStringGetLength(str) == 1 ?
           ::CFStringGetCharacterAtIndex(str, 0) : 0;
  }
  ::CFRelease(str);
I have removed OSX from my computer (and uses only Linux now) so I can not build Camino anymore, sorry.
philippe, you don't happen to have a 10.4 system and French keyboard around that you can test with, do you?
(In reply to Chris Lawson from comment #7)
> philippe, you don't happen to have a 10.4 system and French keyboard around
> that you can test with, do you?

Nope, I don't have any of those (anymore) – and I don't known anybody who could test
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
[7:41pm] <cl> phiw: you don't have access to a 10.4 machine, do you?
[7:42pm] <cl> (and a French keyboard)
[7:46pm] <phiw> no I don't have any of that (anymore)
[7:47pm] <cl> shoot.
[7:48pm] <cl> i'm sure no one in Core cares
[7:48pm] <cl> so in that case, i'm tempted to RESOLVED WONTFIX it

Absent anyone who can test my theoretical fix, or Core giving a crap about it, there we go.
You need to log in before you can comment on or make changes to this bug.