Skip to content
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

[Question] Segfault on firebase::gma::Initialize #1247

Closed
DeexCoding opened this issue Mar 27, 2023 · 9 comments
Closed

[Question] Segfault on firebase::gma::Initialize #1247

DeexCoding opened this issue Mar 27, 2023 · 9 comments
Assignees

Comments

@DeexCoding
Copy link

[REQUIRED] Please fill in the following fields:

  • Pre-built SDK from the website or open-source from this repo: Pre-built
  • Firebase C++ SDK version: 10.6.0
  • Main Firebase Components in concern: Google Mobile Ads (Auth, Database, etc.)
  • Other Firebase Components in use: None (Auth, Database, etc.)
  • Platform you are using the C++ SDK on: Windows (Mac, Windows, or Linux)
  • Platform you are targeting: Android (iOS, Android, and/or desktop)

[REQUIRED] Please describe the question here:

I am trying to initialize GMA, but it just throws a segfault and nothing else (project name is AndroidStudioTest, weird that the segfault leaves "an" out):

A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 23276 (Thread-6), pid 27809 (droidstudiotest)

And there is no other error

Here is the relevant code:

`int InitGMA(struct android_app* app)
{
JNIEnv* env = 0;
JavaVM* jniiptr = app->activity->vm;
jint attachResult = jniiptr->AttachCurrentThread(&env, 0);

firebase::InitResult result;
firebase::Future<firebase::gma::AdapterInitializationStatus> future = 
    firebase::gma::Initialize(env, app->activity->clazz, &result);`
@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@DeexCoding
Copy link
Author

Call stack shows:
art_sigsegv_fault 0x00000076bc67e4b0
art::FaultManager::HandleFault(int, siginfo *, void *) 0x00000076bc67e9c4
art::SignalChain::Handler(int, siginfo *, void *) 0x000000567665aea4
0x0000007954307668
_JNIEnv::NewStringUTF(const char *) 0x00000076460493d8
firebase::util::FindOrLoadClassFromLoaders(_JNIEnv *, const char *) 0x00000076460493c4
firebase::util::FindClass(_JNIEnv *, const char *) 0x00000076460493c4
firebase::gma::Initialize(_JNIEnv *, _jobject *, firebase::InitResult *) 0x00000076460989dc
InitGMA(android_app *) AdsWrapper.cpp:50
...

@AlmostMatt
Copy link
Contributor

Just to clarify, you are using GMA without a FirebaseApp, right?

Your sample code looks reasonable to me. I will try to reproduce and see what I can find.

@AlmostMatt AlmostMatt added needs-attention Need Googler's attention api: gma and removed needs-triage new New issue. labels Apr 6, 2023
@DeexCoding
Copy link
Author

I am using it without a firebase app. I noticed if I integrate firebase (gradle plugins and everything) then it works flawlessly in the codebase, however, I would still like to use the least ammount of dependencies if possible.

@jbrettkooistra
Copy link

jbrettkooistra commented Apr 24, 2023

I am having the same issue using GMA without a FireBaseApp. The details and setup are the same as the original poster except I am using a Mac. Integrating Firebase also resolves the issue for me, but I would also like to avoid this dependency. I tried updating the Firebase C++ SDK version to 10.7.0 but the issue seems to exist in that version as well. Any updates?

@AlmostMatt
Copy link
Contributor

AlmostMatt commented May 11, 2023

I was able to reproduce this issue. Upon looking into the code, I think I know what is happening.
Edit: There were some additional complications, so it will take a bit more time for me to fix this.

@DeexCoding
Copy link
Author

Any updates?

@AlmostMatt AlmostMatt self-assigned this Jul 31, 2023
@AlmostMatt
Copy link
Contributor

I have now submitted a fix for this (#1320), which will be included in the next release (11.4.0)

I'm going to close this issue for now as the fix is submitted. Feel free to re-open if any issues persist after the 11.4.0 version is released.

@AlmostMatt
Copy link
Contributor

The 11.4.0 release is now available, and it should include a fix for this issue.

@firebase firebase locked and limited conversation to collaborators Sep 2, 2023
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