Skip to content

[iOS] App Crash when using Baidumap with FirebaseAnalytics #8505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ngminhduong opened this issue Aug 7, 2021 · 8 comments
Closed

[iOS] App Crash when using Baidumap with FirebaseAnalytics #8505

ngminhduong opened this issue Aug 7, 2021 · 8 comments

Comments

@ngminhduong
Copy link

ngminhduong commented Aug 7, 2021

Step 0: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request please use the Feature Request template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general (non-iOS) Firebase discussion, use the firebase-talk
    google group.
  • For backend issues, console issues, and other non-SDK help that does not fall under one
    of the above categories, reach out to
    Firebase Support.
  • Once you've read this section and determined that your issue is appropriate for
    this repository, please delete this section.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.4
  • Firebase SDK version: 8.3.0
  • Installation method: [CocoaPods]
  • Firebase Component: Analytics

[REQUIRED] Step 2: Describe the problem

App crash
Screen Shot 2021-08-07 at 08 33 01

Steps to reproduce:

  1. Install 'Firebase/Analytics', '8.3.0', 'BaiduMapKit/Map','6.2.0', 'BaiduMapKit/Utils','6.2.0'
  2. Setup firebase
    var options = FirebaseOptions.defaultOptions()
    FirebaseApp.configure(options: options!)
    I also reproduce crash from
    Reproduce project:
    https://drive.google.com/file/d/15p8F8kQxRfkKdC8Rdag4Od-Q1KQ85zEK/view?usp=sharing
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@morganchen12
Copy link
Contributor

Can you share the full stack trace? If you're able to reproduce it with Xcode's debugging tools attached, you should be able to get the full stack trace by typing bt all in console.

@ngminhduong
Copy link
Author

ngminhduong commented Aug 9, 2021

Full stack trace:

2021-08-10 03:34:03.180123+0700 Testcrashbaidumap[25253:5662345] 8.3.0 - [Firebase/Analytics][I-ACS023007] Analytics v.8.3.0 started
2021-08-10 03:34:03.180319+0700 Testcrashbaidumap[25253:5662345] 8.3.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2021-08-10 03:34:03.516330+0700 Testcrashbaidumap[25253:5662351] 8.3.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
(lldb) bt all
  thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x00000001c2942644 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x00000001c2941a48 libsystem_kernel.dylib`mach_msg + 72
    frame #2: 0x0000000196a210fc CoreFoundation`__CFRunLoopServiceMachPort + 376
    frame #3: 0x0000000196a1b570 CoreFoundation`__CFRunLoopRun + 1176
    frame #4: 0x0000000196a1aba0 CoreFoundation`CFRunLoopRunSpecific + 572
    frame #5: 0x00000001ad783598 GraphicsServices`GSEventRunModal + 160
    frame #6: 0x000000019930c2f4 UIKitCore`-[UIApplication _run] + 1052
    frame #7: 0x0000000199311874 UIKitCore`UIApplicationMain + 164
    frame #8: 0x00000001aa19bb54 libswiftUIKit.dylib`UIKit.UIApplicationMain(Swift.Int32, Swift.Optional<Swift.UnsafeMutablePointer<Swift.UnsafeMutablePointer<Swift.Int8>>>, Swift.Optional<Swift.String>, Swift.Optional<Swift.String>) -> Swift.Int32 + 100
    frame #9: 0x0000000104e29ee4 Testcrashbaidumap`static UIApplicationDelegate.main() at <compiler-generated>:0
    frame #10: 0x0000000104e29e5c Testcrashbaidumap`static AppDelegate.$main(self=Testcrashbaidumap.AppDelegate) at <compiler-generated>:0
    frame #11: 0x0000000104e29f28 Testcrashbaidumap`main at <compiler-generated>:0
    frame #12: 0x00000001966f9568 libdyld.dylib`start + 4
  thread #2
    frame #0: 0x00000001c296648c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #3, name = 'gputools.smt_poll.0x281cc2b20'
    frame #0: 0x00000001c2965bf0 libsystem_kernel.dylib`__semwait_signal + 8
    frame #1: 0x000000019f7996d4 libsystem_c.dylib`nanosleep + 212
    frame #2: 0x000000019f7995ac libsystem_c.dylib`usleep + 64
    frame #3: 0x000000010627b7d0 GPUToolsCore`smt_poll_thread_entry(void*) + 144
    frame #4: 0x00000001df22fc9c libsystem_pthread.dylib`_pthread_start + 288
  thread #4, name = 'gputools.smt_poll.0x281cfcc40'
    frame #0: 0x00000001c2965bf0 libsystem_kernel.dylib`__semwait_signal + 8
    frame #1: 0x000000019f7996d4 libsystem_c.dylib`nanosleep + 212
    frame #2: 0x000000019f7995ac libsystem_c.dylib`usleep + 64
    frame #3: 0x0000000105a4838c libMTLCapture.dylib`___lldb_unnamed_symbol2227$$libMTLCapture.dylib + 104
    frame #4: 0x00000001df22fc9c libsystem_pthread.dylib`_pthread_start + 288
