-
Notifications
You must be signed in to change notification settings - Fork 158
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
/system/bin/mediaserver crash at system startup #56
Comments
I found a way to reproduce this issue anytime, simply kill pid of "com.android.phone". The "com.android.phone" will be restarted when been killed, and running "com.android.phone" will trigger some function calls at mediaserver which caused mediaserver crash. During system start "com.android.phone" was executed after /system/bin/mediaserver", it explains why mediaserver always crash during system startup. By this discovery, I can attach gdbserver to pid of "mediaserver", then kill pid of "com.android.phone" to debug this issue by gdb. The crash point android_atmoic_add() was called by several different functions in mediaserver. When crash case occured, the back trace sequence is as below:
It's working fine when been called another sequence as below:
Some things need to be further investigated:
|
Sorry, back trace for crash case should be as below. The ptr=0xa9a081dd in android_atomic_add() is invalid(not at 4 byte boundary, which caused SIGBUS), and the value of "stream" at back trace no.6 became messed after calling "libaudiopolicy.so". Unfortunately "libaudiopolicy.so" is proprietary library from S2 stock firmware, I cannot trace into it to know what really happened. Could be compatibility issue between "libaudiopolicy.so"(from S2) and other libraries(from Android AOSP).
Below is a quick work around fix. Not recommend to use it at this moment, unless you are working on something blocked by mediaserver crash.
|
When replacing with "libaudiopolicy.so" from CyanogenMod 7.1 for SGS2, this crash issue disappeared. And I can hear dialing tone in Phone.js which couldn't before. It's a better temporary solution than previous work around fix. I'll take a look at how this library was built by CM. |
sounds great! |
CM 7.1 for SGS2 also pulling "libaudiopolicy.so" from stock firmware, instead of building from source. |
Nice work @shianyow! Unfortunately, we can't host the proprietary blobs ourselves :(. According to https://github.com/CyanogenMod/android_vendor_cyanogen/blob/gingerbread/CHANGELOG.mkdn, CM 7.1 is based on gingerbread 2.3.7, while our codebase is ~2.3.3. This was hypothesized to be part of what caused the problems with wifi. Since we're all on 2.3.4 firmware now, it's probably time to rebase our code on that. |
Actually, that's wrong ... b2g is based on 2.3.5 right now. So looks like our blobs are just too old. Maybe the best solution here would be to download CM blobs we need as part of the config process (but not commit them to our repo). That would make the config-galaxy-s2 step a lot simpler and more reliable, and wouldn't require having a phone to build b2g (good for automated builds). |
Downloading CM blobs in config process sounds a good idea. :) |
Will do it this way later on. |
Great! Thanks for taking this. Based on what you found, it looks like the blobs we need are only in the CM images. So we're probably going to have to download, inflate, mount, then extract what we need. |
For Android build, current B2G still use kernel from stock firmware, we still need to get blobs from real device, because they could be different depending on stock firmware version. For example, we are maintaining several versions(UHKG7, UHKI2, ZSKI3, GWK74, XWKI4...) in extract-files.sh and they require different proprietary libraries. How about this?
|
Yes, that's a good plan. We can also grab blobs from an older version of CM. |
Make sure the blobs are downloaded during make flash. We can't put them into our repository. |
Yes, as part of the configure process. It's important not to commit the blobs. |
Now "libaudiopolicy.so" will be extracted from CM 7.1 in config-galaxy-s2 process. |
\o/ |
This issue was separated from "#47: CPU pegged by debuggerd on startup".
/system/bin/mediaserver will crash at first time during system startup and automatically restart to work normally.
According to /data/tombstone, the crash point is android_atmoic_add(), called by SharedBuffer::acquired().
The text was updated successfully, but these errors were encountered: