Closed Bug 777495 Opened 12 years ago Closed 12 years ago

Failing to allocate gralloc buffer with A8 format

Categories

(Core :: Widget, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17
blocking-basecamp +

People

(Reporter: daleharvey, Assigned: kanru)

References

Details

Attachments

(1 file)

Open the UI Tests on the device, when you attempt to scroll down, gecko crashes. Relevant adb logs are:

I/IdleService( 2207): next timeout 1343249073499051 usec (1000 msec from now)
I/IdleService( 2207): SetTimerExpiryIfBefore: next timeout 1343249073499051 usec
I/IdleService( 2207): reset timer expiry from 0 usec to 1343249073509051 usec
I/IdleService( 2207): Reset idle timeout: tell observer baa838 user is back
D/memalloc( 2207): /dev/pmem: Allocated buffer base:0x49477000 size:614400 offset:614400 fd:93
D/memalloc( 2207): /dev/pmem: Allocated buffer base:0x49477000 size:532480 offset:1228800 fd:98
E/memalloc( 2207): unrecognized pixel format: 8
W/GraphicBufferAllocator( 2207): alloc(320, 396, 8, 00000133, ...) failed -22 (Invalid argument)
F/libc    ( 2207): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
I/DEBUG   ( 2205): debuggerd committing suicide to free the zombie!
I/DEBUG   ( 2293): debuggerd: Jul 25 2012 07:42:30
E/AudioHardwareMSM76XXA( 2294): failed to open AUDIO_NORMAL_FILTER /system/etc/AudioFilter.csv: No such file or directory (2).
E/AudioHardwareMSM76XXA( 2294): failed to open AUTO_VOLUME_CONTROL /system/etc/AutoVolumeControl.txt: No such file or directory (2)
E/QualcommCamera( 2294): Qint android::get_number_of_cameras(): E
I/QualcommCameraHardware( 2294): getCameraInfo: IN
I/QualcommCameraHardware( 2294): getCameraInfo: loading libqcamera at 0xb000ed10
V/QualcommCameraHardware( 2294):  Storing the current target type as 3 
I/QualcommCameraHardware( 2294): getCameraInfo: numOfCameras = 1
I/QualcommCameraHardware( 2294): Camera sensor 0 info:
I/QualcommCameraHardware( 2294): camera_id: 0
I/QualcommCameraHardware( 2294): modes_supported: 5
I/QualcommCameraHardware( 2294): position: 0
I/QualcommCameraHardware( 2294): sensor_mount_angle: 90
V/QualcommCameraHardware( 2294): getCameraInfo: dlclose(libqcamera)
I/QualcommCameraHardware( 2294): getCameraInfo: OUT
W/AudioFlinger( 2294): Thread AudioOut_1 cannot connect to the power manager service
W/AudioHardwareMSM76XXA( 2294): rpc_snd_set_device(6, 1, 1)
E/profiler( 2295): Registering start signal
I/Gonk    ( 2295): Socket open for RIL
I/VolumeManager( 2295): Connected to vold
I/VolumeManager( 2295): Volume sdcard: changing state from Init to Mounted (0 observers)
D/VoldCmdListener(  100): volume list
I/AutoMounter( 2295): UpdateState: umsAvail:1 umsEnabled:1 mode:0 usbCablePluggedIn:1 tryToShare:0
I/AutoMounter( 2295): UpdateState: Volume sdcard is Mounted and inserted
D/CALCFPS ( 2295): DEBUG_CALC_FPS: 0
Here's the relevant part

E/memalloc( 2207): unrecognized pixel format: 8
W/GraphicBufferAllocator( 2207): alloc(320, 396, 8, 00000133, ...) failed -22 (Invalid argument)
F/libc    ( 2207): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

If the pixel format reported there is derived from PixelFormat, then it appears we're asking for

    PIXEL_FORMAT_A_8

which is totally legit.  This is probably our accelerated masking code allocating, which uses an A8 mask.  Our YUV shaders also want to work on A8 surfaces/textures.

Any suggestions on what we should do, oh oracles? ;)
OS: Mac OS X → Gonk
Hardware: x86 → ARM
Summary: Panning down crashes app → Failing to allocate gralloc buffer with A8 format (?)
So we need to stick to the HAL pixel formats.

There are really two bugs here
 - we crash when we don't get A8, instead of falling back on sysmem+upload
 - we're not able to gralloc with A8

Definitely need to fix the first issue first.  If we're frequently regenerating masks for mask layers, we're just going to completely lose anyway, the optimization fails.  So sysmem+upload shouldn't be so bad.

We'll probably need some GL wizardry to allocate a non-A8 gralloc buffer and use it the right way in our shaders.
Summary: Failing to allocate gralloc buffer with A8 format (?) → Failing to allocate gralloc buffer with A8 format
noming for basecamp blocking.   bug 777197 is affected.
blocking-basecamp: --- → ?
Kan-Ru are you taking this?
Re: comment 2, let's fix the fallback path first.
Assignee: nobody → kchen
It turns out we already have fallback path but just not been used.
Attachment #646399 - Flags: review?(jones.chris.g)
Comment on attachment 646399 [details] [diff] [review]
Fallback to TexImage2D if unable to allocate gralloc buffer.

This fixes the crash.

It took me a while to understand *why* it fixes the crash, but I understand now :).  Nice fix.
Attachment #646399 - Flags: review?(jones.chris.g) → review+
https://hg.mozilla.org/mozilla-central/rev/4bfa8a24fe41
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
blocking-basecamp: ? → +
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: