GithubHelp home page GithubHelp logo

logmatic-ios's People

Contributors

abiaad avatar jeanelie avatar renaudboutet avatar rkrim avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logmatic-ios's Issues

Compiler Warnings

I recently integrated the Logmatic pod into our swift 3 app and I am getting about 4 compiler warnings. The project still runs and logs without problem, but these warnings are rather messy. Do you guys mind taking a look into this?

EXC_BAD_ACCESS KERN_INVALID_ADDRESS (LMLogger.m lines 209 and 230)

We're using Logmatic through CocoaPods, version 1.0.2, in our Swift 3.1 app. Crashlytics by Fabric has reported several crashes traced to Logmatic. Two stack traces are pasted below:


LMLogger.m line 209
-[LMLogger _requestWithLogs:]

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000d409beb8

Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x18cfc8150 objc_msgSend + 16
1  Foundation                     0x18f0ccec0 _writeJSONValue + 96
2  Foundation                     0x18f0cf444 ___writeJSONArray_block_invoke + 144
3  CoreFoundation                 0x18e441e24 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 132
4  CoreFoundation                 0x18e441cb8 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 208
5  Foundation                     0x18f0cec24 _writeJSONArray + 292
6  Foundation                     0x18f0cd080 _writeJSONValue + 544
7  Foundation                     0x18f0cce18 -[_NSJSONWriter dataWithRootObject:options:error:] + 140
8  Foundation                     0x18f0cde20 +[NSJSONSerialization dataWithJSONObject:options:error:] + 348
9  Logmatic                       0x100af828c -[LMLogger _requestWithLogs:] (LMLogger.m:209)
10 Logmatic                       0x100af7f1c -[LMLogger _sendLogs:] (LMLogger.m:185)
11 Logmatic                       0x100af7d64 -[LMLogger _sendPendingLogsAndSync] (LMLogger.m:178)
12 Foundation                     0x18f047760 __NSFireTimer + 88
13 CoreFoundation                 0x18e501a9c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
14 CoreFoundation                 0x18e5017a0 __CFRunLoopDoTimer + 856
15 CoreFoundation                 0x18e501060 __CFRunLoopDoTimers + 244
16 CoreFoundation                 0x18e4fec84 __CFRunLoopRun + 1484
17 CoreFoundation                 0x18e42ed94 CFRunLoopRunSpecific + 424
18 GraphicsServices               0x18fe98074 GSEventRunModal + 100
19 UIKit                          0x1946e7130 UIApplicationMain + 208
20 <App Name Redacted>            0x1000f39c0 main (AppDelegate.swift:23)
21 libdyld.dylib                  0x18d43d59c start + 4

LMLogger.m line 230
-[LMLogger _requestSucceededWithTask:]

Crashed: NSOperationQueue 0x17403f5c0 :: NSOperation 0x171048fd0 (QOS: DEFAULT)
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000bdf16bec8

Crashed: NSOperationQueue 0x17403f5c0 :: NSOperation 0x171048fd0 (QOS: DEFAULT)
0  libobjc.A.dylib                0x18a2b17f4 objc_object::release() + 8
1  CoreFoundation                 0x18b712a70 -[__NSArrayI dealloc] + 84
2  Logmatic                       0x100b0c444 -[LMLogger _requestSucceededWithTask:] (LMLogger.m:230)
3  Logmatic                       0x100b0c09c __22-[LMLogger _sendLogs:]_block_invoke (LMLogger.m:190)
4  Embrace                        0x101109d6c __swizzledDataTaskWithRequest_block_invoke + 424
5  CFNetwork                      0x18be3c1fc __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 32
6  CFNetwork                      0x18be53ef8 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 148
7  Foundation                     0x18c301804 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
8  Foundation                     0x18c246760 -[NSBlockOperation main] + 96
9  Foundation                     0x18c236b18 -[__NSOperationInternal _start:] + 612
10 Foundation                     0x18c303ba0 __NSOQSchedule_f + 228
11 libdispatch.dylib              0x18a6ea9a0 _dispatch_client_callout + 16
12 libdispatch.dylib              0x18a6f8ad4 _dispatch_queue_serial_drain + 928
13 libdispatch.dylib              0x18a6ee2cc _dispatch_queue_invoke + 884
14 libdispatch.dylib              0x18a6faa50 _dispatch_root_queue_drain + 540
15 libdispatch.dylib              0x18a6fa7d0 _dispatch_worker_thread3 + 124
16 libsystem_pthread.dylib        0x18a8f31d0 _pthread_wqthread + 1096
17 libsystem_pthread.dylib        0x18a8f2d7c start_wqthread + 4

Crash Insights

Heads Up!
Heap corruption

The stack trace indicates that heap corruption may have caused your app to crash. Memory corruption can occur pretty easily from freeing a dangling pointer, a thread race, or bad pointer arithmetic. The important thing to keep in mind is that the resulting crash may happen long after the initial corruption. As a result, the stack trace for this crash might not provide any clues to the location of the bug in your code. However, you can still fix memory issues with tools from Apple. For speedy resolution of memory corruption issues, we recommend regularly auditing your app with Xcode’s memory debugging facilities: Visual Memory Debugger, Zombies Instrument, Address Sanitizer, Thread Sanitizer and malloc diagnostics.

Crash in -[LMUserDefaultsPersistence replaceLogs:]

Hello,

Crashlytics has reported the following crash in Logmatic:

Fatal Exception: NSGenericException
*** Collection <__NSArrayM: 0x17404b3d0> was mutated while being enumerated.

Fatal Exception: NSGenericException
0  CoreFoundation                 0x18cb26fe0 __exceptionPreprocess
1  libobjc.A.dylib                0x18b588538 objc_exception_throw
2  CoreFoundation                 0x18cb26a30 -[NSException name]
3  Foundation                     0x18d57c3dc -[NSKeyedArchiver _encodeArrayOfObjects:forKey:]
4  Foundation                     0x18d57afd4 _encodeObject
5  Foundation                     0x18d581e9c +[NSKeyedArchiver archivedDataWithRootObject:]
6  Logmatic                       0x100c0cabc -[LMUserDefaultsPersistence replaceLogs:] (LMUserDefaultsPersistence.m:35)
7  Logmatic                       0x100c0c7e0 -[LMLogger _saveAndClearAllLogs] (LMLogger.m:278)
8  CoreFoundation                 0x18cac15f4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
9  CoreFoundation                 0x18cac0d08 _CFXRegistrationPost
10 CoreFoundation                 0x18cac0a84 ___CFXNotificationPost_block_invoke
11 CoreFoundation                 0x18cb2f7a8 -[_CFXNotificationRegistrar find:object:observer:enumerator:]
12 CoreFoundation                 0x18ca0495c _CFXNotificationPost
13 Foundation                     0x18d517970 -[NSNotificationCenter postNotificationName:object:userInfo:]
14 UIKit                          0x192ee1044 __47-[UIApplication _applicationDidEnterBackground]_block_invoke
15 UIKit                          0x192fc6620 +[UIViewController _performWithoutDeferringTransitions:]
16 UIKit                          0x192ee0ee4 -[UIApplication _applicationDidEnterBackground]
17 UIKit                          0x192ee148c -[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]
18 UIKit                          0x192ed8fd4 -[UIApplication workspaceShouldExit:withTransitionContext:]
19 FrontBoardServices             0x18e6d0884 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
20 FrontBoardServices             0x18e6d06f0 -[FBSSerialQueue _performNext]
21 FrontBoardServices             0x18e6d0aa0 -[FBSSerialQueue _performNextFromRunLoopSource]
22 CoreFoundation                 0x18cad542c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
23 CoreFoundation                 0x18cad4d9c __CFRunLoopDoSources0
24 CoreFoundation                 0x18cad29a8 __CFRunLoopRun
25 CoreFoundation                 0x18ca02da4 CFRunLoopRunSpecific
26 GraphicsServices               0x18e46d074 GSEventRunModal
27 UIKit                          0x192cbdc9c UIApplicationMain
28 App                           0x100048510 main (AppDelegate.swift:29)
29 libdyld.dylib                  0x18ba1159c start

[LMUserDefaultsPersistence replaceLogs:] is called with pendingLogs (from LMLogger) passed as parameter. My guess is that pendingLogs is modified somewhere else at the same time it is used to be archived.

Logmatic iOS version: 1.0.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.