bugsnag / bugsnag-cocoa Goto Github PK
View Code? Open in Web Editor NEWBugSnag error monitoring & exception reporter for iOS, macOS, tvOS and watchOS
Home Page: https://docs.bugsnag.com/platforms/ios
License: MIT License
BugSnag error monitoring & exception reporter for iOS, macOS, tvOS and watchOS
Home Page: https://docs.bugsnag.com/platforms/ios
License: MIT License
The severity is not being sent in some situations
Installing Bugsnag (4.0.6)
[!] Error installing Bugsnag
[!] /usr/bin/git submodule update --init
Submodule 'KSCrashModule' ([email protected]:bugsnag/KSCrash.git) registered for path 'KSCrashModule'
Cloning into 'KSCrashModule'...
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
fatal: reference is not a tree: 76836a36603fee7475731c8826b62dc1a6c47441
Unable to checkout '76836a36603fee7475731c8826b62dc1a6c47441' in submodule path 'KSCrashModule'
When I run pod install, I ran into this error and this happens a lot. When I change Bugsnag to version 4.0.3, it installs without any error.
Anyone knows what am I doing wrong or what's wrong?
Pods/Bugsnag/KSCrash/Source/KSCrash/Recording/KSCrashReport.c:1996:67: error: conflicting types for 'time'
242 writer->addIntegerElement(writer, KSCrashField_Timestamp, time(NULL));
243 ^
244 In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/include/sys/_structs.h:29:
245 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/include/time.h:116:8: note: previous declaration is here
246 time_t time(time_t *);
247 ^
248 1 error generated.
When determining the hw.machine system information, the input string buffer size is left uninitialised (so it contains random data). It can trigger a false ENOMEM error. (And was it in some other context where the system info could change between buffer alloc and read it could also cause buffer overflow.)
This piece of code:
size_t machineCStringLen;
if (0 == sysctl(mib, mibLen, machineCString, &machineCStringLen, NULL, 0)
&& machineCStringLen <= machineCStringLenEstimate) {
machine = [[NSString alloc] initWithCString:machineCString encoding:NSUTF8StringEncoding];
}
Should probably be like:
size_t machineCStringLen = machineCStringLenEstimate;
if (0 == sysctl(mib, mibLen, machineCString, &machineCStringLen, NULL, 0)) {
machine = [[NSString alloc] initWithCString:machineCString encoding:NSUTF8StringEncoding];
}
machineCStringLen
to correct initial valuemachineCStringLen <= machineCStringLenEstimate
comparison as it is redundant (when string size is larger than buffer ENOMEM is returned, if it's smaller, it shouldn't matter)Disclaimer: The changes I'm proposing haven't been run through a compiler nor tested. I just noticed this when looking over the code in Github.
We've got an issue where some of the time, when we're firing Notify items, there's a crash in the OS's backtrace() flow. The crash on notify is in:
KSCrashSentry_User.c
, kscrashsentry_reportUserException
, line 70: callstackCount = backtrace((void**)callstack, callstackCount);
We don't need the stack; in fact, we don't need anything other than the Notify item's bare minimum.
An example is here, if the dev team has access to our team's Bugsnags: https://bugsnag.com/plangrid/plangrid-ios/errors/550ac40e7c992b99ead0c2cb?event_id=553fcd69548678c57afed980
If not, I can send a copy of the relevant data; and I have attached a screenshot of the stack in case that proves to be helpful.
The underlying issue may be an Apple bug, but as there's no particular reason to expect the backtrace bug to be addressed (though we are filing it in Radar), we'd really like to be able to work around it so that we don't get spurious crashes.
To reproduce:
I'm currently unable to install Bugsnag via cocoapods, due to a problem with the private submodule KSCrashModule
.
pod install
Analyzing dependencies
CocoaPods 0.37.2 is available.
To update use: `sudo gem install cocoapods`
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Downloading dependencies
Installing Bugsnag (4.0.6)
[!] Error installing Bugsnag
[!] /usr/bin/git submodule update --init
Submodule 'KSCrashModule' ([email protected]:bugsnag/KSCrash.git) registered for path 'KSCrashModule'
Cloning into 'KSCrashModule'...
fatal: reference is not a tree: 76836a36603fee7475731c8826b62dc1a6c47441
Unable to checkout '76836a36603fee7475731c8826b62dc1a6c47441' in submodule path 'KSCrashModule'
Steps to reproduce:
Podfile
pod install
Podfile
pod install
I'm a bit confused by Bugsnag, because it doesn't seem to show the line numbers in the crash logs.
I was using Crashlytics previously, and it was able to show me the method names and line numbers for a crash. But I'm not getting the line numbers for Bugsnag in the crash reports.
Apparently I can upload the dsym to get this information. I'm not really sure about that, because after I ran the suggested script, it still didn't show me any line numbers in the crash report. (and it says "Still Missing" afterwards, which I don't get - maybe it's talking about other targets?).
Anyway why is it that out-of-the-box Crashlytics can show the line numbers, but Bugsnag can't? I don't have to upload any such dsym data manually for Crashlytics...
Or could there be something wrong with my Bugsnag configuration? (I installed version 4.1.0 via Cocoapods...)
Flag when an app opens for the first time after it previously crashed. For example, the flag could be used as a way to prompt the user for help and also to avoid asking the user to rate an app if it just crashed.
I'm attempting to install Bugsnag in an application using Swift 2. I have installed the library through Cocoapods and adding the import to my bridging header:
#ifndef GoDriver_Bridging_Header_h
#define GoDriver_Bridging_Header_h
#import "Bugsnag/Bugsnag.h"
#endif /* GoDriver_Bridging_Header_h */
I then attempted to initialize Bugsnag in my AppDelegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
Bugsnag.startBugsnagWithApiKey("...")
return true
}
But Xcode errors with Use of unresolved identifier 'Bugsnag'
on the line in AppDelegate.
In my opinion, Bugsnag should have documentation for using the notifier with Swift as well as Objective-C applications.
I installed Bugsnag Cocoa using the Pod method. It seems to work fine, but the line numbers in the reports are always zero. For example:
/Users/thomas/Library/Developer/Xcode/DerivedData/MyApp-daxwpuwazlwktwbeipjylrhsqjps/Build/Products/Debug/MyApp.app/Contents/MacOS/MyApp:0
+[Bugsnag notify:]
/Users/thomas/Library/Developer/Xcode/DerivedData/MyApp-daxwpuwazlwktwbeipjylrhsqjps/Build/Products/Debug/MyApp.app/Contents/MacOS/MyApp:0
-[AppDelegate applicationDidFinishLaunching:]
Note the :0
at the end.
I'm using revision 3317cf2, XCode 6.1.1, Yosemite 10.10.1, and targeting OS X 10.10.
Do you know how what might go wrong?
As many users' applications support only iOS 7 or 8+, look into the usages of deprecated APIs and resolve where possible, as we may get a few performance gains as well as less future breakage.
This would be a major release (5.0.x), though we would continue to support the 4.1.x release line for future development for users supporting older versions of iOS/OS X.
The project was working well, I ran pod update and then I got this error despite the file is in my project folder.
/Users/XXX/Desktop/XXXX/XXX-ios-client/Pods/Headers/Public/Bugsnag/BugsnagConfiguration.h:30:9: 'KSCrashReportWriter.h' file not found
Rubymotion support is really close, there just seems to be something slightly wrong with the actual exception type message
Currently all exceptions are marked as EXC_BAD_ACCESS
and, all error messages say
Attempted to dereference garbage pointer 0x15497beb8.
or
Attempted to dereference null pointer.
It would be great for this to include at very least the exception class, but if possible, the exception message.
It would be great to be given support to compile the framework using Carthage! :D
You do not need much work, this tool is generic and is designed to build frameworks
Right now does not work:
# carthage update
*** Cloning bugsnag-cocoa
*** Downloading bugsnag-cocoa at "v4.0.9"
*** Checking out bugsnag-cocoa at "v4.0.9"
*** xcodebuild output can be found in /var/folders/8l/lvcx_wld699crfslff46mxrm0000gp/T/carthage-xcodebuild.sbJOb6.log
*** Building scheme "Bugsnag" in Bugsnag.xcodeproj
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script /Users/sebastian.varela/Library/Developer/Xcode/DerivedData/Bugsnag-ccxagkjsadhqelhbacgnucprwrsh/Build/Intermediates/Bugsnag.build/Release-iphoneos/Bugsnag.build/Script-938594AD1A2405560082E445.sh
Check dependencies
(2 failures)
/Users/sebastian.varela/repo/ios-lib-crashreporting/Carthage/Checkouts/bugsnag-cocoa/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
/Users/sebastian.varela/repo/ios-lib-crashreporting/Carthage/Checkouts/bugsnag-cocoa/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
/Users/sebastian.varela/repo/ios-lib-crashreporting/Carthage/Checkouts/bugsnag-cocoa/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
/Users/sebastian.varela/repo/ios-lib-crashreporting/Carthage/Checkouts/bugsnag-cocoa/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'
/Users/sebastian.varela/repo/ios-lib-crashreporting/Carthage/Checkouts/bugsnag-cocoa/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
/Users/sebastian.varela/repo/ios-lib-crashreporting/Carthage/Checkouts/bugsnag-cocoa/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
/Users/sebastian.varela/repo/ios-lib-crashreporting/Carthage/Checkouts/bugsnag-cocoa/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
/Users/sebastian.varela/repo/ios-lib-crashreporting/Carthage/Checkouts/bugsnag-cocoa/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
fatal error: lipo: /Users/sebastian.varela/Library/Developer/Xcode/DerivedData/Bugsnag-ccxagkjsadhqelhbacgnucprwrsh/Build/Products/Release/libBugsnag-Device.a and /Users/sebastian.varela/Library/Developer/Xcode/DerivedData/Bugsnag-ccxagkjsadhqelhbacgnucprwrsh/Build/Products/Release/libBugsnag-Simulator.a have the same architectures (armv7) and can't be in the same fat output file
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “372ZUL2ZB7” were found.
A shell task failed with exit code 65
I've removed & installed bugsnag again after #92, but the error persist. I've also cleaned project.
Here my podfile
There doesn't seem to be a way to set the groupingHash on iOS.
Looking at KSCrash the os version field only works on iOS.
The addAttribute documentation has a typo.
@param value It's value.
should be:
@param value Its value.
Looks like KSCrash's onCrash handler is being used up for BugSnag to do its thing. We would like a way to add another handler for recording errors through our own custom tooling.
It seems like breadcrumbs logged with Bugsnag+leaveBreadcrumbWithMessage:
is not included when logging uncaught nsexceptions.
Root cause seems to be that the breadcrumbs are only added to configuration.metaData
in notify:withData:atSeverity:atDepth:
which only seems to be used for manually reported exceptions.
When KSCrash calls serialize_bugsnag_data
(as it's onCrash
callback) for other exception types breadcrumbs will not be in the meta data struct.
Manually hacking the situation by calling [[Bugsnag performSelector:@selector(notifier)] performSelector:@selector(serializeBreadcrumbs)];
after each call to leaveBreadcrumbWithMessage
seems to work around the issue.
we used to be able to do:
[[Bugsnag configuration] setAppVersion:@"custom version9999";
but that functionality seems to be gone...how can we get it back??
Thanks,
Michael
The framework ZIP archives that are downloadable for iOS and OS X do not have the sym links, instead they have copies of the files which makes my code signing fail, among other problems.
All OS X and iOS frameworks have lots of symlinks, as per https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html
Also it seems that downloading the source and building the frameworks seems to make the frameworks correctly, so it looks like an issue where your ZIP step is following the symlinks instead of leaving them alone.
KSCrash is it's own independent CocoaPod, people are less likely to get class collisions in their apps. If they are including both ( I am in the tests for ARAnalytics )
please add tvos support to podspec
I thought I should share this with you: http://landonf.bikemonkey.org/2011/09/index.html
It's an article written by Landon Fuller, the author of the PLCrashReporter library. He explains why a signal handler should not execute any objective-c code, or do any networking. He says that there is little that can be done safely in a signal handler.
Didn't you experience any problem with your signal handler?
My team and I were considering writing our own crash reporter as well, but ended up using PLCrashReporter instead.
Cheers.
since fixing the reachability conflicts, the tag/podspec haven't been updated. so pod install still produces reachability conflicts.
and since you bundle your own namespaced reachability pod (which i think is good :) you shouldn't need to list Reachability as a dependency in your podspec... that pulls in the vanilla Reachability pod resulting in duplicate code.
i think you can remove this line:
https://github.com/bugsnag/bugsnag-cocoa/blob/master/Bugsnag.podspec#L80
would love to see those updated in 3.1.1 pod, as at the moment we're maintaining 3.1.0.fork on our own repo
So in our big project we have a method called "mergeWith:" and we can´t rename our method name(s) quickly. And i see bugsang is very small ;) . SDWebImage adds, for example, the prefix "sd".
The context field is no longer set in the ios notifier
Can't run Bugsnag.
I've added Bugsnag via Cocoapods and got several error messages "Duplicate interface definition for class 'KSCrashReportFilter..." in KSCrash target.
I have YandexMetrica (https://github.com/yandexmobile/metrica-sdk-ios) in my project which also uses KSCrash. In Podfile.lock YandexMetrica's dependences explicitly written:
I think Bugsnag pod should have similar dependences in its settings to run with other pods such as YandexMetrica which use same subpods.
Disk size reporting seems to be edited out since version 3.1.3, and Bugsnag site shows 0 bytes free disk for all crashes
Projects with significant amounts of Swift source code have non-descriptive stacktrace output on Bugsnag when checking the value of Optionals. The output generally contains EXC_BREAKPOINT
and not much else. Investigate whether this a library or language error.
The README includes a code snippet on how to configure Bugsnag:
config.notifyURL = [NSURL URLWithString:@"https://bugsnag.example.com/"];
This is not possible because notifyURL is a read-only property.
It confuses lots of people.
Could you add a method which forces a crash? That would be handy for when testing.
Apologies if there is already such a thing, but I couldn't see it.
Bitcode is not supported, so I am unable to build with Bitcode enabled.
To reproduce:
1.) Install Bugsnag without cocoapods
2.) Try to build with Bitcode enabled (Project/Build Settings -> Search for Bitcode)
I'm on version 7.1.1 of XCode, supporting iOS 8.1 and up. If you need any more information let me know. Thanks
Bugsnag has a cool breadcrumb feature to help determine the sequence of events leading up to the crash:
https://bugsnag.com/blog/introducing-mobile-breadcrumbs
Breadcrumbs have been available on Android since December, but they are absent from iOS. It would be great if iOS developers could also start logging breadcrumbs.
NSInvalidArgumentException -[BugsnagSink orientationChanged:]: unrecognized selector sent to instance 0x166bd570
Frameworks/CoreFoundation.framework/CoreFoundation:0 <redacted>
/usr/lib/libobjc.A.dylib:0 objc_exception_throw
Frameworks/CoreFoundation.framework/CoreFoundation:0 <redacted>
Frameworks/CoreFoundation.framework/CoreFoundation:0 <redacted>
Frameworks/CoreFoundation.framework/CoreFoundation:0 CF_forwarding_prep_0
Frameworks/CoreFoundation.framework/CoreFoundation:0 <redacted>
Frameworks/CoreFoundation.framework/CoreFoundation:0 CFXNotificationPost
Frameworks/Foundation.framework/Foundation:0 <redacted>
Frameworks/UIKit.framework/UIKit:0 <redacted>
Frameworks/UIKit.framework/UIKit:0 <redacted>
Frameworks/UIKit.framework/UIKit:0 <redacted>
Frameworks/UIKit.framework/UIKit:0 <redacted>
PrivateFrameworks/GraphicsServices.framework/GraphicsServices:0 <redacted>
PrivateFrameworks/GraphicsServices.framework/GraphicsServices:0 <redacted>
Frameworks/CoreFoundation.framework/CoreFoundation:0 <redacted>
Frameworks/CoreFoundation.framework/CoreFoundation:0 <redacted>
Frameworks/CoreFoundation.framework/CoreFoundation:0 <redacted>
Frameworks/CoreFoundation.framework/CoreFoundation:0 CFRunLoopRunSpecific
Frameworks/CoreFoundation.framework/CoreFoundation:0 CFRunLoopRunInMode
PrivateFrameworks/GraphicsServices.framework/GraphicsServices:0 GSEventRunModal
Frameworks/UIKit.framework/UIKit:0 UIApplicationMain
healthjoy/main.m:18:0 main
/usr/lib/system/libdyld.dylib:0 <redacted>
Most likely, it has been fixed (bugsnag/bugsnag-unity#6) but not adopted by segment.io
Please help.
binaries share the same codesign path:
/Contents/Frameworks/BugsnagOSX.framework/Versions/Current
Binaries:
/Contents/Frameworks/BugsnagOSX.framework/BugsnagOSX
/Contents/Frameworks/BugsnagOSX.framework/Versions/Current/BugsnagOSX
This can happen if your build process copies frameworks by following symlinks
Frameworks should use symlink , but bugsnag.framework downloaded from release has multiple files .
Using Xcode 6.3.2, compiling Bugsnag (4.0.7) shows the following warning:
In file included from /Users/.../Pods/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/KSObjC.c:29:
/Users/.../Pods/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:122:5: warning: 'Cache' is deprecated: first deprecated in iOS 2.0 [-Wdeprecated-declarations]
Cache cache;
^
/Users/.../Pods/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/KSObjCApple.h:51:28: note: 'Cache' has been explicitly marked deprecated here
typedef struct objc_cache *Cache;
^
1 warning generated.
This doesn't seem to be a problem. An easy fix would be to add the a #pragma to disable the warning.
It seems, in that case there are two different instances of Reachability. Bugsnag will try to attach network information:
[event addAttribute:@"Network" withValue:self.networkReachability toTabWithName:@"device"];
but it will fail, because if the other Reachability instance is used, it has no currentReachabilityString.
This exception will continue to be thrown:
[Reachability currentReachabilityString]: unrecognized selector sent to instance
Until the app crashes.
We post a notification when a network request fails and our notification handler reports the failure to Bugsnag. Occasionally we end up with a crash while trying to report an error to Bugsnag:
Pods/Bugsnag/KSCrash/Source/KSCrash/Recording/Sentry/KSCrashSentry_User.c:73:26 kscrashsentry_reportUserException
Pods/Bugsnag/KSCrash/Source/KSCrash/Recording/KSCrash.m:382:5 -[KSCrash reportUserException:reason:lineOfCode:stackTrace:terminateProgram:]
Pods/Bugsnag/Source/Bugsnag/BugsnagNotifier.m:122:5 -[BugsnagNotifier notify:withData:atSeverity:atDepth:]
Pods/Bugsnag/Source/Bugsnag/Bugsnag.m:90:5 +[Bugsnag notify:withData:]
It's not very frequent (we've had 16 of these reports since June), but I thought we'd pass this along in case anyone had any thoughts.
I was on a HipChat room with some of your technical folks and they had mentioned adding a rake task for this. Has this been implemented?
Or it will be nice to have this info on your website.
Hi Bugsnag team.
I'm trying to upload the dSYM of my project from my Mac but I failed every time that I tried.
curl https://upload.bugsnag.com/ -F [email protected]
curl -o /Users/Pedro/Desktop/MyApp.app.dSYM 'https://bugsnag.com/services/upload/xxxxxxxx' | ruby
curl 'https://bugsnag.com/services/upload/xxxxxxxx' -F dsym='@/Users/Pedro/Desktop/MyApp.app.dSYM'
xxxxxxxx
is the key of my app.
Do you know any software or any code that help me to resolve it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.