firebase / firebase/firebase-cpp-sdk

Crash in Functions on MacOS when using authentication

Đang mở
#51 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
api: auth type: bug
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ả

### Please fill in the following fields:
Pre-built SDK from the [website](https://firebase.google.com/download/cpp)
Firebase C++ SDK version: 6.12.0
Firebase plugins in use (Auth, Database, etc.): Auth, Firestore, Functions, Storage
Additional SDKs you are using (Facebook, AdMob, etc.): Qt 5.14.1 clang 64bit
Platform you are using the C++ SDK on (Mac, Windows, or Linux): Mac
Platform you are targeting (iOS, Android, and/or desktop): desktop

### Please describe the issue here:

My application crashes when trying to call a Firebase callable function in combination with authentication:

auto pFireBaseApp = firebase::App::Create();
// No crash when I comment out the following line
auto pAuth = firebase::auth::Auth::GetAuth(pFireBaseApp);
auto pFunctions = functions::Functions::GetInstance(pFireBaseApp);

auto ref = pFunctions->GetHttpsCallable("testFunction");
auto future = ref.Call();
future.OnCompletion([](const Future &result) {
// Crash before this is reached but not when commenting out pAuth code
});

It does not crash, and behaves as expected, when not initializing Auth. Note that this behaves the same with a function that doesn't use authentication: `testFunction` is a very simple function that returns a fixed object.

This is the call stack of the crashed thread:

1 firebase::rest::BackgroundTransportCurl::PerformBackground(firebase::rest::Request *) (x86_64) /Users/jdierckx/work/Bioracer Motion/Bioracer Aero/build-BioracerAero-Desktop_Qt_5_14_1_clang_64bit-Debug/build-output/BRMApplicationTest.app/Contents/Frameworks/libBRMData.1.dylib 0x10038143b
2 firebase::rest::CurlThread::ProcessRequests() (x86_64) /Users/jdierckx/work/Bioracer Motion/Bioracer Aero/build-BioracerAero-Desktop_Qt_5_14_1_clang_64bit-Debug/build-output/BRMApplicationTest.app/Contents/Frameworks/libBRMData.1.dylib 0x10038318e
3 void * std::__thread_proxy>, void ( *)(void *), void *>>(void *) (x86_64) /Users/jdierckx/work/Bioracer Motion/Bioracer Aero/build-BioracerAero-Desktop_Qt_5_14_1_clang_64bit-Debug/build-output/BRMApplicationTest.app/Contents/Frameworks/libBRMData.1.dylib 0x1003a0cec
4 _pthread_start (x86_64) /usr/lib/system/libsystem_pthread.dylib 0x7fff64a29e65
5 thread_start (x86_64) /usr/lib/system/libsystem_pthread.dylib 0x7fff64a2583b

### Please answer the following, if applicable:
Have you been able to reproduce this issue with just the [Firebase C++ quickstarts](https://github.com/firebase/quickstart-cpp) ? Did not try (the quickstart example doesn't use Auth)

What's the issue repro rate? (eg 100%, 1/5 etc) 100%

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reproducing the sequence using App::Create, Auth::GetAuth, Functions::GetInstance, and HttpsCallable::Call on macOS. Inspect the crash path at BackgroundTransportCurl::PerformBackground and compare it with the Firebase C++ quickstart setup, noting that the reported quickstart does not include Auth. Done means callable Functions requests no longer crash when Auth is initialized.

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, macos
Lĩnh vực
api, authentication, desktop
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
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
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.