cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Benoit (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CB-12466) libc++abi.dylib: terminating with uncaught exception of type std::logic_error: basic_string::_S_construct NULL not valid
Date Fri, 17 Feb 2017 15:20:41 GMT

     [ https://issues.apache.org/jira/browse/CB-12466?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mike Benoit closed CB-12466.
----------------------------
    Resolution: Invalid

We discovered the real cause, turns out we had some code trying to force the UTF8 error message
to ASCII incorrectly in our logging class. 

The crash dump was throwing us off, sorry for the noise. 

> libc++abi.dylib: terminating with uncaught exception of type std::logic_error: basic_string::_S_construct
NULL not valid
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CB-12466
>                 URL: https://issues.apache.org/jira/browse/CB-12466
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Geolocation
>    Affects Versions: 6.3.0
>         Environment: iOS v9.3.5
>            Reporter: Mike Benoit
>            Priority: Critical
>
> We were running into strange crashes on a WIFI only iPad Mini running iOS v9.3.5 when
WIFI was disabled, the error was:
> libc++abi.dylib: terminating with uncaught exception of type std::logic_error: basic_string::_S_construct
NULL not valid
> We eventually traced it back to the following code, that only crashed when the error
message returned from the OS contained a special character. See the comments where we force
the error message to the one returned by the OS with a special character vs. a test message
without that one character.
> - (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error
> {
>     NSLog(@"locationManager::didFailWithError %@", [error localizedFailureReason]);
>     CDVLocationData* lData = self.locationData;
>     if (lData && __locationStarted) {
>         // TODO: probably have to once over the various error codes and return one of:
>         // PositionError.PERMISSION_DENIED = 1;
>         // PositionError.POSITION_UNAVAILABLE = 2;
>         // PositionError.TIMEOUT = 3;
>         NSUInteger positionError = POSITIONUNAVAILABLE;
>         if (error.code == kCLErrorDenied) {
>             positionError = PERMISSIONDENIED;
>         }
>         
>         // Issue #1279 -  seems  cordova framework  does  not support  characer ’ (Alt
+ 0180)        
>         NSString *errorMessage = @"The operation couldn’t be completed. (kCLErrorDomain
error 0.)"; //App crashes
>         //NSString *errorMessage = @"The operation couldn't be completed. (kCLErrorDomain
error 0.)"; //App does not crash
>         //[self returnLocationError:positionError withMessage:[error localizedDescription]];
>         [self returnLocationError:positionError withMessage:errorMessage];
>     }
>     if (error.code != kCLErrorLocationUnknown) {
>       [self.locationManager stopUpdatingLocation];
>       __locationStarted = NO;
>     }
> }
> We were not able to replicate this issue on iOS v10+ though, however it did seem to be
somewhat timing related as to when that specific error message was returned and therefore
causes the crash.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message