Projects

Ticket #544 (closed defect: fixed)

Opened 2 years ago

Last modified 23 months ago

NSBigMutableString#tr crashes

Reported by: vincent.isambart@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.6
Component: MacRuby Keywords:
Cc:

Description

Calling NSBigMutableString#tr makes MacRuby crash if the string is not empty.

NSBigMutableString is for instance the class of the value returned by NSTextField#string.

To reproduce the bug: macruby -e "NSBigMutableString.stringWithString('1').tr('a','b')"

Change History

Changed 2 years ago by martinlagardette@…

In string.c:str_charset_find:2901, the following debug:

    printf("CFStringRef len: %ld\n", CFStringGetLength(str));
    CFShowStr(str);

Shows this for an NSMutableString:

$ ./miniruby -e "NSMutableString.stringWithString('abcd').tr('a','b')"
CFStringRef len: 4

Length 4
IsEightBit 1
HasLengthByte 1
HasNullByte 1
InlineContents 0
Allocator SystemDefault
Mutable 1
CurrentCapacity 32
DesiredCapacity 32
Contents 0x20004d9e0

But it shows this for an NSBigMutableString:

$ ./miniruby -e "NSBigMutableString.stringWithString('abcd').tr('a','b')"
CFStringRef len: 8590253120
This is an NSString, not CFString
unknown: [BUG] Segmentation fault

Changed 23 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from MacRuby 0.5 to MacRuby 0.6

Should be fixed in trunk.

Note: See TracTickets for help on using tickets.