Bug 6824 - [e500v2] "float_bessel"case failed on e500v2 platforms
Summary: [e500v2] "float_bessel"case failed on e500v2 platforms
Status: VERIFIED FIXED
Alias: None
Product: BSPs
Classification: Build System, Metadata & Runtime
Component: bsps-meta-fsl-ppc (show other bugs)
Version: 1.7
Hardware: Other ppc
: Medium normal
Target Milestone: 1.9
Assignee: Chunrong Guo
QA Contact: Bogdan Alexandru Voiculescu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-10-13 06:22 UTC by leimaohui
Modified: 2015-10-14 11:53 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
the patch for gcc bug#63908 (9.28 KB, patch)
2015-01-08 06:31 UTC, leimaohui
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description leimaohui 2014-10-13 06:22:12 UTC
Git rev: 
poky: master/ccf5a4d2342c4fd40e4e0b332ea7e34e0bf175d4
meta-fsl-ppc: master/deb326df1489d4844f911605a2627f95c89b167f
kernel: ltsi 3.4.74

LTP version: 20120903

'float_bessel'case failed in p2020rdb. The log is like below:
###################################
float_bessel    1  TPASS  :  Test passed
float_bessel    0  TINFO  :  float_bessel: will run for 500 loops; using . as a data directory
float_bessel    0  TINFO  :  float_bessel: will run 5 functions, 20 threads per function
float_bessel    0  TINFO  :  signal handler 1216373856 started
float_bessel    0  TINFO  :  Signal handler starts waiting...
float_bessel    0  TINFO  :  initial thread: Waiting for 100 threads to finish
sh: line 1: 12822 Aborted                 float_bessel -v
###################################
In addition,'float_exp_log','float_iperb','float_power'and 'float_trigo' are failed and have the similar phenomenon.

Steps:
######
1. root@localhost:~# cd /opt/ltp/
2. root@localhost:/opt/ltp# ./runltp -s float_bessel
######


So, I download the yocto-1.7.rc3 and yocto-1.7_M2.rc1, the results are the same .
Download from :
yocto-1.7.rc3
http://autobuilder.yoctoproject.org/pub/releases/yocto-1.7.rc3/machines/p1022ds/core-image-sato-sdk-p1022ds-20141002001601.rootfs.tar.gz
http://autobuilder.yoctoproject.org/pub/releases/yocto-1.7.rc3/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-ppce500v2-toolchain-1.7.sh

yocto-1.7_M2.rc1
http://autobuilder.yoctoproject.org/pub/releases/yocto-1.7_M2.rc1/machines/p1022ds/core-image-sato-sdk-p1022ds-20140729204824.rootfs.tar.gz
http://autobuilder.yoctoproject.org/pub/releases/yocto-1.7_M2.rc1/toolchain/x86_64/poky-eglibc-x86_64-core-image-sato-ppce500v2-toolchain-1.6+snapshot.sh 

But in yocto-1.6.1,these casees are PASS。
Download from :
http://autobuilder.yoctoproject.org/pub/releases/yocto-1.6.1/machines/p1022ds/core-image-sato-sdk-p1022ds-20140623113451.rootfs.tar.gz
http://autobuilder.yoctoproject.org/pub/releases/yocto-1.6.1/toolchain/x86_64/poky-eglibc-x86_64-core-image-sato-ppce500v2-toolchain-1.6.1.sh
Comment 1 leimaohui 2014-10-17 02:17:41 UTC
In addition to float_xx cases,the following cases are FAIL too.

But in yocto-1.6.1,these cases are PASS。

1.sem02
2.pth_str01
3.pth_str03
4.mtest05


