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

gralloc_gbm: avoid SIGFPE for unsupported HAL pixel formats #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maurossi
Copy link
Contributor

gralloc_gbm_get_bpp() can return 0 for unsupported HAL pixel formats and this is causing segfaults with Android CTS 13 dEQP-EGL test runs due to division by zero

Checking bpp value before proceeding in gralloc_gbm_get_bpp() routines fixes the following segfaults observed with HAL Pixel Formats 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x38

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'Android-x86/android_x86_64/x86_64:13/TD1A.221105.001.A1/utente11130028:userdebug/test-keys' Revision: '0'
ABI: 'x86_64'
Timestamp: 2022-11-20 10:28:47.732248178+0100
Process uptime: 0s
Cmdline: /vendor/bin/hw/[email protected] pid: 2128, tid: 3271, name: HwBinder:2128_2 >>> /vendor/bin/hw/[email protected] <<< uid: 1000
signal 8 (SIGFPE), code 1 (FPE_INTDIV), fault addr 0x000074607665c2b5
rax 0000000000000010 rbx 0000746146811cf0 rcx 0000000000000000 rdx 0000000000000000
r8 0000746116816a40 r9 0000000000000005 r10 0000000000000002 r11 0000000000000002
r12 0000000000000004 r13 0000000000000004 r14 000074607638f6a4 r15 000074613682ab60
rdi 000074612682e590 rsi 000000000000002f
rbp 0000746116816a30 rsp 000074607638f5b0 rip 000074607665c2b5

backtrace:
00 pc 00000000000042b5 /system/vendor/lib64/hw/gralloc.gbm.so (gralloc_gbm_bo_create+613) (BuildId: 60d9fa52075d801263edce2d9f64aa57)
01 pc 0000000000005926 /system/vendor/lib64/hw/gralloc.gbm.so (gbm_mod_alloc_gpu0(alloc_device_t*, int, int, int, int, native_handle const**, int*)+70) (BuildId: 60d9fa52075d801263edce2d9f64aa57)

gralloc_gbm_get_bpp() can return 0 for unsupported HAL pixel formats
and this is causing segfaults with Android CTS 13 dEQP-EGL test runs
due to division by zero

Checking bpp value before proceeding in gralloc_gbm_get_bpp() routines
fixes the following segfaults observed with HAL Pixel Formats
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x38

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Android-x86/android_x86_64/x86_64:13/TD1A.221105.001.A1/utente11130028:userdebug/test-keys'
Revision: '0'
ABI: 'x86_64'
Timestamp: 2022-11-20 10:28:47.732248178+0100
Process uptime: 0s
Cmdline: /vendor/bin/hw/[email protected]
pid: 2128, tid: 3271, name: HwBinder:2128_2  >>> /vendor/bin/hw/[email protected] <<<
uid: 1000
signal 8 (SIGFPE), code 1 (FPE_INTDIV), fault addr 0x000074607665c2b5
    rax 0000000000000010  rbx 0000746146811cf0  rcx 0000000000000000  rdx 0000000000000000
    r8  0000746116816a40  r9  0000000000000005  r10 0000000000000002  r11 0000000000000002
    r12 0000000000000004  r13 0000000000000004  r14 000074607638f6a4  r15 000074613682ab60
    rdi 000074612682e590  rsi 000000000000002f
    rbp 0000746116816a30  rsp 000074607638f5b0  rip 000074607665c2b5

backtrace:
      00 pc 00000000000042b5  /system/vendor/lib64/hw/gralloc.gbm.so (gralloc_gbm_bo_create+613) (BuildId: 60d9fa52075d801263edce2d9f64aa57)
      01 pc 0000000000005926  /system/vendor/lib64/hw/gralloc.gbm.so (gbm_mod_alloc_gpu0(alloc_device_t*, int, int, int, int, native_handle const**, int*)+70) (BuildId: 60d9fa52075d801263edce2d9f64aa57)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant