Closed Bug 611163 Opened 14 years ago Closed 13 years ago

Fennec doesn't start due a problem with "ashmem buffer" in DDMS

Categories

(Firefox for Android Graveyard :: General, defect, P4)

All
Android
defect

Tracking

(fennec2.0+)

VERIFIED FIXED
Firefox 4.0
Tracking Status
fennec 2.0+ ---

People

(Reporter: willyaranda, Assigned: blassey)

References

Details

(Keywords: crash, mobile, Whiteboard: [has patch][has review][needs approval])

Attachments

(3 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8pre) Gecko/20101110 Firefox/4.0b8pre
Build Identifier: 

Fennec crashes with a problem with ashmem buffer. 

Reproducible: Always




11-11 00:52:31.046: INFO/ActivityManager(295): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.mozilla.fennec/.App }
11-11 00:52:31.156: INFO/ActivityManager(295): Start proc org.mozilla.fennec for activity org.mozilla.fennec/.App: pid=4503 uid=10056 gids={3003, 1015}
11-11 00:52:31.666: INFO/GeckoApp(4503): create
11-11 00:52:31.676: INFO/GeckoAppJava(4503): Checking for an update
11-11 00:52:31.686: INFO/global(4503): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
11-11 00:52:31.716: INFO/GeckoApp(4503): env0: null
11-11 00:52:31.726: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.726: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.726: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.726: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.736: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.736: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.736: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.736: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.736: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.746: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.746: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.746: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.746: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.746: ERROR/GeckoLibLoad(4503): Couldn't get an ashmem buffer
11-11 00:52:31.756: ERROR/GeckoLibLoad(4503): Couldn't get a handle to libxul!
11-11 00:52:32.146: INFO/GeckoAppJava(4503): installing extension : extensions/feedback@mobile.mozilla.org.xpi
11-11 00:52:32.266: INFO/ActivityManager(295): Process com.rs.autokiller (pid 4444) has died.
11-11 00:52:32.266: INFO/DEBUG(63): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-11 00:52:32.266: INFO/DEBUG(63): Build fingerprint: 'google/passion/passion/mahimahi:2.2/FRF91/43546:user/release-keys'
11-11 00:52:32.266: INFO/DEBUG(63): pid: 4503, tid: 4503  >>> org.mozilla.fennec <<<
11-11 00:52:32.266: INFO/DEBUG(63): signal 11 (SIGSEGV), fault addr 00000000
11-11 00:52:32.266: INFO/DEBUG(63):  r0 0000aa50  r1 30def038  r2 00008a68  r3 00000000
11-11 00:52:32.266: INFO/DEBUG(63):  r4 7ef1c520  r5 00000000  r6 30def038  r7 2cb36c4c
11-11 00:52:32.266: INFO/DEBUG(63):  r8 7ef1c500  r9 2cb36c44  10 2cb36c30  fp 7ef1c870
11-11 00:52:32.266: INFO/DEBUG(63):  ip 41104681  sp 7ef1c4f8  lr 41104693  pc 00000000  cpsr 00000010
11-11 00:52:32.266: INFO/DEBUG(63): cannot get registers: I/O error
11-11 00:52:32.336: INFO/DEBUG(63):          #00  pc 00000000  
11-11 00:52:32.336: INFO/DEBUG(63):          #01  lr 41104693  /data/data/org.mozilla.fennec/lib/libmozutils.so
11-11 00:52:32.336: INFO/DEBUG(63): code around pc:
11-11 00:52:32.336: INFO/DEBUG(63): code around lr:
11-11 00:52:32.336: INFO/DEBUG(63): 41104670 58984a02 bf004770 00005664 00008a68 
11-11 00:52:32.336: INFO/DEBUG(63): 41104680 bf004b04 b510a200 4a03189b 685b189b 
11-11 00:52:32.336: INFO/DEBUG(63): 41104690 bd104798 0000564c 00008a68 bf004b05 
11-11 00:52:32.336: INFO/DEBUG(63): 411046a0 0c00f20f 4463b510 c00cf8df 689b4463 
11-11 00:52:32.336: INFO/DEBUG(63): 411046b0 bd104798 00005630 00008a68 bf004b05 
11-11 00:52:32.336: INFO/DEBUG(63): stack:
11-11 00:52:32.336: INFO/DEBUG(63):     7ef1c4b8  2cb36c30  
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4bc  6fd0be1d  /system/lib/libc.so
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4c0  0011c9b0  [heap]
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4c4  001248a0  [heap]
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4c8  00001404  
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4cc  0000ccc8  [heap]
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4d0  2cb36c30  
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4d4  0011c9b0  [heap]
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4d8  00000000  
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4dc  00000000  
11-11 00:52:32.346: INFO/DEBUG(63):     7ef1c4e0  001248a0  [heap]
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c4e4  6fd0cd65  /system/lib/libc.so
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c4e8  0011c9b0  [heap]
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c4ec  6ca41a6b  /system/lib/libdvm.so
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c4f0  df002777  
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c4f4  e3a070ad  
11-11 00:52:32.356: INFO/DEBUG(63): #00 7ef1c4f8  7ef1c520  [stack]
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c4fc  6ca10d78  /system/lib/libdvm.so
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c500  0000ccc8  [heap]
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c504  2cd48398  /dalvik-LinearAlloc (deleted)
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c508  30def038  /mspace/dalvik-heap/2 (deleted)
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c50c  2cb36c44  
11-11 00:52:32.356: INFO/DEBUG(63):     7ef1c510  6ca10f40  /system/lib/libdvm.so
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c514  0000ccc8  [heap]
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c518  7ef1c520  [stack]
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c51c  6ca3c827  /system/lib/libdvm.so
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c520  2cb36c44  
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c524  2e62cb2a  /data/dalvik-cache/mnt@asec@org.mozilla.fennec-2@pkg.apk@classes.dex
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c528  41104681  /data/data/org.mozilla.fennec/lib/libmozutils.so
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c52c  7ef1c5d0  [stack]
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c530  7ef1c5d0  [stack]
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c534  00000001  
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c538  00000000  
11-11 00:52:32.366: INFO/DEBUG(63):     7ef1c53c  2cd48398  /dalvik-LinearAlloc (deleted)
11-11 00:52:32.906: INFO/BootReceiver(295): Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBSTONE)
11-11 00:52:32.926: WARN/DropBoxManagerService(295): Dropping: SYSTEM_TOMBSTONE (10 > 0 bytes)
11-11 00:52:32.936: INFO/ActivityManager(295): Process org.mozilla.fennec (pid 4503) has died.
11-11 00:52:32.936: INFO/WindowManager(295): WIN DEATH: Window{3101a648 org.mozilla.fennec/org.mozilla.fennec.App paused=false}
11-11 00:52:32.936: INFO/UsageStats(295): Unexpected resume of org.adw.launcher while already resumed in org.mozilla.fennec
11-11 00:52:32.976: WARN/InputManagerService(295): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@31512990



