New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 690761 link

Starred by 2 users

Issue metadata

Status: Duplicate
Owner: ----
Closed: Jun 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

To many file descriptor opened, maybe lead to crash

Reported by wenyong....@alibaba-inc.com, Feb 10 2017

Issue description

In crash data we collected in UC Browser, we find sometimes the file descriptors opened up to hundreds of, even more than thousand. It easily exhausts file descriptors, even lead to crash.
The reason is too many  ResourceBuffer were created and lots of cache file were opened.



 
One of crash logs as follows (up to 576 http cache file were opend, path is /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/):

opened file count: 2001, write limit: 900.
opened files:
0 -> /dev/null
1 -> /dev/null
2 -> /dev/null
3 -> socket:[15483]
4 -> /sys/kernel/debug/tracing/trace_marker
5 -> socket:[16848]
6 -> /dev/hwlog_jank
......
1952 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/a4c53d53fa34fa38_0
1953 -> /dev/ashmem
1954 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/a6438ac695538483_0
1955 -> /dev/ashmem
1956 -> /dev/ashmem
1957 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/4cb754574cd86c12_0
1958 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/70c02fbdf76b3f45_0
1959 -> /dev/ashmem
1960 -> /dev/ashmem
1961 -> /dev/ashmem
1962 -> /dev/ashmem
1963 -> /dev/ashmem
1964 -> /dev/ashmem
1965 -> /dev/ashmem
1966 -> /dev/ashmem
1967 -> /dev/ashmem
1968 -> /dev/ashmem
1969 -> /dev/ashmem
1970 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/054252f349de7921_0
1971 -> /dev/ashmem
1972 -> /dev/ashmem
1973 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/782e959d5a5f7aa8_0
1974 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/ab153a036e931f4d_0
1975 -> /dev/ashmem
1976 -> /dev/ashmem
1977 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/da6f1fb569454f92_0
1978 -> /dev/ashmem
1979 -> /dev/ashmem
1980 -> /dev/ashmem
1981 -> /dev/ashmem
1982 -> /dev/ashmem
1983 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/54a919e2188cff97_0
1984 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/e744b6bcf2fc3549_0
1985 -> /dev/ashmem
1986 -> /dev/ashmem
1987 -> /dev/ashmem
1988 -> /dev/ashmem
1989 -> /dev/ashmem
1990 -> /dev/ashmem
1991 -> /dev/ashmem
1992 -> /dev/ashmem
1993 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/b6a4fd977f4d169c_0
1994 -> /dev/ashmem
1995 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/61e53e48566b0f8e_0
1996 -> /dev/ashmem
1997 -> /dev/ashmem
1998 -> /dev/ashmem
1999 -> /dev/ashmem
2000 -> /dev/ashmem
2001 -> /dev/ashmem
2002 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/b432a19e1c31568a_0
2003 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/1dd73a8c0312062e_0
2004 -> /dev/ashmem
2005 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/906f7ee0c566ec68_0
2006 -> /dev/ashmem
2007 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/0580945de34b1aa3_0
2008 -> /dev/ashmem
2009 -> /dev/ashmem
2010 -> /dev/ashmem
2011 -> /dev/ashmem
2012 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/5f6097c4c3ea655a_0
2013 -> /dev/ashmem
2014 -> /dev/ashmem
2015 -> /dev/ashmem
2016 -> /dev/ashmem
2017 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/de0505c0b3f785c8_0
2018 -> /dev/ashmem
2019 -> /dev/ashmem
2020 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/2a14b4d8eb12ecff_0
2021 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/6365757c8f73467a_0
2022 -> /dev/ashmem
2023 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/f7852f207394193a_0
2024 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/c99ce1d84a40dc8e_0
2025 -> /dev/ashmem
2026 -> /dev/ashmem
2027 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/d7dd5dfcd5bcc584_0
2028 -> /dev/ashmem
2029 -> /dev/ashmem
2031 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/08d9083b42dba73d_0
2032 -> /dev/ashmem
2033 -> /dev/ashmem
2034 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/9baabff8ba532dd0_0
2035 -> /dev/ashmem
2036 -> /data/data/com.UCMobile/app_core_ucmobile/cache/httpcache/9b42c5f95018d0b2_0
2037 -> /dev/ashmem
2038 -> /dev/ashmem
2039 -> /dev/ashmem
2040 -> /dev/ashmem
2041 -> /dev/ashmem
2043 -> /dev/ashmem
2044 -> /dev/ashmem
2045 -> /dev/ashmem
2046 -> /dev/ashmem
file_descriptor_ details.log
79.8 KB View Download

Comment 2 Deleted

Another list we collected in one version, the second column is the number of file descriptors used by ResourceBuffer.

type	count	leak-file	 log
file	722	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_vivo-X7_5.1.1_1480703737049_20161203034352_fg_jni.emg1-0-0-0_result.log
file	800	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_HUAWEI-TIT-CL10_5.1_1480836906225_20161204170442_fg_jni.emg1-0-0-0_result.log
file	779	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_Mi-4c_5.1.1_1480878944197_20161205054126_fg_jni.emg1-0-0-0_result.log
file	754	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_OPPO-R9s_6.0.1_1480565300395_20161201131822_fg_jni.emg1-0-0-0_result.log
file	591	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_vivo-Y23L_4.4.4_1480705350135_20161203045248_fg_jni.emg1-0-0-0_result.log
file	805	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_OPPO-R9tm_5.1_1480851495411_20161204232944_fg_jni.emg1-0-0-0_result.log
file	596	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_GT-I9502_4.3_1480710635299_20161203045015_fg_jni.emg1-0-0-0_result.log
file	1705	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_C730Lw_4.4.4_1480765795962_20161203201831_fg_jni.emg1-0-0-0_result.log
file	852	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_HM-NOTE-1LTETD_4.4.2_1480684591073_20161203155214_fg_jni.emg1-0-0-0_result.log
file	1121	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_m2_5.1_1480930066751_20161205173751_bg_jni.emg16-9-24-0-160924_result.log
file	746	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_A11_4.4.4_1480636667305_20161202201159_fg_jni.emg1-0-0-0_result.log
file	672	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_MI-NOTE-LTE_6.0.1_1480866906330_20161205002402_fg_jni.emg1-0-0-0_result.log
file	690	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_Le-X820_6.0.1_1480503223311_20161202181407_fg_jni.emg16-9-24-0-160924_result.log
file	1110	/dev/ashmem	 ./UCMobile_11.2.5.884_161130141238_A31_4.4.4_1480595070955_20161201203433_fg_jni.emg1-0-0-0_result.log

A complete list, please refer to the attachment.
ashmem.txt
171 KB View Download
Summary: We find 1320 crashs are caused by too many ResourceBuffer one week. Caused by many cache file descriptor is more.
Crash stack:
02-09 07:07:59.950  1344  1554 F libc    : FORTIFY_SOURCE: FD_SET: file descriptor >= FD_SETSIZE. Calling abort().

Process Name: 'com.UCMobile'
Thread Name: 'http1'
pid: 1344, tid: 1554  >>> com.UCMobile <<<
signal 6 (SIGABRT), code -6 (?), fault addr --------
  r0 00000000  r1 00000612  r2 00000006  r3 00000000
  r4 d6d11db8  r5 00000006  r6 0000000b  r7 0000010c
  r8 d6d11694  r9 d6d11728  10 0000003c  fp 00000002
  ip 00000612  sp d6d115e0  lr f72f7a05  pc f731b960  cpsr 60000010

    00   pc  0003b960  tgkill LINE:libc.so
    01   pc  00017a01  pthread_kill LINE:libc.so
    02   pc  00018667  raise LINE:libc.so
    03   pc  00014e27  __libc_android_abort LINE:libc.so
    04   pc  0001321c  abort LINE:libc.so
    05   pc  00016031  __libc_fatal LINE:libc.so
    06   pc  00016047  __fortify_chk_fail LINE:libc.so
    07   pc  00051add  __FD_SET_chk LINE:libc.so
    08   pc  0000adf5  /system/lib/libjavacrypto.so
    09   pc  0000f9ef  /system/lib/libjavacrypto.so
    10   pc  0030230b  /data/dalvik-cache/arm/system@framework@boot.oat
    
    at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native method)
    at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:323)
    at com.android.org.conscrypt.OpenSSLSocketImpl.waitForHandshake(OpenSSLSocketImpl.java:638)
    at com.android.org.conscrypt.OpenSSLSocketImpl.getSession(OpenSSLSocketImpl.java:802)
    at com.uc.base.net.apache.HttpsConnectionApacheImpl.connect(unavailable:-1)
                                                        doHandshakeAndValidateServerCertificates
                                                        verifyServerDomainAndCertificates
                                                        closeSocketThrowException
    at com.uc.base.net.apache.HttpsConnectionApacheImpl.openConnection(unavailable:-1)
    at com.uc.base.net.adaptor.Connection.processSession(unavailable:-1)
                                          getConnection
                                          createSocketFromDnsParse
                                          clearPipe
                                          httpFailure
    at com.uc.base.net.adaptor.ConnectionThread.run(unavailable:-1)

Comment 6 by liyin...@gmail.com, Feb 10 2017

02-09 07:07:59.950  1344  1554 F libc    : FORTIFY_SOURCE: FD_SET: file descriptor >= FD_SETSIZE. Calling abort().

It is the fatal log from android logcat before crash.
Labels: Needs-Feedback
Hi,

Is this issue related to Chrome? If so can you please provide clear steps to reproduce this issue along with Device Name / Model and OS version?

Hi, I'm sorry I didn't get to the point quickly enough.
UC Browser is based on the Chromium, the crash data are from online (end users). The scene to produce the issue is complicated, so we have no clear steps to reproduce.
The issue belongs to the Chromium, I think it is irrelated to platform. We solution to fix this issue is to limit the number(eg: 200) of ResourceBuffer to be created and the number of cache file to be opened. Most often, it has no effect to resource load. The limit may be exceeded only when exception happened, that is we want to fix.
Project Member

Comment 10 by sheriffbot@chromium.org, Feb 21 2017

Labels: -Needs-Feedback Needs-Review
Owner: rsgav...@chromium.org
Thank you for providing more feedback. Adding requester "rsgavara@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Owner: tedc...@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: tedc...@chromium.org dskiba@chromium.org
Owner: mariakho...@chromium.org
@mariakhomenko, any idea of what manages resourcebuffers?
Cc: csharrison@chromium.org mariakho...@chromium.org mmenke@chromium.org
Owner: ----
Status: Available (was: Assigned)
Summary: To many file descriptor opened, maybe lead to crash (was: To many file descriptor opened, maybe lead to crash)
No. Adding OWNERS from content/browser/loader here to comment.
Labels: -Needs-Review
Cleaning up sheriffbot label "Needs-Review" label as a part of modified "Needs-Feedback" sheriffbot rule. [ref bug for cleanup 684919]
Project Member

Comment 15 by sheriffbot@chromium.org, Apr 6 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: morlovich@chromium.org
+morlovich@ for the part on HttpCache holding onto many file descriptors. The attachment in #3 shows 576 file descriptors used by http cache and 1191(?) by ResourceBuffers. 
SimpleCache is supposed to be limited to 512 since M66 (which is newer than the report).

Huh, the other bug you commented on also had someone concerned about the ashmem things.

512 globally, or per SimpleCache instance?  does seem unlikely we'd have too many for the media cache, admittedly.
Globally.

Mergedinto: 799649
Status: Duplicate (was: Untriaged)
Consolidating bugs - though note, the issue is not fixed.

Sign in to add a comment