swiftshader sw::clear fail when android bootanim display

215 views
Skip to first unread message

yingbin ma

unread,
Oct 9, 2020, 4:58:31 AM10/9/20
to swiftshader

Hi, swiftshader team:

       I use swiftshader on physical android device with gpu support, build use arm 32bit userdebug successfully.     When android boot, it fail when bootanim display, the crash log as follows: 

01-01 00:00:58.601  1551  1551 I SurfaceFlinger: Enter boot animation
01-01 00:00:58.602   140   140 I hwservicemanager: getTransport: Cannot find entry vendor.display.config@1.1::IDisplayConfig/default in either framework or device manifest.
01-01 00:00:58.641  1551  1551 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x748164e000 in tid 1551 (surfaceflinger), pid 1551 (surfaceflinger)
01-01 00:00:58.698  1680  1680 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
01-01 00:00:58.702   232   232 I /system/bin/tombstoned: received crash request for pid 1551
01-01 00:00:58.702  1680  1680 I crash_dump64: performing dump of process 1551 (target tid = 1551)
01-01 00:00:58.710  1680  1680 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-01 00:00:58.710  1680  1680 F DEBUG   : Build fingerprint: 'Raspberry/omni_rpi4/rpi4:10/QKQ1.190716.003/1910071200:userdebug/release-keys'
01-01 00:00:58.710  1680  1680 F DEBUG   : Revision: 'd03114'
01-01 00:00:58.710  1680  1680 F DEBUG   : ABI: 'arm64'
01-01 00:00:58.711  1680  1680 F DEBUG   : Timestamp: 1970-01-01 00:00:58+0000
01-01 00:00:58.711  1680  1680 F DEBUG   : pid: 1551, tid: 1551, name: surfaceflinger  >>> /system/bin/surfaceflinger <<<
01-01 00:00:58.711  1680  1680 F DEBUG   : uid: 1000
01-01 00:00:58.711  1680  1680 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x748164e000
01-01 00:00:58.712  1680  1680 F DEBUG   :     x0  000000748164e000  x1  0000000000000000  x2  0000000000000720  x3  00000075784dcdf0
01-01 00:00:58.712  1680  1680 F DEBUG   :     x4  0000000000000000  x5  0000000000000720  x6  00000000000003d8  x7  0000007fd2b7ac70
01-01 00:00:58.712  1680  1680 F DEBUG   :     x8  0000000000000720  x9  000000748164e010  x10 0000000000000720  x11 0000000000000015
01-01 00:00:58.712  1680  1680 F DEBUG   :     x12 0000007585a9f5c0  x13 616943b7ede6c36d  x14 0000000000000000  x15 0000000000000030
01-01 00:00:58.712  1680  1680 F DEBUG   :     x16 00000075849a2950  x17 0000007584931320  x18 0000007586270000  x19 0000007577a9e900
01-01 00:00:58.712  1680  1680 F DEBUG   :     x20 0000007fd2b7ada0  x21 000000748164e000  x22 0000000000000000  x23 0000000000000064
01-01 00:00:58.712  1680  1680 F DEBUG   :     x24 000000000000006c  x25 0000000000000000  x26 000000757932c5a6  x27 00000075793470a2
01-01 00:00:58.712  1680  1680 F DEBUG   :     x28 000000748164e000  x29 0000000000000000
01-01 00:00:58.712  1680  1680 F DEBUG   :     sp  0000007fd2b7acb0  lr  00000075796f1874  pc  00000075796b3d8c
01-01 00:00:58.713  1622  1677 I PackageParser: Parse times for '/system/framework/framework-res.apk': parse=103ms, update_cache=17 ms
01-01 00:00:58.816  1622  1622 I PackageManager: /system/framework/framework-res.apk changed; collecting certs
01-01 00:00:58.824  1622  1622 E PackageManager: Adding duplicate shared id: 1000 name=android
01-01 00:00:58.872  1622  1622 I PackageManager: /system/priv-app/CtsShimPrivPrebuilt changed; collecting certs
01-01 00:00:58.911  1622  1622 I PackageManager: /system/priv-app/NetworkStack changed; collecting certs
01-01 00:00:58.933  1622  1622 E PackageManager: Adding duplicate shared id: 1073 name=com.android.networkstack
01-01 00:00:58.948  1622  1622 I PackageManager: New shared user android.uid.shared: id=10049
01-01 00:00:58.948  1622  1622 I PackageManager: /system/priv-app/UserDictionaryProvider changed; collecting certs
01-01 00:00:58.955  1622  1622 E PackageManager: Adding duplicate app id: 10049 name=com.android.providers.userdictionary
01-01 00:00:58.960  1622  1686 I PackageParser: Parse times for '/system/priv-app/GmsCore': parse=94ms, update_cache=20 ms
01-01 00:00:58.970  1622  1622 I PackageManager: /system/priv-app/LocalTransport changed; collecting certs
01-01 00:00:58.971  1680  1680 F DEBUG   : 
01-01 00:00:58.971  1680  1680 F DEBUG   : backtrace:
01-01 00:00:58.971  1680  1680 F DEBUG   :       #00 pc 000000000046ed8c  /vendor/lib64/egl/libGLESv2_swiftshader.so (sw::clear(unsigned int*, unsigned int, unsigned long)+36) (BuildId: 043b9d9a663e1002807fd7ee42340fb7)
01-01 00:00:58.971  1680  1680 F DEBUG   :       #01 pc 00000000004ac870  /vendor/lib64/egl/libGLESv2_swiftshader.so (sw::Blitter::fastClear(void*, sw::Format, sw::Surface*, sw::SliceRectT<int> const&, unsigned int)+848) (BuildId: 043b9d9a663e1002807fd7ee42340fb7)
01-01 00:00:58.971  1680  1680 F DEBUG   :       #02 pc 00000000004ac464  /vendor/lib64/egl/libGLESv2_swiftshader.so (sw::Blitter::clear(void*, sw::Format, sw::Surface*, sw::SliceRectT<int> const&, unsigned int)+60) (BuildId: 043b9d9a663e1002807fd7ee42340fb7)
01-01 00:00:58.971  1680  1680 F DEBUG   :       #03 pc 000000000049ccb8  /vendor/lib64/egl/libGLESv2_swiftshader.so (sw::Renderer::clear(void*, sw::Format, sw::Surface*, sw::RectT<int> const&, unsigned int)+40) (BuildId: 043b9d9a663e1002807fd7ee42340fb7)
01-01 00:00:58.971  1680  1680 F DEBUG   :       #04 pc 00000000003fa4a8  /vendor/lib64/egl/libGLESv2_swiftshader.so (es2::Device::clearColor(float, float, float, float, unsigned int)+208) (BuildId: 043b9d9a663e1002807fd7ee42340fb7)
01-01 00:00:58.971  1680  1680 F DEBUG   :       #05 pc 00000000003f5d4c  /vendor/lib64/egl/libGLESv2_swiftshader.so (es2::Context::clear(unsigned int)+188) (BuildId: 043b9d9a663e1002807fd7ee42340fb7)
01-01 00:00:58.972  1680  1680 F DEBUG   :       #06 pc 00000000003ff794  /vendor/lib64/egl/libGLESv2_swiftshader.so (gl::Clear(unsigned int)+100) (BuildId: 043b9d9a663e1002807fd7ee42340fb7)
01-01 00:00:58.972  1680  1680 F DEBUG   :       #07 pc 000000000012642c  /system/lib64/libsurfaceflinger.so (android::renderengine::gl::GLESRenderEngine::clearWithColor(float, float, float, float)+100) (BuildId: 4f96534f5e65507697582d47eb972b19)
01-01 00:00:58.972  1680  1680 F DEBUG   :       #08 pc 0000000000128048  /system/lib64/libsurfaceflinger.so (android::renderengine::gl::GLESRenderEngine::drawLayers(android::renderengine::DisplaySettings const&, std::__1::vector<android::renderengine::LayerSettings, std::__1::allocator<android::renderengine::LayerSettings>> const&, ANativeWindowBuffer*, bool, android::base::unique_fd_impl<android::base::DefaultCloser>&&, android::base::unique_fd_impl<android::base::DefaultCloser>*)+504) (BuildId: 4f96534f5e65507697582d47eb972b19)
01-01 00:00:58.972  1680  1680 F DEBUG   :       #09 pc 00000000000e4880  /system/lib64/libsurfaceflinger.so (android::SurfaceFlinger::doComposeSurfaces(android::sp<android::DisplayDevice> const&, android::Region const&, android::base::unique_fd_impl<android::base::DefaultCloser>*)+4552) (BuildId: 4f96534f5e65507697582d47eb972b19)
01-01 00:00:58.972  1680  1680 F DEBUG   :       #10 pc 00000000000e0580  /system/lib64/libsurfaceflinger.so (android::SurfaceFlinger::handleMessageRefresh()+3232) (BuildId: 4f96534f5e65507697582d47eb972b19)
01-01 00:00:58.972  1680  1680 F DEBUG   :       #11 pc 00000000000df650  /system/lib64/libsurfaceflinger.so (android::SurfaceFlinger::onMessageReceived(int)+10016) (BuildId: 4f96534f5e65507697582d47eb972b19)
01-01 00:00:58.972  1680  1680 F DEBUG   :       #12 pc 0000000000017dfc  /system/lib64/libutils.so (android::Looper::pollInner(int)+332) (BuildId: c86d46eeaacfed7a211e91a3841ad05d)
01-01 00:00:58.973  1680  1680 F DEBUG   :       #13 pc 0000000000017c10  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+56) (BuildId: c86d46eeaacfed7a211e91a3841ad05d)
01-01 00:00:58.973  1680  1680 F DEBUG   :       #14 pc 00000000000ccf2c  /system/lib64/libsurfaceflinger.so (android::impl::MessageQueue::waitMessage()+92) (BuildId: 4f96534f5e65507697582d47eb972b19)
01-01 00:00:58.973  1680  1680 F DEBUG   :       #15 pc 00000000000dbe1c  /system/lib64/libsurfaceflinger.so (android::SurfaceFlinger::run()+20) (BuildId: 4f96534f5e65507697582d47eb972b19)
01-01 00:00:58.973  1680  1680 F DEBUG   :       #16 pc 0000000000003370  /system/bin/surfaceflinger (main+800) (BuildId: 9210356d1fe78f4557eeabdbe0cd5936)
01-01 00:00:58.973  1680  1680 F DEBUG   :       #17 pc 000000000007d844  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: 642696a9594fbdd90f9aeb0bb5d31eb5)

yingbin ma

unread,
Oct 9, 2020, 4:59:26 AM10/9/20
to swiftshader
Do you have some idea, thanks very much for taking a look for my log.    

Alexis Hétu

unread,
Oct 9, 2020, 1:18:58 PM10/9/20
to yingbin ma, swiftshader
I don't know what it is for sure, but it looks like the memory passed to sw::Clear is invalid, which is why it crashes when attempting to write to it. There's probably an external surface coming from Android which isn't setup properly.

Also, I will point this out:
You said: "build use arm 32bit userdebug successfully"
Your log: 01-01 00:00:58.710  1680  1680 F DEBUG   : ABI: 'arm64'  
Those are not compatible.

Also note: In the next months, SwiftShader GL will be deprecated in favor of ANGLE (https://chromium.googlesource.com/angle/angle) on top of SwiftShader's Vulkan library.

--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/5c2f8e18-23b3-4943-9658-094461eeb874n%40googlegroups.com.

yingbin ma

unread,
Oct 9, 2020, 9:29:02 PM10/9/20
to swiftshader
Sorry,I mistake the build information, I select arm64bit. 
You said: " The memory  passed to sw::Clear is invalid?“
But when the android boot animation use, no other use swiftshader, 
I config the system.prop as follows:
persist.sys.ui.hw=disable
ro.opengles.version 196608
ro.sf.lcd_density=160
ro.hardware.egl=swiftshader

and compile the offical swiftshader code. Any other points should I notice for android Q use swiftshader? 

yingbin ma

unread,
Oct 9, 2020, 9:37:06 PM10/9/20
to swiftshader
the log txt see the attachment, please take a look.
omni_logcat_swift_fail.txt

Alexis Hétu

unread,
Oct 10, 2020, 9:51:02 AM10/10/20
to yingbin ma, swiftshader
Sorry, I have no idea what your issue is. You might want to try asking you question on https://groups.google.com/g/android-building, they're probably going to be more helpful than us on setting up your Android environment properly.

From what I can see, it's trying to clear the memory from a ANativeWindowBuffer object. I don't have any information on why the memory might be invalid. You probably want to ask other people who have already done what you are attempting to do.

Nicolas Capens

unread,
Oct 10, 2020, 2:39:14 PM10/10/20
to Alexis Hétu, yingbin ma, swiftshader
Hi yingbin,

Unfortunately SwiftShader is not meant to be used as the system's graphics driver on a device which also has a GPU. The 'gralloc' module, responsible for allocating graphics memory, is GPU- and HWC-specific and SwiftShader generally can't access this memory.

SwiftShader can be used on virtual devices, like with the Android Emulator, where the gralloc implementation is compatible with both SwiftShader and the emulator's virtual display and other components. SwiftShader can only be used on physical devices by having applications load it in user space, leaving the GPU and HWC to perform system level graphics.

In theory some devices could support running SwiftShader at the system level if their gralloc implementation can be adapted to it. If you have a business use case for this I suggest reaching out to the Android vendor support engineers who can investigate your use case more closely.

Best regards,
Nicolas

yingbin ma

unread,
Oct 12, 2020, 10:55:01 PM10/12/20
to swiftshader
Hi,  all: 
ohh,thanks very much for my issue, any access to get the gralloc.so  that supported SwiftShader ?  I just want to do some personal try.
Reply all
Reply to author
Forward
0 new messages