VectorKit->Texture2D crashes in the tile rendering process.

Originator:anatoli.macarov
Number:rdar://40739139 Date Originated:June 1 2018, 4:38 PM
Status:Closed Resolved:YES
Product:iOS SDK + MapKit Product Version:iOS 11
Classification: Reproducible:Yes
 
Area:
MapKit

Summary:
We found that the test app crashes when it's releasing a MKMapView object at the render process. The map has a hybrid style and rendering only the Apple's tiles.
Most of the time it happens after second attempt when tiles are cached.
Please run the attached test app and check the crash logs.

Steps to Reproduce:
1) Open app on iOS 11.
2) Tap the 'Show Map Screen' button
3) The Map View Controller is appeared
4) The map rendered all tiles
5) Tap the 'Close Map' button
6) Quickly repeat open/close the map screen

If you installed the test app first time please wait to cache Apple's tiles (You need to see them on the map). If you can not crash then re-run app and try on the device too. If you are not lucky then use the marks in the MapViewController class. Please follow them and uncomment necessary lines of code.

Expected Results:
Should not be a crash.

Actual Results:
The crash happens in 2-8 attempts.

Version/Build:
The source code is attached.

Configuration:
iOS 11 on iPhone/iPad device

Project here: https://github.com/dedmakarMD/Texture2D_Crash

--------------------------------------------------------------------
Email from Apple:

"Hello Anatoli,

There has been a status change for an issue you reported in Bug ID 40739139. 

The original bug report is now awaiting final verification. If you still see this issue in the latest beta releases, please file a new bug report using Bug Reporter. 

For problems logging in to Bug Reporter, contact Apple Developer Support.

For other bug reporting issues, contact the Developer Bug Reporting Team.

Developer Bug Reporting Team
Apple Worldwide Developer Relations"

Comments

Apple response: "This code patch no longer exists in iOS 13. "

By anatoli.macarov at July 21, 2022, 5:11 p.m. (reply...)

Stacktrace

⁃   Incident Identifier: 822DC751-5C92-4D09-8E6B-C3398F4EE603
⁃   CrashReporter Key:   35c5c352849b4aed4e415adeb8db8f6e7ae94322
⁃   Hardware Model:      iPad5,4
⁃   Process:             Texture2DCrash_MapKit [632]
⁃   Path:                /private/var/containers/Bundle/Application/53284690-EAC9-496D-AE3A-41946AA81283/Texture2DCrash_MapKit.app/Texture2DCrash_MapKit
⁃   Identifier:          org.macarov.Texture2DCrash-MapKit
⁃   Version:             1 (1.0)
⁃   Code Type:           ARM-64 (Native)
⁃   Role:                Foreground
⁃   Parent Process:      launchd [1]
⁃   Coalition:           org.macarov.Texture2DCrash-MapKit [924]
⁃   
⁃   
⁃   Date/Time:           2018-06-01 15:35:52.4267 -0700
⁃   Launch Time:         2018-06-01 15:35:43.5625 -0700
⁃   OS Version:          iPhone OS 11.4 (15F79)
⁃   Baseband Version:    6.60.00
⁃   Report Version:      104
⁃   
⁃   Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
⁃   Exception Subtype: KERN_INVALID_ADDRESS at 0xbadd1c94391cbebd
⁃   VM Region Info: 0xbadd1c94391cbebd is not in any region.  Bytes after previous region: 13464949875793510078  
⁃         REGION TYPE                      START - END             [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
⁃         MALLOC_NANO (reserved) 00000001d8000000-00000001e0000000 [128.0M] rw-/rwx SM=NUL  ...(unallocated)
⁃   --->  
⁃         UNUSED SPACE AT END
⁃   
⁃   Termination Signal: Segmentation fault: 11
⁃   Termination Reason: Namespace SIGNAL, Code 0xb
⁃   Terminating Process: exc handler [0]
⁃   Triggered by Thread:  0
⁃   
⁃   Filtered syslog:
⁃   None found
⁃   
⁃   Thread 0 name:  Dispatch queue: com.apple.main-thread
⁃   Thread 0 Crashed:
⁃   0   VectorKit                       0x0000000193102904 ggl::Texture2D::~Texture2D+ 280836 () + 84
⁃   1   VectorKit                       0x00000001931028e8 ggl::Texture2D::~Texture2D+ 280808 () + 56
⁃   2   VectorKit                       0x0000000193123fe4 std::__1::shared_ptr<ggl::Texture2D>::~shared_ptr+ 417764 () + 64
⁃   3   VectorKit                       0x00000001931d8de0 -[VKRasterTile .cxx_destruct] + 164
⁃   4   libobjc.A.dylib                 0x0000000181b3aef4 object_cxxDestructFromClass+ 28404 (objc_object*, objc_class*) + 148
⁃   5   libobjc.A.dylib                 0x0000000181b48990 objc_destructInstance + 68
⁃   6   libobjc.A.dylib                 0x0000000181b489f8 object_dispose + 16
⁃   7   VectorKit                       0x00000001930d4a78 -[VKTile dealloc] + 64
⁃   8   VectorKit                       0x00000001930e0330 -[VKRasterTile dealloc] + 72
⁃   9   VectorKit                       0x000000019330bbc0 __destroy_helper_block_.218.14980 + 40
⁃   10  libsystem_blocks.dylib          0x0000000182314a5c _Block_release + 152
⁃   11  libdispatch.dylib               0x0000000182274a60 _dispatch_client_callout + 16
⁃   12  libdispatch.dylib               0x000000018228165c _dispatch_main_queue_callback_4CF$VARIANT$mp + 1012
⁃   13  CoreFoundation                  0x000000018292b070 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
⁃   14  CoreFoundation                  0x0000000182928bc8 __CFRunLoopRun + 2272
⁃   15  CoreFoundation                  0x0000000182848da8 CFRunLoopRunSpecific + 552
⁃   16  GraphicsServices                0x000000018482d020 GSEventRunModal + 100
⁃   17  UIKit                           0x000000018c865758 UIApplicationMain + 236
⁃   18  Texture2DCrash_MapKit           0x0000000101150f00 0x101148000 + 36608
⁃   19  libdyld.dylib                   0x00000001822d9fc0 start + 4

All file in the Texture2D_Crash repository.

By anatoli.macarov at June 1, 2018, 11:45 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!