You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Samsung Galaxy S5 Neo disconnects or seg faults. #8
If you're a business, consider becoming a hardware sponsor and send us the device. Otherwise there are some things we can try to check remotely, but it's very time consuming.
I reduced the projection from 1080x1920@1080x1920/0 to 1080x1920@540x960/0 and it is a lot more stable. It doesn't segfault immediately on connection when manually launched (it has seg faulted once)
STF runs somewhat more stable with a half(quarter?) projection.
I am guessing the seg faults and disconnections are from the overly-aggressive Samsung background app killer shooting minicap in the head for memory usage.
I read source code and found some comments regarding Samsung devices.
// Set the display's real information. This cannot be accessed automatically
// due to manufacturers (mainly Samsung) having customized
// android::DisplayInfo. The information has to be gathered somehow and then
// passed on here. Currently only the following properties are actually
// used: width and height.
virtual int
setRealInfo(const DisplayInfo& info) = 0;
};
// Attempt to get information about the given display. This may segfault
// on some devices due to manufacturer (mainly Samsung) customizations.
int
minicap_try_get_display_info(int32_t displayId, Minicap::DisplayInfo* info);
I tried various permutation of display_info, but no success.
Can you provide some instructions how to debug this using gdb? Below is my adb logcat result when it crashes.
********** Crash dump: **********
Build fingerprint: 'samsung/a7xeltexx/a7xelte:5.1.1/LMY47X/A710FXXU1APAC:user/release-keys'
pid: 19466, tid: 19468, name: Binder_2 >>> /data/local/tmp/minicap-devel/minicap <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Stack frame #00 pc 00004214 /system/lib/libcutils.so (android_atomic_add+16)
Stack frame #01 pc 0000edc7 /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+10)
Stack frame #02 pc 00029efb /system/lib/libgui.so (android::sp<android::IBinder>::~sp()+18)
Stack frame #03 pc 00030069 /system/lib/libgui.so (android::ConsumerBase::onFrameReplaced(android::BufferItem const&)+68)
Stack frame #04 pc 0002bb39 /system/lib/libgui.so (android::BufferQueue::ProxyConsumerListener::onFrameReplaced(android::BufferItem const&)+26)
Stack frame #05 pc 0002f157 /system/lib/libgui.so (android::BufferQueueProducer::queueBuffer(int, android::IGraphicBufferProducer::QueueBufferInput const&, android::IGraphicBufferProducer::QueueBufferOutput*)+590)
Stack frame #06 pc 000346c7 /system/lib/libgui.so (android::BnGraphicBufferProducer::onTransact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+626)
Stack frame #07 pc 0001a8b5 /system/lib/libbinder.so (android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+60)
Stack frame #08 pc 0001f96
8000
3 /system/lib/libbinder.so (android::IPCThreadState::executeCommand(int)+582)
Stack frame #09 pc 0001fa87 /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+38)
Stack frame #10 pc 0001fac9 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48)
Stack frame #11 pc 00023c63 /system/lib/libbinder.so
Stack frame #12 pc 000106a9 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+112)
Stack frame #13 pc 00010219 /system/lib/libutils.so
Stack frame #14 pc 000174a7 /system/lib/libc.so (__pthread_start(void*)+30)
Stack frame #15 pc 000154c3 /system/lib/libc.so (__start_thread+6)
And Also, my development environment is OS X right now with android ndk installed. I can build minicap but not shared libraries. In case if it is required to build shared libraries, I will setup that environment too knowing it will take forever.
There was some reason I didn't commit it earlier. I don't remember and didn't find any useful notes in the commit log, unfortunately. It's possible you may have to build the shared libraries with additional debug options to see all symbols. Otherwise you might not see the symbol names but it should still work. Or, maybe the gdb.setup file needed a little manual tweaking.
I think I remember now. I was working on a version that didn't require the shared libs at all. It ended in a failure at the time, but only due to my limited knowledge of memory layouts and inner workings of C++ constructors/destructors. I still think it'd be possible with more research.
I happened to have a Samsung Galaxy Note4, and spent my last weekend on this issue.
I got a conclusion, but it's kind of disappointing.
The device is flashed with a 5.1.1 stock rom, which can be told from the crash log.
Here is the crash log:
The reason it crashed is that the vtable of android::ConsumerBase::FrameAvailableListener in samsung is not agreed with the one in minicap. After the first frame arrived(in frame #03 above), instead of onFrameAvailable, the dtor is called.
Sadly I failed to find a decent solution to this issue.
Hope it helps.
Nov-8,2016 update:
There is a mistake in my previous post. The system is trying to call the onFrameReplaced instead of the onFrameAvailabe. onFrameReplaced is not in the source tree until 6.0.
Thanks, that's very useful information. It seems that it only happens on the 5.1.1 firmware, as practically all reports are from that version. Reports say the devices work after upgrading to 6.0.
I'm fairly confident we can find a workaround once I have a little time to look into it.
@dkw72n and others Please consider joining our slack at https://openstf.slack.com/ :) Send me an email at simo @ {name of this github organization} .io and I'll invite you.
Actually I do see the onFrameReplaced method in the 5.1 source tree. So does the stack trace mean that it tried to call onFrameReplaced, but accidentally called the destructor instead?
Not exactly, there are two steps actually:
a. it tries to call onFrameReplaced, but call the dtor instead, this call returns without error.
b. right after step a, it tries to decrease the reference count on the accidentally freed object.
step b is what you saw in the stack trace, step a is the root cause.
Activity
[-]Samsung Galaxy S5 Neo Does not work.[/-][+]Samsung Galaxy S5 Neo disconnects or seg faults.[/+]sorccu commentedon Nov 5, 2015
If you're a business, consider becoming a hardware sponsor and send us the device. Otherwise there are some things we can try to check remotely, but it's very time consuming.
Trugath commentedon Nov 5, 2015
After streaming a few times the phone soft bricks and is only restart-able by removing the battery.
Trugath commentedon Nov 5, 2015
I reduced the projection from 1080x1920@1080x1920/0 to 1080x1920@540x960/0 and it is a lot more stable. It doesn't segfault immediately on connection when manually launched (it has seg faulted once)
STF runs somewhat more stable with a half(quarter?) projection.
I am guessing the seg faults and disconnections are from the overly-aggressive Samsung background app killer shooting minicap in the head for memory usage.
sorccu commentedon Nov 5, 2015
If you have NDK installed and can build minicap, try running this :
adb logcat | ndk-stack -sym obj/local/arm64-v8aIt should show a bit more details about where the error occurs.
sorccu commentedon Nov 5, 2015
Alternatively if you happen to be proficient with
gdb, I can give you instructions to make it work.vbanthia-zz commentedon May 9, 2016
Having same problem with my Samsung Galaxy A7 (2016) Device.
Below is the device info.
I read source code and found some comments regarding Samsung devices.
I tried various permutation of display_info, but no success.
Can you provide some instructions how to debug this using
gdb? Below is myadb logcatresult when it crashes.vbanthia-zz commentedon May 9, 2016
And Also, my development environment is OS X right now with android ndk installed. I can build minicap but not shared libraries. In case if it is required to build shared libraries, I will setup that environment too knowing it will take forever.
sorccu commentedon May 9, 2016
I have gdb set up in a branch, let me see if i can cherry-pick it.
sorccu commentedon May 9, 2016
See https://github.com/openstf/minicap#debugging and the commit log. It's been almost one year since I last used it, but it worked OK.
vbanthia-zz commentedon May 9, 2016
Thanks, will try it :)
sorccu commentedon May 9, 2016
There was some reason I didn't commit it earlier. I don't remember and didn't find any useful notes in the commit log, unfortunately. It's possible you may have to build the shared libraries with additional debug options to see all symbols. Otherwise you might not see the symbol names but it should still work. Or, maybe the gdb.setup file needed a little manual tweaking.
sorccu commentedon May 9, 2016
I think I remember now. I was working on a version that didn't require the shared libs at all. It ended in a failure at the time, but only due to my limited knowledge of memory layouts and inner workings of C++ constructors/destructors. I still think it'd be possible with more research.
vbanthia-zz commentedon May 9, 2016
yeah, able to run gdb debugger now. There has been some changes in latest ndk version (r11c).
gdbclientpath has been changed to$NDK_ROOT/prebuilt/darwin-x86_64/bin/gdbfrom"$NDK_ROOT/toolchains/.../arm-linux-androideabi-gdb"Very minute, you have written
ndk.shinstead ofgdb.shin the README. Will improve docs, once I understand these all clearly.sorccu commentedon May 9, 2016
Yeah, it worked with r10e (64-bit).
4 remaining items
dkw72n commentedon Nov 7, 2016
I happened to have a
Samsung Galaxy Note4, and spent my last weekend on this issue.I got a conclusion, but it's kind of disappointing.
The device is flashed with a
5.1.1stock rom, which can be told from the crash log.Here is the crash log:
The reason it crashed is that the vtable of
android::ConsumerBase::FrameAvailableListenerin samsung is not agreed with the one in minicap. After the first frame arrived(inframe #03above), instead ofonFrameAvailable, thedtoris called.Sadly I failed to find a decent solution to this issue.
Hope it helps.
Nov-8,2016 update:
There is a mistake in my previous post. The system is trying to call the
onFrameReplacedinstead of theonFrameAvailabe.onFrameReplacedis not in the source tree until6.0.sorccu commentedon Nov 7, 2016
Thanks, that's very useful information. It seems that it only happens on the 5.1.1 firmware, as practically all reports are from that version. Reports say the devices work after upgrading to 6.0.
I'm fairly confident we can find a workaround once I have a little time to look into it.
sorccu commentedon Nov 7, 2016
@dkw72n and others Please consider joining our slack at https://openstf.slack.com/ :) Send me an email at simo @ {name of this github organization} .io and I'll invite you.
dkw72n commentedon Nov 8, 2016
@sorccu
libgui.zip
Attached is the libgui.so pulled from my device.
sorccu commentedon Nov 8, 2016
Actually I do see the
onFrameReplacedmethod in the 5.1 source tree. So does the stack trace mean that it tried to call onFrameReplaced, but accidentally called the destructor instead?dkw72n commentedon Nov 8, 2016
Not exactly, there are two steps actually:
a. it tries to call
onFrameReplaced, but call thedtorinstead, this call returns without error.b. right after step a, it tries to decrease the reference count on the accidentally freed object.
step b is what you saw in the stack trace, step a is the root cause.
sorccu commentedon Nov 8, 2016
These Samsung devices on 5.1.x should now work thanks to @dkw72n :)
ledinhphuong commentedon Nov 11, 2016
@sorccu @dkw72n I verified with the latest code. So it still happens on my
Samsung Galaxy Note4device.sorccu commentedon Nov 11, 2016
If you installed from source, did you remember to run
npm install?ledinhphuong commentedon Nov 12, 2016
@sorccu I fetched the latest code from mainstream (don't use it via
npm) and run minicap directly by./run.sh autosizecommand.dkw72n commentedon Nov 12, 2016
@ledinhphuong Appreciate if you could post the call stack and the
/system/lib/libgui.sofrom your device.ledinhphuong commentedon Nov 16, 2016
@sorccu @dkw72n I tried to remove node_modules folder (in STF project) and run
npm installagain. So the issue is fixed on my device. Thanks.P.s: Here are
npm lsof STF project: stf-node-modules.txtsorccu commentedon Nov 16, 2016
That's great, thanks for the update!
If you want to use minicap master in stf, you can do as follows.
First, in the minicap repo:
(it should also run
make, but if it doesn't, run it manually)Then, it the stf repo:
Now it should be linked to your local minicap.
Merge pull request openstf#8 from DeviceFarmer/semaphore-pubish