Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

NSRangeException from NSTaggedPointerString on iOS 9 DP #120

Closed
josefdlange opened this issue Jul 3, 2015 · 11 comments
Closed

NSRangeException from NSTaggedPointerString on iOS 9 DP #120

josefdlange opened this issue Jul 3, 2015 · 11 comments
Assignees
Labels

Comments

@josefdlange
Copy link

Hi there,

Loving using Card.IO. What a stellar library for the world to use. I am running iOS 9 DP and finding an issue stemming from Card.IO. On iOS 8 devices, there seems to be no issue, but on iOS 9 I see the following exception rise from inside of Card.IO. Because it's a compiled Objective-C++ static library, I don't have much visibility into the issue itself, but I can tell you that it happens after I create a CardIOPaymentViewController but before it makes it onto the screen. My best guess is something inside of - [CardIOViewController viewDidLoad] may be at fault, but I don't get a whole lot of insight from the symbolicated stack.

Let me know how I can help. For now I'm pushing forward on iOS 8-compatible work and will come back to fix this if need be.

2015-07-02 23:56:15.330 XXXXXXX[2883:1208670] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[NSTaggedPointerString getCharacters:range:]: Range {0, 7} out of bounds; string length 6'
*** First throw call stack:
(0x1837b738c 0x197d6bf2c 0x1837b72d4 0x18379e978 0x1836a8984 0x18379f118 0x10017e148 0x1836ef968 0x10017de94 0x10017ea74 0x10017ec1c 0x100152540 0x188d42830 0x188d4254c 0x1890c7484 0x189089ca4 0x18908692c 0x188feb3bc 0x188ff7038 0x188d35018 0x18376e39c 0x18376c114 0x18376c544 0x1836990d0 0x18e613170 0x188daa5f0 0x1001374d8 0x1985aa8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
@dgoldman-pdx
Copy link
Member

@josefdlange thanks for the report!

I don't currently have the Xcode beta on my machine to double-check for myself. But there are only a few uses of NSRange in our code, and based on your well-reported details I'm pretty sure that I see the one responsible here. I'll fix that now.

We'll probably release an updated version of card.io within the next few days, and I'll include this fix. I'll update this issue then, and hopefully you'll be able to confirm that everything is working under iOS 9.

@dgoldman-pdx dgoldman-pdx self-assigned this Jul 3, 2015
dgoldman-pdx pushed a commit to card-io/card.io-iOS-source that referenced this issue Jul 3, 2015
@williamnoto
Copy link

having same issue...

Here's the stack trace if it helps:

2015-07-06 09:55:08.675 heynay[18768:259423] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[NSTaggedPointerString getCharacters:range:]: Range {0, 12} out of bounds; string length 9'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c7f0885 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c19cdf1 objc_exception_throw + 48
2 CoreFoundation 0x000000010c7f07bd +[NSException raise:format:] + 205
3 CoreFoundation 0x000000010c7dc57a -[NSTaggedPointerString getCharacters:range:] + 394
4 CoreFoundation 0x000000010c6c794a CFStringCompareWithOptionsAndLocale + 2970
5 CoreFoundation 0x000000010c7dcecb -[NSTaggedPointerString compare:options:range:locale:] + 219
6 Foundation 0x00000001095fc03f -[NSString compare:options:range:] + 29
7 heynay 0x000000010804b8e9 __52-[CardIOLocalizer localizeString:adaptedForCountry:]_block_invoke + 60
8 CoreFoundation 0x000000010c71e1bb -[NSArray indexOfObject:inSortedRange:options:usingComparator:] + 491
9 heynay 0x000000010804b62c -[CardIOLocalizer localizeString:adaptedForCountry:] + 473
10 heynay 0x000000010804c197 CardIOLocalizedStringWithAlert + 1293
11 heynay 0x000000010804c332 CardIOLocalizedString + 56
12 heynay 0x00000001080369a5 -[CardIODataEntryViewController viewDidLoad] + 258
13 UIKit 0x000000010a0add65 -[UIViewController loadViewIfRequired] + 860
14 UIKit 0x000000010a0ae0b4 -[UIViewController view] + 27
15 UIKit 0x000000010a0fbc87 -[UINavigationController preferredContentSize] + 194
16 UIKit 0x000000010a0861d5 -[UIPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 152
17 UIKit 0x000000010a082634 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 95
18 UIKit 0x0000000109f37e19 _runAfterCACommitDeferredBlocks + 317
19 UIKit 0x0000000109f49777 _cleanUpAfterCAFlushAndRunDeferredBlocks + 95
20 UIKit 0x0000000109f54622 _afterCACommitHandler + 90
21 CoreFoundation 0x000000010c71aa27 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 23
22 CoreFoundation 0x000000010c71a997 __CFRunLoopDoObservers + 391
23 CoreFoundation 0x000000010c71047b __CFRunLoopRun + 1147
24 CoreFoundation 0x000000010c70fd78 CFRunLoopRunSpecific + 488
25 GraphicsServices 0x000000010d362bca GraphicsServices + 52170
26 UIKit 0x0000000109f2c79b UIApplicationMain + 171
27 heynay 0x0000000107b9724f main + 111
28 libdyld.dylib 0x000000010cee2a05 libdyld.dylib + 10757
29 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

@dgoldman-pdx
Copy link
Member

Fixed in Version 5.1.0.

@williamnoto
Copy link

Nice. Thanks.

On Jul 12, 2015, at 8:02 PM, Dave Goldman notifications@github.com wrote:

Closed #120.


Reply to this email directly or view it on GitHub.

@limitdn
Copy link

limitdn commented Oct 16, 2015

having same issue...

Here's the stack trace if it helps:
2015-10-16 11:21:09.889 eSynchrony[1823:591600] WARNING: GoogleAnalytics 3.08 void GAIUncaughtExceptionHandler(NSException ) (GAIUncaughtExceptionHandler.m:49): Uncaught exception: -[NSTaggedPointerString getCharacters:range:]: Range {0, 7} out of bounds; string length 4
2015-10-16 11:21:14.895 eSynchrony[1823:591600] *
* Terminating app due to uncaught exception 'NSRangeException', reason: '-[NSTaggedPointerString getCharacters:range:]: Range {0, 7} out of bounds; string length 4'
*** First throw call stack:
(0x183314f5c 0x197f0bf80 0x183314ea4 0x1832fc4e4 0x1832070d4 0x1832fcc90 0x100514cc8 0x18324d124 0x100514a14 0x10051556c 0x100502994 0x100503b50 0x1004f0d34 0x18886b610 0x18886b194 0x188bfa830 0x188bb9734 0x188bb6294 0x188b14828 0x188b20dc8 0x18885d1c8 0x1832cbc30 0x1832c99d4 0x1832c9e04 0x1831f8dc0 0x18e34c088 0x1888d2f44 0x10009e454 0x1987368b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

@josharian
Copy link
Member

Please open a new issue (referencing this one if you like), and provide the version of card.io you are using as well as the iOS version. Thanks!

@phiren
Copy link

phiren commented Apr 21, 2016

Still crash exist. It works for two cards, but does not work for one card.
Xcode : 7.3
iOS: 9.3.2(13F61)
CardIO Version: 5.3.2
Device: iPhone 5S

Console Log:
2016-04-21 11:48:27.651 Merci[373:54825] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[NSTaggedPointerString substringWithRange:]: Range {2, 2} out of bounds; string length 3'
*** First throw call stack:
(0x18194adb0 0x180faff80 0x18194acf8 0x1819324c4 0x1001c333c 0x1001c2f34 0x186dff030 0x186dff198 0x186dee298 0x186e03c64 0x186b948c4 0x10147d974 0x186aa41e4 0x184436994 0x1844315d0 0x186abb0a4 0x186b69694 0x186b6706c 0x186e443cc 0x186b65c6c 0x186b29bf4 0x186b65a28 0x186aa3a10 0x186aa37ac 0x186aa2d40 0x18227ccc0 0x186aa2bc4 0x186ab0678 0x186baa234 0x186ba9b58 0x186e08830 0x186d5b0c8 0x186d68a80 0x186a9a5a4 0x181900728 0x1818fe4cc 0x1818fe8fc 0x181828c50 0x183110088 0x186b12088 0x1001f904c 0x1813c68b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

Let me know if more info required.

@josharian
Copy link
Member

Any chance you could symbolicate that stack trace, or at least the card.io portion of if?

@phiren
Copy link

phiren commented Apr 23, 2016

Sorry, It is crashing in our code. It works well for my 2 cards, but for one card, it returns nil. So not sure why it does not scan it properly.

@pirrate
Copy link

pirrate commented Sep 22, 2016

May i ask what was the problem and how you fixed that? Because i keep getting strange error of such kind when i am trying to insert a letter "İ" using custom keyboard to Messages and iMessage app. Messages app just crashes and i don`t know what is going on. Googling brought me here. Please share your experience.
"** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSBigMutableString getCharacters:range:]: Range {0, 5} out of bounds; string length 4'"

@josefdlange
Copy link
Author

@pirrate I don't think this is an appropriate thread for your issue. Are you using the Card.IO library and having issue with it? It looks like your issue is entirely unrelated to this library.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants