segment fault, but didn't generate core files,why?

46 views
Skip to first unread message

Weilai Xu

unread,
Jul 3, 2017, 10:52:54 PM7/3/17
to Android-x86
        Can someone give me some advice?This problem bothers me for a long time.
 I installed android-x86(5.0), wrote a small program, segment fault, but didn't generate core files.

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2017.07.04 10:45:07 =~=~=~=~=~=~=~=~=~=~=~=

root@x86:/data # cat /proc/sys/kernel/core_pattern                              
/data/77/%e-%p-%t.core  

root@x86:/data # ls -al |grep 77
drwxrwxrwx root     root              2017-07-04 01:54 77


root@x86:/data # cat /proc/sys/fs/suid_dumpable                                 
1

root@x86:/data # ulimit -a
time(cpu-seconds)    unlimited

file(blocks)         unlimited
coredump(blocks)     0
data(KiB)            unlimited
stack(KiB)           8192
lockedmem(KiB)       64
nofiles(descriptors) 1024
processes            23853
sigpending           23853
msgqueue(bytes)      819200
maxnice              40
maxrtprio            0
resident-set(KiB)    unlimited
address-space(KiB)   unlimited

                                        


root@x86:/data # df
Filesystem               Size     Used     Free   Blksize
/                        1.5G     2.4M     1.5G   4096
/system                 37.4G     1.3G    36.1G   4096
/data                   37.4G     1.3G    36.1G   4096
/dev                     1.5G    24.0K     1.5G   4096
/sys/fs/cgroup           1.5G    12.0K     1.5G   4096
/mnt/asec                1.5G     0.0K     1.5G   4096
/mnt/obb                 1.5G     0.0K     1.5G   4096
/cache                   1.5G     0.0K     1.5G   4096
/mnt/shell/emulated     37.4G     1.3G    36.1G   4096
/data/77                37.4G    47.9M    37.4G   4096

root@x86:/data # /system/bin/testcore                                           

Hello test core.
Segmentation fault 
139|root@x86:/data # ls /data/77/*
/data/77/1.txt


root@x86:/data # mount
tmpfs / tmpfs ro,relatime 0 0

/dev/block/sda1 /system ext4 rw,relatime,data=ordered 0 0
/dev/block/sda1 /data ext4 rw,relatime,data=ordered 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
none /sys/fs/cgroup tmpfs rw,relatime,mode=750,gid=1000 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
pstore /sys/fs/pstore pstore rw,relatime 0 0
none /cache tmpfs rw,nosuid,nodev,noatime 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/sda7 /data/77 ext4 rw,relatime,data=ordered 0 0

root@x86:/data # df
Filesystem               Size     Used     Free   Blksize

/                        1.5G     2.4M     1.5G   4096
/system                 37.4G     1.3G    36.1G   4096
/data                   37.4G     1.3G    36.1G   4096
/dev                     1.5G    24.0K     1.5G   4096
/sys/fs/cgroup           1.5G    12.0K     1.5G   4096
/mnt/asec                1.5G     0.0K     1.5G   4096
/mnt/obb                 1.5G     0.0K     1.5G   4096
/cache                   1.5G     0.0K     1.5G   4096
/mnt/shell/emulated     37.4G     1.3G    36.1G   4096
/data/77                37.4G    47.9M    37.4G   4096
root@x86:/data # exit

root@x86:/ # 


Weilai Xu

unread,
Jul 5, 2017, 5:07:05 AM7/5/17
to Android-x86

I've solved it. I'll give you the idea

Meet a friend who has a similar problem

1,kernel config 

      CONFIG_ELF_CORE =y  CONFIG_COREDUMP=y

2, android executable program should include liblog,libcutils,libutils

I don't know the real reason, but if you write a very simple program that doesn't have a core file generated, you should add the library just mentioned.


在 2017年7月4日星期二 UTC+8上午10:52:54,Weilai Xu写道:
Reply all
Reply to author
Forward
0 new messages