Daniel D-G
2018-06-10 21:58:24 UTC
Hey all,
I'm working on building an AAudio based synthesizer app. I've gotten
everything up and running, with one exception (in the figurative sense,
lower-case "e"): every time I run the app and then close it (i.e. Activity
OnStop()), I get a strange segmentation fault somewhere in system code (the
stacktrace of which is attached). This occurs after my cleanup code runs in
OnStop(); this code performs the tasks needed to close the audio stream,
including calling AAudioStream_close
<https://developer.android.com/ndk/reference/group/audio#group___audio_1gadf9c1647e285dab77fd5dc062225bcbd>
on the stream I opened in the Activity OnStart().
As verified through debugging, everything works properly through the end of
user code (AAudio reports that the stream closed successfully), but then
soon after, the app crashes in the background. This is likely at the point
where the process is being shut down by the system
<https://developer.android.com/guide/components/activities/activity-lifecycle#asem>
to free RAM. It appears libbinder.so is attempting to access a null
pointer, but I have no idea what it might be looking for; in the entire
stacktrace, there is no reference to any of my code. Interestingly, the
crash doesn't seem to occur on the emulator, but always occurs on my device
(a Motorola Moto Z Play).
Any idea what might be causing this? I want to be sure it's a bug before
filing a GitHub ticket; perhaps something is wrong with my code.
I'm working on building an AAudio based synthesizer app. I've gotten
everything up and running, with one exception (in the figurative sense,
lower-case "e"): every time I run the app and then close it (i.e. Activity
OnStop()), I get a strange segmentation fault somewhere in system code (the
stacktrace of which is attached). This occurs after my cleanup code runs in
OnStop(); this code performs the tasks needed to close the audio stream,
including calling AAudioStream_close
<https://developer.android.com/ndk/reference/group/audio#group___audio_1gadf9c1647e285dab77fd5dc062225bcbd>
on the stream I opened in the Activity OnStart().
As verified through debugging, everything works properly through the end of
user code (AAudio reports that the stream closed successfully), but then
soon after, the app crashes in the background. This is likely at the point
where the process is being shut down by the system
<https://developer.android.com/guide/components/activities/activity-lifecycle#asem>
to free RAM. It appears libbinder.so is attempting to access a null
pointer, but I have no idea what it might be looking for; in the entire
stacktrace, there is no reference to any of my code. Interestingly, the
crash doesn't seem to occur on the emulator, but always occurs on my device
(a Motorola Moto Z Play).
Any idea what might be causing this? I want to be sure it's a bug before
filing a GitHub ticket; perhaps something is wrong with my code.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/97e8e492-f106-4a38-8058-e2827356fff5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/97e8e492-f106-4a38-8058-e2827356fff5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.