firebase / firebase/firebase-cpp-sdk
Segmentation fault of firebase while rotating orientation of IOS
- Ngôn ngữ chính
- C++
- Star
- 326
- Fork
- 137
- Merge trung bình
- 3 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 5
Mô tả
Hey,
I had few cases of segmentation fault of Firebase on my ios crash log. Based on it, it was because of incorrect re-initalization of the firebase while screen was being rotated int he application.
### Please fill in the following fields:
Firebase C++ SDK version: 6.7
Firebase plugins in use (Auth, Database, etc.): FirebaseAnalytics, FirebaseCore, FirebaseInstanceID
Additional SDKs you are using (Facebook, AdMob, etc.): qt 5.13.2 + qfirebase lib to use firebase with a qml https://github.com/Larpon/QtFirebase
Platform you are using the SDK on (Mac, Windows, or Linux): Mac
Platform you are targeting (iOS, Android, and/or desktop): IOS
### Please describe the issue here:
Looks like it is related to changing orientation of app, during that time firebase is re-initialised and mutex is not correctly handled
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [81193]
Triggered by Thread: 0
```
Thread 0 name:
Thread 0 Crashed:
0 libsystem_pthread.dylib 0x0000000190a693fc pthread_mutex_lock$VARIANT$mp + 0 (pthread_mutex.c:1491)
1 app 0x00000001025fda80 std::__1::__tree_const_iterator, std::__1::allocator >, flatbuffers::EnumVal*>, std::__1::__tree_node, std::__1::allocator >, flatbuffers::EnumVal*>, void*>*, long> std::__1::__tree, std::__1::allocator >, flatbuffers::EnumVal*>, std::__1::__map_value_compare, std::__1::allocator >, std::__1::__value_type, std::__1::allocator >, flatbuffers::EnumVal*>, std::__1::less, std::__1::allocator > >, true>, std::__1::allocator, std::__1::allocator >, flatbuffers::EnumVal*> > >::find, std::__1::allocator > >+ 1694336 (std::__1::basic_string, std::__1::allocator > const&) const + 12
2 app 0x0000000102601110 std::__1::enable_if<(__is_forward_iterator, std::__1::allocator >*>::value) && (is_constructible, std::__1::allocator >, std::__1::iterator_traits, std::__1::allocator >*>::reference>::value), void>::type std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > >::assign, std::__1::allocator >*>+ 1708304 (std::__1::basic_string, std::__1::allocator >*, std::__1::basic_string, std::__1::allocator >*) + 36
3 app 0x00000001025fcc18 firebase::analytics::Initialize+ 1690648 (firebase::App const&) + 84
4 app 0x000000010252bb9c QtFirebaseAnalytics::init() + 834460 (qtfirebaseanalytics.cpp:0)
5 app 0x00000001034ca364 QQmlExpression::QQmlExpression+ 17212260 () + 2224
6 app 0x000000010252ab5c QtFirebase::requestInit() + 830300 (qtfirebase.cpp:0)
7 app 0x00000001034ca364 QQmlExpression::QQmlExpression+ 17212260 () + 2224
8 app 0x00000001034cec90 QWindowSystemInterfacePrivate::GeometryChangeEvent::GeometryChangeEvent+ 17230992 (QWindow*, QRect const&) + 120
9 app 0x00000001034c2e9c QObject::event+ 17182364 (QEvent*) + 80
10 app 0x00000001034a26f8 QObject::userData+ 17049336 (unsigned int) const + 124
11 app 0x00000001034a22cc QVector::resize+ 17048268 (int) + 204
12 app 0x00000001034e7bc4 QEucJpCodec::QEucJpCodec+ 17333188 () + 932
13 app 0x000000010353c9d8 QIPAddressUtils::parseIp4Internal+ 17680856 (unsigned int&, char const*, bool) + 620
14 CoreFoundation 0x0000000190cd0e1c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28 (CFRunLoop.c:1766)
15 CoreFoundation 0x0000000190cd0b58 __CFRunLoopDoTimer + 880 (CFRunLoop.c:2357)
16 CoreFoundation 0x0000000190cd0228 __CFRunLoopDoTimers + 276 (CFRunLoop.c:2512)
17 CoreFoundation 0x0000000190ccb364 __CFRunLoopRun + 1920 (CFRunLoop.c:0)
18 CoreFoundation 0x0000000190cca8bc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192)
19 GraphicsServices 0x000000019ab36328 GSEventRunModal + 104 (GSEvent.c:2246)
20 UIKitCore 0x0000000194d606d4 UIApplicationMain + 1936 (UIApplication.m:4753)
21 app 0x0000000102606df0 qt_main_wrapper + 820
22 libdyld.dylib 0x0000000190b55460 start + 4
```
### Please answer the following, if applicable:
Have you been able to reproduce this issue with just the Firebase C++ quickstarts (this GitHub project)? Crash happent to a user, but based on crash log it was during app being rotated and Fireabe was being reinitalized.
What's the issue repro rate? (eg 100%, 1/5 etc) Wasn't able to repro myself so would say "low".
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với các mục trong crash stack cho QtFirebaseAnalytics::init() trong qtfirebaseanalytics.cpp và QtFirebase::requestInit() trong qtfirebase.cpp, sau đó so sánh việc khởi tạo trong quá trình thay đổi hướng với Firebase C++ quickstarts. Nếu có thể, hãy tái hiện kịch bản xoay iOS đã được báo cáo; để hoàn tất cần xác nhận nguyên nhân và có bản sửa lỗi hoặc trạng thái tái hiện rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp, ios
- Lĩnh vực
- mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 20/100