* thread #5, queue = 'com.google.fira.worker', stop reason = EXC_BAD_ACCESS (code=1, address=0xa9065ff8d1028407)
  * frame #0: 0x0000000104f5a448 Testcrashbaidumap`pb_encode + 68
    frame #1: 0x000000010540679c Testcrashbaidumap`nano_two_pass_encoding + 60
    frame #2: 0x00000001053cd344 Testcrashbaidumap`apmpb_encode_measurement_bundle + 80
    frame #3: 0x00000001053d91cc Testcrashbaidumap`-[APMPBMeasurementBundle protoBuffer] + 32
    frame #4: 0x00000001053756ac Testcrashbaidumap`-[APMDatabase insertIfNotExistsRawEventMetadata:error:] + 84
    frame #5: 0x00000001053a80e4 Testcrashbaidumap`-[APMMeasurement(Event) writeEvent:isPublicEvent:isRealtime:] + 1088
    frame #6: 0x00000001053a57c4 Testcrashbaidumap`__49-[APMMeasurement(Event) writeEventOnWorkerQueue:]_block_invoke + 604
    frame #7: 0x0000000105401fd4 Testcrashbaidumap`-[APMSqliteStore performTransactionWithError:block:] + 176
    frame #8: 0x0000000105374698 Testcrashbaidumap`-[APMDatabase performTransaction:] + 48
    frame #9: 0x00000001053a5488 Testcrashbaidumap`-[APMMeasurement(Event) writeEventOnWorkerQueue:] + 820
    frame #10: 0x00000001053a4fe4 Testcrashbaidumap`-[APMMeasurement(Event) handleEventOnWorkerQueue:] + 540
    frame #11: 0x00000001053a4d9c Testcrashbaidumap`-[APMMeasurement(Event) handleInternalEventOnWorkerQueue:] + 184
    frame #12: 0x00000001053afbc0 Testcrashbaidumap`-[APMMeasurement reportFirstOpenOnWorkerQueue] + 2100
    frame #13: 0x00000001053aeac8 Testcrashbaidumap`__47-[APMMeasurement startMeasurementOnWorkerQueue]_block_invoke + 2328
    frame #14: 0x00000001053ae0a8 Testcrashbaidumap`-[APMMeasurement startMeasurementOnWorkerQueue] + 168
    frame #15: 0x00000001053ad8b4 Testcrashbaidumap`-[APMMeasurement setEnabledOnWorkerQueue:] + 272
    frame #16: 0x00000001053ad794 Testcrashbaidumap`__29-[APMMeasurement setEnabled:]_block_invoke + 44
    frame #17: 0x00000001053f7358 Testcrashbaidumap`__51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 44
    frame #18: 0x00000001060cbce4 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #19: 0x00000001060cd528 libdispatch.dylib`_dispatch_client_callout + 16
    frame #20: 0x00000001060d45ac libdispatch.dylib`_dispatch_lane_serial_drain + 748
    frame #21: 0x00000001060d5234 libdispatch.dylib`_dispatch_lane_invoke + 452
    frame #22: 0x00000001060e0a5c libdispatch.dylib`_dispatch_workloop_worker_thread + 1456
    frame #23: 0x00000001df2315a4 libsystem_pthread.dylib`_pthread_wqthread + 272
  thread #6
    frame #0: 0x00000001c296648c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #7, name = 'NE-Map-DrawFPSController'
    frame #0: 0x00000001c296561c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001df22cdb4 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 1180
    frame #2: 0x00000001aaec3e0c libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
    frame #3: 0x0000000105218840 Testcrashbaidumap`_baidu_vi::EventLoop::runLoop() + 280
    frame #4: 0x0000000105218e3c Testcrashbaidumap`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (_baidu_vi::EventLoop::*)(), _baidu_vi::EventLoop*> >(void*) + 64
    frame #5: 0x00000001df22fc9c libsystem_pthread.dylib`_pthread_start + 288
  thread #8
    frame #0: 0x00000001c296648c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #9, name = 'com.apple.uikit.eventfetch-thread'
    frame #0: 0x00000001c2942644 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x00000001c2941a48 libsystem_kernel.dylib`mach_msg + 72
    frame #2: 0x0000000196a210fc CoreFoundation`__CFRunLoopServiceMachPort + 376
    frame #3: 0x0000000196a1b570 CoreFoundation`__CFRunLoopRun + 1176
    frame #4: 0x0000000196a1aba0 CoreFoundation`CFRunLoopRunSpecific + 572
    frame #5: 0x0000000197c3a7f8 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
    frame #6: 0x0000000197c3a6d8 Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 88
    frame #7: 0x00000001993b8054 UIKitCore`-[UIEventFetcher threadMain] + 504
    frame #8: 0x0000000197d974bc Foundation`__NSThread__start__ + 848
    frame #9: 0x00000001df22fc9c libsystem_pthread.dylib`_pthread_start + 288
  thread #10
    frame #0: 0x00000001c296648c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #11
    frame #0: 0x00000001df23486c libsystem_pthread.dylib`start_wqthread
  thread #12
    frame #0: 0x00000001df23486c libsystem_pthread.dylib`start_wqthread
  thread #13
    frame #0: 0x00000001c296648c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #14
    frame #0: 0x00000001c296648c libsystem_kernel.dylib`__workq_kernreturn + 8
(lldb) 

Did you try to run my reproduce project?
I think you can easy to reproduce crash from my project.

@paulb777
Copy link
Member

This crash could be the result of BaiduMapKit embedding a version of nanopb that is incompatible with the version used by Firebase.

@ngminhduong
Copy link
Author

Hi @paulb777
Yes, I found some old ticket with the same issue with BaiduMapKit.
Any solution to fix it from firebase?

Thanks,

@paulb777
Copy link
Member

If BaiduMapKit is using nanopb via a CocoaPod without using the nanopb CocoaPod, there's not much we can do on the Firebase side.

They should either use the nanopb CocoaPod with matching preprocessor defines as Firebase or rename all the nanopb public symbols in their internal copy.

@ngminhduong
Copy link
Author

Yes, I see. But that difficult to request an update from BaiduMapKit.
They totally not working with GoogleAPI.

@paulb777
Copy link
Member

Closing since this seems to be a BaiduMapKit issue and not clear what we can do from Firebase.

@firebase firebase locked and limited conversation to collaborators Jan 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants