Git Product home page Git Product logo

Comments (8)

OpenJeDi avatar OpenJeDi commented on June 3, 2024 1

As a follow-up for those interested: I tried a lot of things:

  • Compile master in MacOS --> same crash (memmove operation in the Curl background thread)
  • Compile master in Windows --> same crash

This made me realize it was probably not a dependency issue, as it behaves exactly the same on MacOS and Windows, in both the binary release and compiled from source (master).

The quickstart example did not crash.

After a lot of testing, I figured out there is no crash when waiting for the future to be complete (like in the quickstart example) instead of using the OnCompleted callback.

It still works if I do use the OnCompleted callback, but wait for the future to be complete after Call'ing the function.

So that is what I am doing now. It is not a bad workaround in my case because I call the function from the logon completed callback anyway, so I don't block the main thread.

from firebase-cpp-sdk.

HyperNexus avatar HyperNexus commented on June 3, 2024 1

Was running into the exact same issue.

In my case I resolved the issue by ensuring the HttpsCallableReference was not destroyed until the future had resolved. The destructor for this class releases the future and calls rest::CleanupTransportCurl() which I imagine is the cause of the problem.

from firebase-cpp-sdk.

OpenJeDi avatar OpenJeDi commented on June 3, 2024

Another strange thing that could help:

It also crashes when using auto pFirestore = firestore::Firestore::GetInstance(pFireBaseApp); before the function call, even when not using Auth.

Even stranger: when I move the auto pFirestore = firestore::Firestore::GetInstance(pFireBaseApp); after the function call, the completed callback is never reached. At shutdown, I then get this error:

WARNING: Auth object 0x5d786ce0 should be deleted before the App 0x5d78b790 it depends upon.

When I put the auto pAuth = firebase::auth::Auth::GetAuth(pFireBaseApp); line after the function call, or both pAuth and pFirestore lines, the OnCompleted callback is never reached but no complaints at shutdown.

from firebase-cpp-sdk.

patm1987 avatar patm1987 commented on June 3, 2024

Hi @OpenJeDi !

So first, it would really help if you were able to reproduce this issue in the quickstart. Here's the Firestore one and here's the Auth one. This helps get us much closer to the source of the issue much faster.

Further, it might help if you switch to the open source SDK in this repository. I cover a little bit about the differences between the two here, but the TLDR is that the source release is identical to the binary one. It will just be easier to track any bugs and there's a small chance that one or more of the binaries we ship won't work in your configuration (Firebase ships a C++ SDK, and as you may know, the ABI isn't always stable between even different versions of the same operating system. I haven't seen this cause an issue on MacOS, but occasionally it crops up in Linux).

If you cannot repro it here and going to the open source sdk doesn't help, I see that you're using Qt. The next most useful thing may be to get steps from a new Qt project (I assume you're using QMake or are you on CMake?) to an error state.

Let me know how this all goes!
--Patrick

from firebase-cpp-sdk.

morganchen12 avatar morganchen12 commented on June 3, 2024

Also, can you share the full stack trace (including the exception message)?

from firebase-cpp-sdk.

OpenJeDi avatar OpenJeDi commented on June 3, 2024

Thanks, I will take all the steps you propose.

We are still using qmake although the transition to cmake has been on my list for a long time. Transitioning to a different cloud system is a big task though, so I'm not going to overcomplicate it with combining those efforts now.

Also, note that I was using Auth, Firestore (and before that Database) and Storage successfully already. It is only Functions that is not working.

I'll try the Auth, Firestore and Functions quickstart examples with the latest tag from GitHub anyway. Or should I use the master branch?

from firebase-cpp-sdk.

OpenJeDi avatar OpenJeDi commented on June 3, 2024

I tried the functions quickstart example with the current master of the cpp SDK (d0fc238). This is the output:

Initialized Firebase App.
Initializing Firebase Auth and Cloud Functions.
Attempt to initialize Firebase Auth.
Attempt to initialize Cloud Functions.
Successfully initialized Firebase Auth and Cloud Functions.
ERROR: Could not sign in anonymously. Error 1: An internal error has occurred.
Ensure your application has the Anonymous sign-in provider enabled in Firebase Console.
Attempting to connect to Cloud Functions anyway. This may fail depending on the function.
Calling addNumbers
FAILED!
Error 13: INTERNAL
Shutting down the Functions library.
SUCCESS: Reference was invalidated on library shutdown.
Signing out from anonymous account.
Shutting down the Auth library.
Shutting down Firebase App.

I did enable anonymous login though.
The application hangs at that last line, it doesn't actually shut down.

I will try the source version of the cpp SDK with my application to see if there is any change in behviour.

from firebase-cpp-sdk.

morganchen12 avatar morganchen12 commented on June 3, 2024

Thanks for the investigation and workaround!

from firebase-cpp-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.