Forking from bug 606194. Answering bug 606194 comment 13, I haven't checked if this was caused by bug 607534.

Having the same problem with AOSP 2.2.1 and CM6.1pre.
Assignee: nobody → mwu
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0+
Status: UNCONFIRMED → NEW
Ever confirmed: true
12-02 15:35:06.641: INFO/GeckoAppJava(6550): installing extension : extensions/feedback@mobile.mozilla.org.xpi
12-02 15:35:06.781: INFO/DEBUG(62): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-02 15:35:06.781: INFO/DEBUG(62): Build fingerprint: 'google/passion/passion/mahimahi:2.2.1/FRG83/60505:user/release-keys'
12-02 15:35:06.781: INFO/DEBUG(62): pid: 6550, tid: 6550  >>> org.mozilla.fennec <<<
12-02 15:35:06.781: INFO/DEBUG(62): signal 11 (SIGSEGV), fault addr 00000000
12-02 15:35:06.781: INFO/DEBUG(62):  r0 0000aa48  r1 440435b0  r2 00008a68  r3 00000000
12-02 15:35:06.781: INFO/DEBUG(62):  r4 bef7c468  r5 00000000  r6 440435b0  r7 4104bc24
12-02 15:35:06.781: INFO/DEBUG(62):  r8 bef7c448  r9 4104bc1c  10 4104bc08  fp bef7c7b8
12-02 15:35:06.781: INFO/DEBUG(62):  ip 8080469d  sp bef7c440  lr 808046af  pc 00000000  cpsr 80000010
12-02 15:35:06.781: INFO/DEBUG(62): cannot get registers: I/O error
12-02 15:35:06.891: INFO/DEBUG(62):          #00  pc 00000000  
12-02 15:35:06.891: INFO/DEBUG(62):          #01  lr 808046af  /data/data/org.mozilla.fennec/lib/libmozutils.so
12-02 15:35:06.891: INFO/DEBUG(62): code around pc:
12-02 15:35:06.891: INFO/DEBUG(62): code around lr:
12-02 15:35:06.901: INFO/DEBUG(62): 8080468c 58984a02 bf004770 00005664 00008a68 
12-02 15:35:06.901: INFO/DEBUG(62): 8080469c bf004b04 b510a200 4a03189b 685b189b 
12-02 15:35:06.901: INFO/DEBUG(62): 808046ac bd104798 0000564c 00008a68 bf004b05 
12-02 15:35:06.901: INFO/DEBUG(62): 808046bc 0c00f20f 4463b510 c00cf8df 689b4463 
12-02 15:35:06.901: INFO/DEBUG(62): 808046cc bd104798 00005630 00008a68 bf004b05 
12-02 15:35:06.901: INFO/DEBUG(62): stack:
12-02 15:35:06.901: INFO/DEBUG(62):     bef7c400  4104bc08  
12-02 15:35:06.901: INFO/DEBUG(62):     bef7c404  afd0c04d  /system/lib/libc.so
12-02 15:35:06.901: INFO/DEBUG(62):     bef7c408  aca11040  /system/lib/libdvm.so
12-02 15:35:06.901: INFO/DEBUG(62):     bef7c40c  0000cd58  [heap]
12-02 15:35:06.901: INFO/DEBUG(62):     bef7c410  00001418  
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c414  b0003587  /system/bin/linker
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c418  b0015954  
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c41c  00223350  [heap]
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c420  00000000  
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c424  00000000  
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c428  00223288  [heap]
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c42c  afd0cf99  /system/lib/libc.so
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c430  00223350  [heap]
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c434  aca44977  /system/lib/libdvm.so
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c438  df002777  
12-02 15:35:06.911: INFO/DEBUG(62):     bef7c43c  e3a070ad  
12-02 15:35:06.911: INFO/DEBUG(62): #00 bef7c440  bef7c468  [stack]
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c444  aca10e78  /system/lib/libdvm.so
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c448  0000cd58  [heap]
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c44c  41260b3c  /dalvik-LinearAlloc (deleted)
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c450  440435b0  /mspace/dalvik-heap/2 (deleted)
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c454  4104bc1c  
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c458  aca11040  /system/lib/libdvm.so
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c45c  0000cd58  [heap]
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c460  bef7c468  [stack]
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c464  aca3f2c7  /system/lib/libdvm.so
12-02 15:35:06.921: INFO/DEBUG(62):     bef7c468  4104bc1c  
12-02 15:35:06.931: INFO/DEBUG(62):     bef7c46c  429b2be0  /cache/dalvik-cache/data@app@org.mozilla.fennec-1.apk@classes.dex
12-02 15:35:06.931: INFO/DEBUG(62):     bef7c470  8080469d  /data/data/org.mozilla.fennec/lib/libmozutils.so
12-02 15:35:06.931: INFO/DEBUG(62):     bef7c474  bef7c518  [stack]
12-02 15:35:06.931: INFO/DEBUG(62):     bef7c478  bef7c518  [stack]
12-02 15:35:06.931: INFO/DEBUG(62):     bef7c47c  00000001  
12-02 15:35:06.931: INFO/DEBUG(62):     bef7c480  00000000  
12-02 15:35:06.931: INFO/DEBUG(62):     bef7c484  41260b3c  /dalvik-LinearAlloc (deleted)
12-02 15:35:08.081: INFO/ActivityManager(111): Process org.mozilla.fennec (pid 6550) has died.
12-02 15:35:08.081: INFO/WindowManager(111): WIN DEATH: Window{443228c8 org.mozilla.fennec/org.mozilla.fennec.App paused=false}
12-02 15:35:08.081: INFO/UsageStats(111): Unexpected resume of org.adw.launcher while already resumed in org.mozilla.fennec


is the new problems with latest Cyanogen 6.1 build in Acer Liquid. Do you need some libs map or something to try to fix this error?
OS: Other → Android
Hardware: Other → All
Won't be able to look at this.
Assignee: mwu → nobody
I keep getting user comments about this crash from Acer Liquid E users.
Severity: normal → blocker
Priority: -- → P4
Assignee: nobody → blassey.bugs
Attached patch patch (obsolete) — Splinter Review
Attachment #510450 - Flags: review?(tglek)
Comment on attachment 510450 [details] [diff] [review]
patch

This is wrong. 
a) Ashmem failing seems like a bug in cyanogen mod
b) we should mmap a chunk of anonymous memory IF we decide ashmem isn't working
Attachment #510450 - Flags: review?(tglek) → review-
Attachment #510450 - Attachment is obsolete: true
Attachment #510457 - Flags: review?(tglek)
Attachment #510457 - Flags: review?(tglek) → review+
pushed http://hg.mozilla.org/mozilla-central/rev/7dce529f72b2 for logging.

Guillermo, can you please re-test with tomorrow's nightly and report what you get on the log?
Whiteboard: FIXED?
Can we get an update on this issue?
Attachment #510450 - Attachment is obsolete: false
Attachment #510457 - Attachment description: patch → logging patch for more info
tracking-fennec: 2.0+ → 2.0-
Keywords: crash, mobile
we 2.0-'d this because we didn't get an updated log with the updated logging, now we do from bug 637174 (attachment 516621 [details]), specifically the error is:

E/GeckoLibLoad( 7335): Couldn't open dev/ashmem, Error 22, Invalid argument
Keywords: crash, mobile
Whiteboard: FIXED? → crash, mobile
QA has an Ideos Tablet S7 if you need a device to test against ping me or Tony.
Brad's build starts up properly for me on a borrowed Ideos, so I can confirm the patch fixes the bug.
Comment on attachment 510450 [details] [diff] [review]
patch

based on Alon's test I'm re-requesting review because this is happening with a shipping ROM and this patch fixes it.
Attachment #510450 - Flags: review- → review?(tglek)
tracking-fennec: 2.0- → ?
Keywords: crash, mobile
Whiteboard: crash, mobile → [has patch][needs review]
Comment on attachment 510450 [details] [diff] [review]
patch

Alon, can you run df on the device that's having this issue? I'm curious why ashmem creation is failing.



>+      __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get an ashmem buffer, using a file");
>+      char fullpath[256];
There should be something like MAX_PATH or PATH_MAX on android

>+      snprintf(fullpath, 256, "%s/%s", getenv("CACHE_PATH"), path + 4);
>+      fd = open(fullpath, O_RDWR | O_CREAT);
>+      if (fd < 0) {

>+        __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't create a file either, giving up");
>+        return NULL;
>+      }
>+      // we'd like to use fallocate here, but it doesn't exist currently?
>+      lseek(fd, lib_size - 1, SEEK_SET);
>+      write(fd, "", 1);
Need to check errors here

>+      cache_fd = 0;
>+      addLibCacheFd(path + 4, fd);
>     }
>+    
>     buf = mmap(NULL, lib_size,
>                PROT_READ | PROT_WRITE,
>                MAP_SHARED, fd, 0);
>@@ -518,10 +530,12 @@ static void * mozload(const char * path,
> 
>     offset = 0;
> 
>-    if (cache_fd < 0) {
>+    if (cache_fd <= 0)


== -1 or < 0 is correct. 


I think instead adding a complicated fallback, we should move the if(extractLibs) logic above this code down and fallback on that when ashmem creation fails.
Attachment #510450 - Flags: review?(tglek) → review-
From the Ideos S7
df
/dev: 212548K total, 16K used, 212532K available (block size 4096)
/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size 4096)
/system: 163840K total, 123652K used, 40188K available (block size 4096)
/data: 179200K total, 68628K used, 110572K available (block size 4096)
/cache: 98304K total, 1160K used, 97144K available (block size 4096)
/sdcard: 7903232K total, 24512K used, 7878720K available (block size 32768)
Attached patch patch (obsolete) — Splinter Review
addresses review comments
Attachment #510450 - Attachment is obsolete: true
Attachment #517012 - Flags: review?(tglek)
Attached patch patchSplinter Review
sorry, wrong patch
Attachment #517012 - Attachment is obsolete: true
Attachment #517016 - Flags: review?(tglek)
Attachment #517012 - Flags: review?(tglek)
Comment on attachment 517016 [details] [diff] [review]
patch

>+      }
>+      skipLibCache = true;
>+      addLibCacheFd(path + 4, fd);
>     }
>+    

Extra whitespace above.


Should try using ftruncate(fallocate turned out to not work great) instead of seek/write in some followup bug.
Attachment #517016 - Flags: review?(tglek) → review+
Whiteboard: [has patch][needs review] → [has patch][has review][needs approval]
Comment on attachment 510457 [details] [diff] [review]
logging patch for more info

debug android change.
Attachment #510457 - Flags: approval2.0+
Attachment #517016 - Flags: approval2.0+
tracking-fennec: ? → 2.0+
pushed http://hg.mozilla.org/mozilla-central/rev/8ff955555d86
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment on attachment 517016 [details] [diff] [review]
patch

>+        __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "writting one byte to the file failed");

"Writting". ;)
Guillermo (or somebody else with the right device), can you verify this problem doesn't occur anymore?
I'm a user that submitted a DR that turned out to be a dupe of this one.  I installed a nightly last week and the bug had been fixed.  Thanks.
jwwatki@gmail.com , thanks!
Marking verified fixed then.
Status: RESOLVED → VERIFIED
Target Milestone: --- → Firefox 4.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: