FORTIFY_SOURCE: FD_SET: file descriptor> = FD_SETSIZE. Call abort ()

I am an Android programmer.

Today I launched one Android application that received such errors.

FORTIFY_SOURCE: FD_SET: file descriptor> = FD_SETSIZE. Call abort ().

so please if anyone knows this answer for this problem, answer me.

+8
android
source share
1 answer

Too many file descriptors or sockets are open in your process, and when the OS limit is reached, your application will be killed.

It is very unlikely that your application is legally using all the resources, most likely this is a leak. Most likely, you will miss the Close () call on the socket or file resource.

I met this problem on different Android devices with the same code. The most common error signature was:

01-27 15:50:52.431 I/DEBUG ( 172): pid: 12444, tid: 19014, oom: 0, name: DrmRequestHandl >>> YOUR_PACKAGE_NAME <<< 01-27 15:50:52.431 I/DEBUG ( 172): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 01-27 15:50:52.517 I/DEBUG ( 172): Abort message: 'FORTIFY_SOURCE: FD_SET: file descriptor >= FD_SETSIZE. Calling abort().' 

You can check the descriptor limit on your device:

 adb shell ulimit -n 

As a first step to solving the problem, you may need to find out what resources are flowing. You can determine the process id of your application:

  adb shell ps 

Then, using the process ID while your application is still running, you can check the open descriptors (you need root access):

 adb shell ls -l /proc/[YOUR_PROCESS_ID]/fd 

For process 12345, it will be something like:

 adb shell ls -l /proc/12345/fd 

Descriptors are listed here. On older versions of Android, you can have 1024 items in the list, on Lollipop I saw 2048 as the default limit.

+13
source share

All Articles