{"action":"created","issue":{"url":"https://api.github.com/repos/OneSignal/OneSignal-Unity-SDK/issues/105","repository_url":"https://api.github.com/repos/OneSignal/OneSignal-Unity-SDK","labels_url":"https://api.github.com/repos/OneSignal/OneSignal-Unity-SDK/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/OneSignal/OneSignal-Unity-SDK/issues/105/comments","events_url":"https://api.github.com/repos/OneSignal/OneSignal-Unity-SDK/issues/105/events","html_url":"https://github.com/OneSignal/OneSignal-Unity-SDK/issues/105","id":319840817,"node_id":"MDU6SXNzdWUzMTk4NDA4MTc=","number":105,"title":"Crashes on iOS due to Heap Corruption with version 2.6.4","user":{"login":"oleschaper","id":10585393,"node_id":"MDQ6VXNlcjEwNTg1Mzkz","avatar_url":"https://avatars2.githubusercontent.com/u/10585393?v=4","gravatar_id":"","url":"https://api.github.com/users/oleschaper","html_url":"https://github.com/oleschaper","followers_url":"https://api.github.com/users/oleschaper/followers","following_url":"https://api.github.com/users/oleschaper/following{/other_user}","gists_url":"https://api.github.com/users/oleschaper/gists{/gist_id}","starred_url":"https://api.github.com/users/oleschaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleschaper/subscriptions","organizations_url":"https://api.github.com/users/oleschaper/orgs","repos_url":"https://api.github.com/users/oleschaper/repos","events_url":"https://api.github.com/users/oleschaper/events{/privacy}","received_events_url":"https://api.github.com/users/oleschaper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-03T09:08:49Z","updated_at":"2018-08-15T20:30:09Z","closed_at":null,"author_association":"NONE","body":"**Description:**\r\nWe did update from version 2.4.0 to version 2.6.4 and our app started crashing on ios with different stack traces that are related to memory allocation.\r\n\r\nSo we downgraded to 2.4.0 and now it works again.\r\n\r\nWe are using crashlytics for crash reporting and their \"Crash Insights\" feature shows the following info:\r\n\r\n> 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.\r\n\r\n**Stacktraces:**\r\n\r\nExample Stacktrace 1\r\n\r\n```\r\nCrashed: UnityPreload\r\n0  libsystem_kernel.dylib         0x182a112ec __pthread_kill + 8\r\n1  libsystem_pthread.dylib        0x182bb66a8 pthread_kill$VARIANT$armv81 + 360\r\n2  libsystem_c.dylib              0x18297fd0c abort + 140\r\n3  libsystem_malloc.dylib         0x182a577d4 nano_ptr_in_use_enumerator + 330\r\n4  libsystem_malloc.dylib         0x182a59bd4 _nano_malloc_check_clear + 416\r\n5  libsystem_malloc.dylib         0x182a589a0 nano_malloc + 44\r\n6  libsystem_malloc.dylib         0x182a475dc malloc_zone_malloc + 160\r\n7  libsystem_malloc.dylib         0x182a4a0b0 malloc + 32\r\n8  awesomegame                 0x101925ef8 UnityDefaultAllocator<LowLevelAllocator>::Allocate(unsigned long, int) (UnityDefaultAllocator.cpp:22)\r\n9  awesomegame                 0x101a668ac MemoryManager::Allocate(unsigned long, unsigned long, MemLabelId, AllocateOptions, char const*, int) (MemoryManager.cpp:1248)\r\n10 awesomegame                 0x101bfbd0c ProduceHelper<Material, false>::Produce(MemLabelId, ObjectCreationMode) (Material.cpp:435)\r\n11 awesomegame                 0x101a783ac Object::Produce(Unity::Type const*, Unity::Type const*, int, MemLabelId, ObjectCreationMode) (BaseObject.cpp:518)\r\n12 awesomegame                 0x101cc9ce0 PersistentManager::ProduceObjectInternal(SerializedFile&, SerializedObjectIdentifier, int, ObjectCreationMode) (BaseObject.h:340)\r\n13 awesomegame                 0x101cc9be4 PersistentManager::CreateThreadActivationQueueEntry(SerializedFile&, SerializedObjectIdentifier, int, bool) (PersistentManager.cpp:1387)\r\n14 awesomegame                 0x101cca52c PersistentManager::ReadAndActivateObjectThreaded(int, SerializedObjectIdentifier const&, SerializedFile*, bool, bool) (PersistentManager.cpp:1626)\r\n15 awesomegame                 0x101cca6fc PersistentManager::LoadObjectsThreaded(int const*, int, LoadProgress&, bool) (PersistentManager.cpp:1708)\r\n16 awesomegame                 0x101bf0168 LoadOperation::Perform() (LoadOperation.cpp:91)\r\n17 awesomegame                 0x101bf22e4 PreloadManager::ProcessSingleOperation() (PreloadManager.cpp:295)\r\n18 awesomegame                 0x101bf20e8 PreloadManager::Run() (PreloadManager.cpp:358)\r\n19 awesomegame                 0x101bf2080 PreloadManager::Run(void*) (PreloadManager.cpp:201)\r\n20 awesomegame                 0x101c20f90 Thread::RunThreadWrapper(void*) (Thread.cpp:36)\r\n21 libsystem_pthread.dylib        0x182bb1220 _pthread_body + 272\r\n22 libsystem_pthread.dylib        0x182bb1110 _pthread_body + 290\r\n23 libsystem_pthread.dylib        0x182bafb10 thread_start + 4\r\n```\r\n\r\nExample Stacktrace 2\r\n\r\n```\r\nCrashed: com.apple.main-thread\r\n0  libsystem_kernel.dylib         0x182a112ec __pthread_kill + 8\r\n1  libsystem_pthread.dylib        0x182bb66a8 pthread_kill$VARIANT$armv81 + 360\r\n2  libsystem_c.dylib              0x18297fd0c abort + 140\r\n3  libsystem_malloc.dylib         0x182a577d4 nano_ptr_in_use_enumerator + 330\r\n4  libsystem_malloc.dylib         0x182a59bd4 _nano_malloc_check_clear + 416\r\n5  libsystem_malloc.dylib         0x182a589a0 nano_malloc + 44\r\n6  libsystem_malloc.dylib         0x182a475dc malloc_zone_malloc + 160\r\n7  CoreFoundation                 0x182e4b468 _CFRuntimeCreateInstance + 300\r\n8  CFNetwork                      0x1835bac4c CFObject::Allocate(unsigned long, CFClass const&, __CFAllocator const*) + 36\r\n9  CFNetwork                      0x183573044 _createRequestCopy(__CFAllocator const*, _CFURLRequest const*, unsigned char) + 80\r\n10 CFNetwork                      0x1836f8bcc -[NSURLRequest mutableCopyWithZone:] + 44\r\n11 CFNetwork                      0x183776350 -[__NSCFURLSessionTask initWithOriginalRequest:updatedRequest:ident:session:] + 92\r\n12 CFNetwork                      0x183530df8 -[__NSCFLocalSessionTask initWithOriginalRequest:updatedRequest:ident:session:] + 124\r\n13 CFNetwork                      0x183519948 -[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:] + 172\r\n14 awesomegame                 0x10410f650 -[OneSignalClient executeRequest:onSuccess:onFailure:] (OneSignalClient.m:108)\r\n15 awesomegame                 0x10410270c +[OneSignal postNotification:onSuccess:onFailure:] (OneSignal.m:906)\r\n16 awesomegame                 0x1036a28a0 _postNotification (OneSignalUnityRuntime.m:249)\r\n17 awesomegame                 0x1024ff80c OneSignalIOS_PostNotification_m2664247954 (il2cpp-codegen-il2cpp.h:605)\r\n18 awesomegame                 0x10235b010 OneSignalNotificationService_SchedulePushNotification_m256178011 (Bulk_Assembly-CSharp_13.cpp:68131)\r\n19 awesomegame                 0x102d3a314 Signal_1_Dispatch_m1231514687_gshared (Bulk_Generics_31.cpp:34884)\r\n20 awesomegame                 0x102b4b1e4 U3CU3Ec__DisplayClass36_0_U3CThenU3Eb__0_m2315877522_gshared (Bulk_Generics_2.cpp:4935)\r\n21 awesomegame                 0x1034e6c7c Promise_1_InvokeHandler_TisRuntimeObject_m339964354_gshared (GenericMethods4.cpp:50478)\r\n22 awesomegame                 0x102b4b79c Promise_1_InvokeResolveHandlers_m3533050072_gshared (il2cpp-codegen-common.h:258)\r\n23 awesomegame                 0x102b4b1e4 U3CU3Ec__DisplayClass36_0_U3CThenU3Eb__0_m2315877522_gshared (Bulk_Generics_2.cpp:4935)\r\n24 awesomegame                 0x1034e6c7c Promise_1_InvokeHandler_TisRuntimeObject_m339964354_gshared (GenericMethods4.cpp:50478)\r\n25 awesomegame                 0x102b4b79c Promise_1_InvokeResolveHandlers_m3533050072_gshared (il2cpp-codegen-common.h:258)\r\n26 awesomegame                 0x1034e6c7c Promise_1_InvokeHandler_TisRuntimeObject_m339964354_gshared (GenericMethods4.cpp:50478)\r\n27 awesomegame                 0x102b4b79c Promise_1_InvokeResolveHandlers_m3533050072_gshared (il2cpp-codegen-common.h:258)\r\n28 awesomegame                 0x102cde5a0 PromiseResolver_1_Resolve_m2595873554_gshared (Bulk_Generics_3.cpp:25601)\r\n29 awesomegame                 0x102810e94 BestHttpBackendConnection_OnRequestFinished_m2916273360 (Bulk_Assembly-CSharp_44.cpp:45400)\r\n30 awesomegame                 0x1023b64bc HTTPRequest_CallCallback_m2640281423 (Bulk_Assembly-CSharp_16.cpp:29215)\r\n31 awesomegame                 0x102384aa8 ConnectionBase_HandleCallback_m3535074261 (Bulk_Assembly-CSharp_14.cpp:63646)\r\n32 awesomegame                 0x1023b0278 HTTPManager_OnUpdate_m2252696592 (Bulk_Assembly-CSharp_16.cpp:24083)\r\n33 awesomegame                 0x10362246c RuntimeInvoker_Void_t1185182177(void (*)(), MethodInfo const*, void*, void**) (Il2CppInvokerTable.cpp:66660)\r\n34 awesomegame                 0x1040babb4 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) (Runtime.cpp:469)\r\n35 awesomegame                 0x103a3eeb0 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) (ScriptingApi_Il2Cpp.cpp:216)\r\n36 awesomegame                 0x103a46bc0 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) (ScriptingInvocation.cpp:329)\r\n37 awesomegame                 0x103a4bce8 MonoBehaviour::CallUpdateMethod(int) (MonoBehaviour.cpp:552)\r\n38 awesomegame                 0x1038b389c void BaseBehaviourManager::CommonUpdate<BehaviourManager>() (Behaviour.cpp:176)\r\n39 awesomegame                 0x103978b24 PlayerLoop() (PlayerLoop.cpp:175)\r\n40 awesomegame                 0x103791a8c UnityPlayerLoopImpl(bool) (LibEntryPoint.mm:243)\r\n41 awesomegame                 0x1020dbdf4 UnityRepaint (UnityAppController+Rendering.mm:270)\r\n42 awesomegame                 0x1020dbce0 -[UnityAppController(Rendering) repaintDisplayLink] (UnityAppController+Rendering.mm:77)\r\n43 QuartzCore                     0x186fea3c0 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 832\r\n44 QuartzCore                     0x18709f6fc display_timer_callback(__CFMachPort*, void*, long, void*) + 240\r\n45 CoreFoundation                 0x182f18b20 __CFMachPortPerform + 188\r\n46 CoreFoundation                 0x182f33ae8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56\r\n47 CoreFoundation                 0x182f33230 __CFRunLoopDoSource1 + 440\r\n48 CoreFoundation                 0x182f30c80 __CFRunLoopRun + 2456\r\n49 CoreFoundation                 0x182e50da8 CFRunLoopRunSpecific + 552\r\n50 GraphicsServices               0x184e33020 GSEventRunModal + 100\r\n51 UIKit                          0x18ce3178c UIApplicationMain + 236\r\n52 awesomegame                 0x1020d47b0 main (main.mm:33)\r\n53 libdyld.dylib                  0x1828e1fc0 start + 4\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/OneSignal/OneSignal-Unity-SDK/issues/comments/413325764","html_url":"https://github.com/OneSignal/OneSignal-Unity-SDK/issues/105#issuecomment-413325764","issue_url":"https://api.github.com/repos/OneSignal/OneSignal-Unity-SDK/issues/105","id":413325764,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzMyNTc2NA==","user":{"login":"Nightsd01","id":8186991,"node_id":"MDQ6VXNlcjgxODY5OTE=","avatar_url":"https://avatars0.githubusercontent.com/u/8186991?v=4","gravatar_id":"","url":"https://api.github.com/users/Nightsd01","html_url":"https://github.com/Nightsd01","followers_url":"https://api.github.com/users/Nightsd01/followers","following_url":"https://api.github.com/users/Nightsd01/following{/other_user}","gists_url":"https://api.github.com/users/Nightsd01/gists{/gist_id}","starred_url":"https://api.github.com/users/Nightsd01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nightsd01/subscriptions","organizations_url":"https://api.github.com/users/Nightsd01/orgs","repos_url":"https://api.github.com/users/Nightsd01/repos","events_url":"https://api.github.com/users/Nightsd01/events{/privacy}","received_events_url":"https://api.github.com/users/Nightsd01/received_events","type":"User","site_admin":false},"created_at":"2018-08-15T20:30:09Z","updated_at":"2018-08-15T20:30:09Z","author_association":"CONTRIBUTOR","body":"@oleschaper In the past few months we've made some changes to our SDK that likely alleviate this issue. Please give it a shot and let me know if the issue still occurs"}}
{"actor":{"display_login":"Nightsd01"}}