kernel: ltsi 3.4.74
yocto :yocto-1.7.rc4   yocto-1.7.rc3
Comment 2 leimaohui 2014-10-21 02:15:45 UTC
Will this bug be resolved before yocto 1.7 release?
Comment 3 Zhenhua Luo 2014-10-21 02:24:57 UTC
(In reply to comment #2)
> Will this bug be resolved before yocto 1.7 release?
We plan to fix the issue in 1.8.
Comment 4 leimaohui 2014-11-05 01:38:09 UTC
I changed the gcc from 4.9.1 to 4.9.2 in yocto,and tested these cases.
The results are the same.
Comment 5 leimaohui 2014-11-10 06:11:19 UTC
I changed the gcc to 4.8.1 in yocto 1.7,these bugs disappeared.
So I think it was gcc 4.9.1 caused these bugs.
Comment 6 leimaohui 2014-11-28 09:16:03 UTC
I found the reason is the founction "pthread_exit(0)" can't execut normally。
Because it will lead a SIGABRT signal and aborted .

I wrote a test program and make a test.The enviroment is below:
------------------------------------------------
rootfs:  http://downloads.yoctoproject.org/releases/yocto/yocto-1.7/machines/p1022ds/core-image-sato-sdk-p1022ds-20141018182842.rootfs.tar.gz

toolchain: http://downloads.yoctoproject.org/releases/yocto/yocto-1.7/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-ppce500v2-toolchain-1.7.sh

kernel: 3.14 and 3.4.74 have the same appearance

hostOS: RHEL 6.3

Below is my test program
------------------------------------------------

[root@RHEL6U3 pthread-test]# cat pthread-test.c
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>

pthread_t       tid1, tid2;
void            *tret;

void *
thr_fn1(void *arg)
{
    sleep(1);

    printf("it's thread 1 \n");
    pthread_exit(0);

//    pthread_join(tid2, &tret);
}

int
main(void)
{
    int err;

    err = pthread_create(&tid1, NULL, thr_fn1, NULL);
    if (err != 0)
        printf("can't create thread 1\n");

    printf("I will join thread 1... 1\n");
    err = pthread_join(tid1, &tret);
    if (err != 0)
        printf("can't join with thread 1\n");

    printf("thread 1 exit code %d\n", (int)tret);
}
[root@RHEL6U3 pthread-test]#. /opt/poky/1.7/environment-setup-ppce500v2-poky-linux-gnuspe
[root@RHEL6U3 pthread-test]# ${CC} pthread-test.c -lpthread -o pthread-test

------------------------------------------------
And then execut "pthread-test" in e500v2.The result is like below
------------------------------------------------

root@p1022ds:/root# strace -f -o pthread-test.log ./pthread-test
I will join thread 1... 1
it's thread 1
Aborted
root@p1022ds:/root# cat pthread-test.log
...
1009  futex(0xfa999ac, FUTEX_WAKE_PRIVATE, 2147483647) = 0
1009  rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
1009  tgkill(1008, 1009, SIGABRT)       = 0
1009  --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=1008, si_uid=0} ---
1009  +++ killed by SIGABRT +++
1008  +++ killed by SIGABRT +++
root@p1022ds:/root# 
root@p1022ds:/root# 

But I dont't know the root cause. That's the gcc 's bug or the glibc's bug?
Comment 7 Chunrong Guo 2014-11-28 09:31:04 UTC
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63908
Comment 8 leimaohui 2014-12-12 01:56:13 UTC
With these 2 patches,this bug would be fixed。
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=4fd39f1329379e00f958394adde6be96f0caf21f
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c0235a33de8c4f78cce35b2a8c2035c83fe1bd14

But it is difficult for me to backport them into yocto 1.7 branch.

So,is there anybody going to do this?
Comment 9 leimaohui 2015-01-08 06:27:36 UTC
I have backported these patches(please refer to the attachments) into gcc 4.9.2.
With these patches,the issues can be resolved.
who can review these patches for yocto.
Comment 10 leimaohui 2015-01-08 06:31:05 UTC
Created attachment 2314 [details]
the patch for gcc bug#63908
Comment 11 Chunrong Guo 2015-01-08 06:39:56 UTC
If you send these  patches  to openembedded-core layer , openembedded-core owner will review them.
Comment 12 Richard Purdie 2015-05-14 15:38:33 UTC
With the 4.9 upgrade, some of these changes made it into master:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a55d5374e03d694dd6de9f6de51e14d73f7cca75

Are there still problems with this or can the bug be closed? If backports are needed to other releases, please send patches to the mailing list.
Comment 13 Chunrong Guo 2015-05-15 04:10:26 UTC
the problem has gone away.


Build Configuration:
BB_VERSION        = "1.27.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "powerpc-poky-linux-gnuspe"
MACHINE           = "p1022ds"
DISTRO            = "poky"
DISTRO_VERSION    = "1.8+snapshot-20150515"
TUNE_FEATURES     = "m32 spe ppce500v2"
TARGET_FPU        = "ppc-efd"
meta              
meta-yocto        = "master:fab7da4f8030a4067db0522f77eaa6d3b501c68f"
meta-fsl-ppc      = "master:c3051ab6b3b24759e02202d00baf280f04fdac86"
meta-yocto-bsp    = "master:fab7da4f8030a4067db0522f77eaa6d3b501c68f"

log information:

Running tests.......
<<<test_start>>>
tag=float_bessel stime=1431658016
cmdline="cd $LTPROOT/testcases/bin; float_bessel -v"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
float_bessel    1  TPASS  :  Test passed
float_bessel    0  TINFO  :  float_bessel: will run for 500 loops; using . as a data directory
float_bessel    0  TINFO  :  float_bessel: will run 5 functions, 20 threads per function
float_bessel    0  TINFO  :  signal handler 3086967904 started
float_bessel    0  TINFO  :  Signal handler starts waiting...
float_bessel    0  TINFO  :  initial thread: Waiting for 100 threads to finish
float_bessel invoked oom-killer: gfp_mask=0x2000d0, order=0, oom_score_adj=0
CPU: 1 PID: 1951 Comm: float_bessel Not tainted 3.12.19-rt30 #1
Call Trace:
[eed83c20] [c0007064] show_stack+0x44/0x16c (unreliable)
[eed83c60] [c05eee98] dump_stack+0x78/0xa0
[eed83c70] [c00ae6fc] dump_header.isra.11+0x58/0x178
[eed83cb0] [c00aecd8] oom_kill_process+0x284/0x3c0
[eed83d00] [c00af268] out_of_memory+0x268/0x294
[eed83d40] [c00b373c] __alloc_pages_nodemask+0x758/0x768
[eed83e00] [c00ea50c] new_slab+0x27c/0x290
[eed83e30] [c00ecc44] __slab_alloc.constprop.69+0x448/0x520
[eed83ec0] [c00ecf90] kmem_cache_alloc+0x104/0x12c
[eed83ee0] [c0067120] prepare_creds+0x24/0x110
[eed83ef0] [c024f1f4] cap_task_prctl+0x1c/0x1c0
[eed83f10] [c0055268] SyS_prctl+0x30/0x3b4
[eed83f40] [c000f0bc] ret_from_syscall+0x0/0x3c
--- Exception: c01 at 0xfc5dc68
    LR = 0xfc6bdc0
Mem-Info:
DMA per-cpu:
CPU    0: hi:  186, btch:  31 usd:  30
CPU    1: hi:  186, btch:  31 usd:   0
HighMem per-cpu:
CPU    0: hi:  186, btch:  31 usd:   0
CPU    1: hi:  186, btch:  31 usd:   0
active_anon:9729 inactive_anon:36 isolated_anon:0
 active_file:538 inactive_file:761 isolated_file:0
 unevictable:0 dirty:0 writeback:0 unstable:0
 free:275702 slab_reclaimable:764 slab_unreclaimable:161686
 mapped:328 shmem:480 pagetables:184 bounce:0
 free_cma:0
DMA free:3404kB min:3484kB low:4352kB high:5224kB active_anon:14376kB inactive_anon:24kB active_file:4kB inactive_file:52kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:786432kB managed:760540kB mlocked:0kB dirty:0kB writeback:0kB mapped:8kB shmem:296kB slab_reclaimable:3056kB slab_unreclaimable:646744kB kernel_stack:1240kB pagetables:736kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:84 all_unreclaimable? yes
lowmem_reserve[]: 0 0 1279 1279
HighMem free:1099404kB min:512kB low:2012kB high:3512kB active_anon:24540kB inactive_anon:120kB active_file:2148kB inactive_file:2992kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:1310720kB managed:1310712kB mlocked:0kB dirty:0kB writeback:0kB mapped:1304kB shmem:1624kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
DMA: 5*4kB (UM) 3*8kB (U) 2*16kB (U) 0*32kB 0*64kB 0*128kB 1*256kB (R) 0*512kB 1*1024kB (R) 1*2048kB (R) 0*4096kB 0*8192kB = 3404kB
HighMem: 3*4kB (UM) 4*8kB (UM) 2*16kB (UM) 2*32kB (UM) 2*64kB (UM) 1*128kB (U) 1*256kB (M) 2*512kB (UM) 0*1024kB 2*2048kB (UM) 1*4096kB (U) 133*8192kB (UMR) = 1099404kB
Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1024kB
Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=4096kB
Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=16384kB
Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=65536kB
Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=262144kB
Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
1779 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Total swap = 0kB
524288 pages RAM
327680 pages HighMem/MovableOnly
2 pages reserved
[ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[ 1446]     0  1446      883      166       7        0         -1000 udevd
[ 1464]     0  1464      882      121       7        0         -1000 udevd
[ 1465]     0  1465      882      118       7        0         -1000 udevd
[ 1725]     0  1725      967       84       6        0             0 syslogd
[ 1728]     0  1728      967       96       6        0             0 klogd
[ 1734]     0  1734      914      278       6        0             0 sh
[ 1737]     0  1737      954      354       6        0             0 runltp
[ 1890]     0  1890      524       77       5        0             0 ltp-pan
[ 1891]     0  1891      802      177       6        0             0 sh
[ 1892]     0  1892    62664     6748     123        0             0 float_bessel
Out of memory: Kill process 1892 (float_bessel) score 12 or sacrifice child
Killed process 1892 (float_bessel) total-vm:250656kB, anon-rss:26652kB, file-rss:340kB
sh: line 1:  1892 Killed                  float_bessel -v
<<<execution_status>>>
initiation_status="ok"
duration=13 termination_type=exited termination_id=137 corefile=no
cutime=999 cstime=1126
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20150420

       ###############################################################

            Done executing testcases.
            LTP Version:  20150420
Comment 14 Bogdan Alexandru Voiculescu 2015-10-14 11:53:05 UTC
marked as verified: see Chunrong Guo's last comment