# Failure with kernel test case

**URL:** <https://forums.sifive.com/t/failure-with-kernel-test-case/3394>\
**Category:** HiFive Unleashed\
**Created:** [February 27, 2020, 4:34am UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394 "2020-02-27T04:34:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pankaj.joshi347](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@pankaj.joshi347](https://forums.sifive.com/u/pankaj.joshi347)\
**Post date:** [February 27, 2020, 4:34am UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394/1 "2020-02-27T04:34:26Z")

</div>

Hello,  
We are doing LTP validation on HiFive Unleashed (Yocto linux 5.4.3). Can someone please help us understand this test failure? Is this expected?

## Testcase: min\_free\_kbytes

## Error on HiFive Unleashed: [https://github.com/linux-test-project/ltp/issues/642](https://github.com/linux-test-project/ltp/issues/642) **min\_free\_kbytes.c:134: FAIL: child unexpectedly failed: 139.** Program terminated with signal SIGSEGV, Segmentation fault.

## Conversation with LTP on this:

## Email Conversation with LTP:

Hi,  
i am running min\_free\_kbytes test,6 test cases are failing with error message **min\_free\_kbytes.c:134: FAIL: child unexpectedly failed: 139.**  
Please find my strace output(Parent)

root@exaleapsemi:~/pankaj\_ltp\_new/ltp/testcases/kernel/mem/tunable# strace ./min\_free\_kbytes

execve("./min\_free\_kbytes", ["./min\_free\_kbytes"], 0x3fffb45c80 /\* 15 vars \*/) = 0

brk(NULL) = 0x2c000

uname({sysname=“Linux”, nodename=“exaleapsemi”, …}) = 0

faccessat(AT\_FDCWD, “/etc/ld.so.preload”, R\_OK) = -1 ENOENT (No such file or directory)

openat(AT\_FDCWD, “/etc/ld.so.cache”, O\_RDONLY|O\_CLOEXEC) = 3

fstat(3, {st\_mode=S\_IFREG|0644, st\_size=66866, …}) = 0

mmap(NULL, 66866, PROT\_READ, MAP\_PRIVATE, 3, 0) = 0x3fd7669000

close(3) = 0

openat(AT\_FDCWD, “/usr/lib/libnuma.so.1”, O\_RDONLY|O\_CLOEXEC) = 3

read(3, “\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\2002\0\0\0\0\0\0”…, 832) = 832

fstat(3, {st\_mode=S\_IFREG|0755, st\_size=35664, …}) = 0

mmap(NULL, 8192, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3fd7667000

mmap(NULL, 54992, PROT\_READ|PROT\_EXEC, MAP\_PRIVATE|MAP\_DENYWRITE, 3, 0) = 0x3fd7659000

mprotect(0x3fd7660000, 4096, PROT\_NONE) = 0

mmap(0x3fd7661000, 8192, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_FIXED|MAP\_DENYWRITE, 3, 0x7000) = 0x3fd7661000

mmap(0x3fd7663000, 14032, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_FIXED|MAP\_ANONYMOUS, -1, 0) = 0x3fd7663000

close(3) = 0

openat(AT\_FDCWD, “/lib/libpthread.so.0”, O\_RDONLY|O\_CLOEXEC) = 3

read(3, “\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\204p\0\0\0\0\0\0”…, 832) = 832

fstat(3, {st\_mode=S\_IFREG|0755, st\_size=89264, …}) = 0

mmap(NULL, 107632, PROT\_READ|PROT\_EXEC, MAP\_PRIVATE|MAP\_DENYWRITE, 3, 0) = 0x3fd763e000

mprotect(0x3fd7652000, 4096, PROT\_NONE) = 0

mmap(0x3fd7653000, 8192, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_FIXED|MAP\_DENYWRITE, 3, 0x14000) = 0x3fd7653000

mmap(0x3fd7655000, 13424, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_FIXED|MAP\_ANONYMOUS, -1, 0) = 0x3fd7655000

close(3) = 0

openat(AT\_FDCWD, “/lib/libc.so.6”, O\_RDONLY|O\_CLOEXEC) = 3

read(3, “\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\2005\2\0\0\0\0\0”…, 832) = 832

fstat(3, {st\_mode=S\_IFREG|0755, st\_size=1061392, …}) = 0

mmap(NULL, 1072656, PROT\_READ|PROT\_EXEC, MAP\_PRIVATE|MAP\_DENYWRITE, 3, 0) = 0x3fd7538000

mmap(0x3fd7635000, 24576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_FIXED|MAP\_DENYWRITE, 3, 0xfc000) = 0x3fd7635000

mmap(0x3fd763b000, 11792, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_FIXED|MAP\_ANONYMOUS, -1, 0) = 0x3fd763b000

close(3) = 0

mmap(NULL, 8192, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3fd7536000

mprotect(0x3fd7635000, 12288, PROT\_READ) = 0

mprotect(0x3fd7653000, 4096, PROT\_READ) = 0

mprotect(0x3fd7661000, 4096, PROT\_READ) = 0

mprotect(0x28000, 4096, PROT\_READ) = 0

mprotect(0x3fd7693000, 4096, PROT\_READ) = 0

munmap(0x3fd7669000, 66866) = 0

set\_tid\_address(0x3fd75360e0) = 33300

set\_robust\_list(0x3fd75360f0, 24) = 0

rt\_sigaction(SIGRTMIN, {sa\_handler=0x3fd7644c52, sa\_mask=[], sa\_flags=SA\_SIGINFO}, NULL, 8) = 0

rt\_sigaction(SIGRT\_1, {sa\_handler=0x3fd7644cd2, sa\_mask=[], sa\_flags=SA\_RESTART|SA\_SIGINFO}, NULL, 8) = 0

rt\_sigprocmask(SIG\_UNBLOCK, [RTMIN RT\_1], NULL, 8) = 0

prlimit64(0, RLIMIT\_STACK, NULL, {rlim\_cur=8192\*1024, rlim\_max=RLIM64\_INFINITY}) = 0

brk(NULL) = 0x2c000

brk(0x4d000) = 0x4d000

openat(AT\_FDCWD, “/proc/self/status”, O\_RDONLY) = 3

fstat(3, {st\_mode=S\_IFREG|0444, st\_size=0, …}) = 0

read(3, “Name:\tmin\_free\_kbytes\nUmask:\t002”…, 1024) = 960

read(3, “”, 1024) = 0

close(3) = 0

get\_mempolicy(0x3fffe9fb6c, 0x2c920, 33, NULL, 0) = -1 ENOSYS (Function not implemented)

openat(AT\_FDCWD, “/sys/devices/system/node”, O\_RDONLY|O\_NONBLOCK|O\_CLOEXEC|O\_DIRECTORY) = -1 ENOENT (No such file or directory)

sched\_getaffinity(0, 512, [0, 1, 2, 3]) = 8

openat(AT\_FDCWD, “/sys/devices/system/cpu”, O\_RDONLY|O\_NONBLOCK|O\_CLOEXEC|O\_DIRECTORY) = 3

fstat(3, {st\_mode=S\_IFDIR|0755, st\_size=0, …}) = 0

getdents64(3, /\* 14 entries \*/, 32768) = 400

getdents64(3, /\* 0 entries \*/, 32768) = 0

close(3) = 0

openat(AT\_FDCWD, “/proc/self/status”, O\_RDONLY) = 3

fstat(3, {st\_mode=S\_IFREG|0444, st\_size=0, …}) = 0

read(3, “Name:\tmin\_free\_kbytes\nUmask:\t002”…, 1024) = 960

read(3, “”, 1024) = 0

close(3) = 0

getpid() = 33300

geteuid() = 0

faccessat(AT\_FDCWD, “/dev/shm”, F\_OK) = 0

getpid() = 33300

openat(AT\_FDCWD, “/dev/shm/ltp\_min\_free\_kbytes\_33300”, O\_RDWR|O\_CREAT|O\_EXCL, 0600) = 3

fchmodat(AT\_FDCWD, “/dev/shm/ltp\_min\_free\_kbytes\_33300”, 0666) = 0

ftruncate(3, 4096) = 0

mmap(NULL, 4096, PROT\_READ|PROT\_WRITE, MAP\_SHARED, 3, 0) = 0x3fd7679000

unlinkat(AT\_FDCWD, “/dev/shm/ltp\_min\_free\_kbytes\_33300”, 0) = 0

close(3) = 0

rt\_sigaction(SIGALRM, {sa\_handler=0x14f74, sa\_mask=[ALRM], sa\_flags=SA\_RESTART}, {sa\_handler=SIG\_DFL, sa\_mask=[], sa\_flags=0}, 8) = 0

rt\_sigaction(SIGUSR1, {sa\_handler=0x14e58, sa\_mask=[USR1], sa\_flags=SA\_RESTART}, {sa\_handler=SIG\_DFL, sa\_mask=[], sa\_flags=0}, 8) = 0

ioctl(2, TCGETS, {B38400 opost isig icanon echo …}) = 0

write(2, “tst\_test.c:1206: \33[1;34mINFO: \33[”…, 62tst\_test.c:1206: INFO: Timeout per run is disabled

) = 62

rt\_sigaction(SIGINT, {sa\_handler=0x14f38, sa\_mask=[INT], sa\_flags=SA\_RESTART}, {sa\_handler=SIG\_DFL, sa\_mask=[], sa\_flags=0}, 8) = 0

clone(child\_stack=NULL, flags=CLONE\_CHILD\_CLEARTID|CLONE\_CHILD\_SETTID|SIGCHLD, child\_tidptr=0x3fd75360e0) = 33301

wait4(33301, 0x3fffe9f9c8, 0, NULL) = ? ERESTARTSYS (To be restarted if SA\_RESTART is set)

— SIGUSR1 {si\_signo=SIGUSR1, si\_code=SI\_USER, si\_pid=33301, si\_uid=0} —

setitimer(ITIMER\_REAL, {it\_interval={tv\_sec=0, tv\_usec=0}, it\_value={tv\_sec=0, tv\_usec=0}}, {it\_interval={tv\_sec=0, tv\_usec=0}, it\_value={tv\_sec=0, tv\_usec=0}}) = 0

rt\_sigreturn({mask=[]}) = 33301

wait4(33301, mem.c:817: INFO: set overcommit\_memory to 2

mem.c:817: INFO: set min\_free\_kbytes to 163644

memfree is 7877544 kB before eatup mem

memfree is 4038116 kB after eatup mem

mem.c:817: INFO: set min\_free\_kbytes to 327288

memfree is 7863212 kB before eatup mem

memfree is 4053228 kB after eatup mem

mem.c:817: INFO: set min\_free\_kbytes to 163644

memfree is 7863264 kB before eatup mem

memfree is 4057852 kB after eatup mem

mem.c:817: INFO: set overcommit\_memory to 0

mem.c:817: INFO: set min\_free\_kbytes to 163644

memfree is 7863108 kB before eatup mem

min\_free\_kbytes.c:173: FAIL: child unexpectedly failed: 11

mem.c:817: INFO: set min\_free\_kbytes to 327288

memfree is 8032744 kB before eatup mem

min\_free\_kbytes.c:173: FAIL: child unexpectedly failed: 11

mem.c:817: INFO: set min\_free\_kbytes to 163644

memfree is 8034384 kB before eatup mem

min\_free\_kbytes.c:173: FAIL: child unexpectedly failed: 11

mem.c:817: INFO: set overcommit\_memory to 1

mem.c:817: INFO: set min\_free\_kbytes to 163644

memfree is 8050968 kB before eatup mem

min\_free\_kbytes.c:155: FAIL: child unexpectedly failed: 11

mem.c:817: INFO: set min\_free\_kbytes to 327288

memfree is 8052860 kB before eatup mem

min\_free\_kbytes.c:155: FAIL: child unexpectedly failed: 11

mem.c:817: INFO: set min\_free\_kbytes to 163644

memfree is 8043428 kB before eatup mem

min\_free\_kbytes.c:155: FAIL: child unexpectedly failed: 11

min\_free\_kbytes.c:103: PASS: min\_free\_kbytes test pass

mem.c:817: INFO: set min\_free\_kbytes to 163644

mem.c:817: INFO: set overcommit\_memory to 1

0x3fffe9f9c8, 0, NULL) = ? ERESTARTSYS (To be restarted if SA\_RESTART is set)

— SIGUSR1 {si\_signo=SIGUSR1, si\_code=SI\_USER, si\_pid=33301, si\_uid=0} —

— SIGCHLD {si\_signo=SIGCHLD, si\_code=CLD\_EXITED, si\_pid=33301, si\_uid=0, si\_status=0, si\_utime=0, si\_stime=0} —

setitimer(ITIMER\_REAL, {it\_interval={tv\_sec=0, tv\_usec=0}, it\_value={tv\_sec=0, tv\_usec=0}}, {it\_interval={tv\_sec=0, tv\_usec=0}, it\_value={tv\_sec=0, tv\_usec=0}}) = 0

rt\_sigreturn({mask=[]}) = 33301

wait4(33301, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 33301

setitimer(ITIMER\_REAL, {it\_interval={tv\_sec=0, tv\_usec=0}, it\_value={tv\_sec=0, tv\_usec=0}}, {it\_interval={tv\_sec=0, tv\_usec=0}, it\_value={tv\_sec=0, tv\_usec=0}}) = 0

rt\_sigaction(SIGINT, {sa\_handler=SIG\_DFL, sa\_mask=[INT], sa\_flags=SA\_RESTART}, {sa\_handler=0x14f38, sa\_mask=[INT], sa\_flags=SA\_RESTART}, 8) = 0

fstat(1, {st\_mode=S\_IFCHR|0620, st\_rdev=makedev(0x88, 0), …}) = 0

write(1, “\n”, 1

) = 1

write(1, “Summary:\n”, 9Summary:

) = 9

write(1, “passed 1\n”, 11passed 1

) = 11

write(1, “failed 6\n”, 11failed 6

) = 11

write(1, “skipped 0\n”, 11skipped 0

) = 11

write(1, “warnings 0\n”, 11warnings 0

) = 11

faccessat(AT\_FDCWD, “/dev/shm/ltp\_min\_free\_kbytes\_33300”, F\_OK) = -1 ENOENT (No such file or directory)

msync(0x3fd7679000, 4096, MS\_SYNC) = 0

munmap(0x3fd7679000, 4096) = 0

exit\_group(1) = ?

+++ exited with 1 +++

//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* This is the result of strace -f\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18a08000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18908000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18808000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18708000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18608000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18508000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18408000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18308000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18208000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18108000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e18008000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17f08000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17e08000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17d08000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17c08000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17b08000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17a08000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17908000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17808000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17708000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17608000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17508000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17408000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17308000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17208000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17108000

[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e17008000

[**pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e16f08000**

**[pid 48522] mmap(NULL, 1048576, PROT\_READ|PROT\_WRITE, MAP\_PRIVATE|MAP\_ANONYMOUS, -1, 0) = 0x3e16e08000**

**Segmentation fault**

**root@exaleapsemi:~/pankaj\_ltp\_new/ltp/testcases/kernel/mem/tunable# min\_free\_kbytes.c:173: FAIL: child unexpectedly failed: 11**

**mem.c:817: INFO: set min\_free\_kbytes to 163644**

**memfree is 8048240 kB before eatup mem**

**min\_free\_kbytes.c:173: FAIL: child unexpectedly failed: 11**

**mem.c:817: INFO: set overcommit\_memory to 1**

**mem.c:817: INFO: set min\_free\_kbytes to 327288**

**memfree is 8047972 kB before eatup mem**

**min\_free\_kbytes.c:155: FAIL: child unexpectedly failed: 11**

**mem.c:817: INFO: set min\_free\_kbytes to 654576**

**memfree is 8047800 kB before eatup mem**

**min\_free\_kbytes.c:155: FAIL: child unexpectedly failed: 11**

**mem.c:817: INFO: set min\_free\_kbytes to 163644**

**memfree is 8039996 kB before eatup mem**

**min\_free\_kbytes.c:155: FAIL: child unexpectedly failed: 11**

**min\_free\_kbytes.c:103: PASS: min\_free\_kbytes test pass**

**mem.c:817: INFO: set min\_free\_kbytes to 327288**

**mem.c:817: INFO: set overcommit\_memory to 1**

Summary:

passed 1

failed 7

skipped 0

warnings 0

Response from LTP Forum:

i am attaching the test result  
Output is unusual, status codes suggest child running into SIGSEGV and SIGILL at some  
point after eatup\_mem(). Did you try to run this with gdb, strace or look at core files?

Hi Jan,  
\> i have tried to collect the core through GDB this is the result i found??what  
\> i should conclude from this??

root@exaleapsemi:~/pankaj\_ltpn/ltp/testcases/kernel/mem/tunable# gdb ./min\_free\_kbytes core.378

GNU gdb (GDB) 8.3.1

Copyright © 2019 Free Software Foundation, Inc.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Type “show copying” and “show warranty” for details.

This GDB was configured as “riscv64-oe-linux”.

Type “show configuration” for configuration details.

For bug reporting instructions, please see:

Find the GDB manual and other documentation resources online at:

For help, type “help”.

Type “apropos word” to search for commands related to “word”…??

Reading symbols from ./min\_free\_kbytes…

[New LWP 378]

[Thread debugging using libthread\_db enabled]

Using host libthread\_db library “/lib/libthread\_db.so.1”.

**Core was generated by `./min\_free\_kbytes’.**

**Program terminated with signal SIGSEGV, Segmentation fault.**

**#0 0x0000003fe1713b92 in \_\_vfscanf\_internal (s=0x23000, format=\<optimized out\>, argptr=\<optimized out\>, mode\_flags=\<optimized out\>) at vfscanf-internal.c:345**

Response from LTP:  
Can you paste the output of backtrace? (‘bt’ command in gdb)–\>

gdb) bt  
\> #0 0x0000003fe1713b92 in \_\_vfscanf\_internal (s=0x23000, format=\<optimized  
\> out\>, argptr=\<optimized out\>, mode\_flags=\<optimized out\>) at  
\> vfscanf-internal.c:345  
\> Backtrace stopped: Cannot access memory at address 0xfffffffffffffff9

(gdb) where  
\> #0 0x0000003fe1713b92 in \_\_vfscanf\_internal (s=0x23000, format=\<optimized  
\> out\>, argptr=\<optimized out\>, mode\_flags=\<optimized out\>) at  
\> vfscanf-internal.c:345  
\> Backtrace stopped: Cannot access memory at address 0xfffffffffffffff9  
\>  
\> (gdb) info registers  
\> ra 0x16438 0x16438 \<safe\_waitpid+40\>  
\> sp 0x3fffd94850 0x3fffd94850  
\> gp 0x29f10 0x29f10 \<ipc\_path+544\>  
\> tp 0x3fe16cd720 0x3fe16cd720  
\> t0 0xffffffffffffffff -1  
\> t1 0x1366c 79468  
\> t2 0x1000 4096  
\> fp 0x1 0x1  
\> s1 0x180 384  
\> a0 0x180 384  
\> a1 0x3fffd948c4 274875369668  
\> a2 0xa 10  
\> a3 0x0 0  
\> a4 0x3fffd948c4 274875369668  
\> a5 0xffffffffffffffff -1  
\> a6 0x1 1  
\> a7 0x104 260  
\> s2 0x3fffd948c4 274875369668  
\> s3 0xa 10  
\> s4 0x79 121  
\> s5 0x3fe17e6008 274366095368  
\> s6 0x21ad0 137936  
\> s7 0x22000 139264  
\> s8 0x22000 139264  
\> s9 0x22000 139264  
\> s10 0x23000 143360  
\> s11 0x1fed70 2092400  
\> t3 0x3fe17e5790 274366093200  
\> t4 0x3fe17a2070 274365816944  
\> t5 0x3fe17a2970 274365819248  
\> t6 0x5 5  
\> pc 0x3fe1713b92 0x3fe1713b92 \<\_\_vfscanf\_internal+1126\>  
\> (gdb)  
\>  
Response from LTP

hich is unfortunate.

Only place I see child reaching vfscanf is via check\_monitor -\> get\_sys\_tune,  
but per test output it’s not check\_monitor child, but eatup\_mem one.

I don’t see why it would crash here, and why it happens on RISCV only.  
I can only recommend to try simplify the testcase to see what triggers it.

Is this the only LTP test you see crashing?  
Is it built natively on RISCV or is it cross-compiled in other environment?

---

<div class="post-metadata">

**Author:** ![nick.knight](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/nick.knight/32/1046_2.png) [@nick.knight](https://forums.sifive.com/u/nick.knight)\
**Post date:** [February 27, 2020, 5:54am UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394/2 "2020-02-27T05:54:37Z")

</div>

From the information you quoted, I don’t see anything specific to HiFive Unleashed. This appears to be a bug in the program you tried to run.

When your program attempts to access an illegal memory location on Linux, a “segmentation fault” can be expected.

Why was your program attempting to access an illegal memory location?

Answering this question requires an understanding of the program’s logic, so I’d suggest that you follow up with the program’s developers. From your post, it appears that you already began to do so.

Identifying memory bugs is notoriously difficult, even for seasoned programmers. Good luck!

---

<div class="post-metadata">

**Author:** ![pankaj.joshi347](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@pankaj.joshi347](https://forums.sifive.com/u/pankaj.joshi347)\
**Post date:** [February 27, 2020, 6:07am UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394/3 "2020-02-27T06:07:58Z")

</div>

Hi,  
Yes might program is trying to access an iilegal memory location ,but if its problem with program’s logic then it should also have to fail on other architectures as well,its working perfectly with x86 and some other arch.  
Its typically failing on our RISC v architecture,why is happening so???

Thank you

---

<div class="post-metadata">

**Author:** ![nick.knight](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/nick.knight/32/1046_2.png) [@nick.knight](https://forums.sifive.com/u/nick.knight)\
**Post date:** [February 27, 2020, 6:12am UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394/4 "2020-02-27T06:12:44Z")

</div>

Please provide detailed steps to reproduce the problem.

---

<div class="post-metadata">

**Author:** ![pankaj.joshi347](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@pankaj.joshi347](https://forums.sifive.com/u/pankaj.joshi347)\
**Post date:** [February 27, 2020, 7:00am UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394/6 "2020-02-27T07:00:34Z")

</div>

I am listing the steps i followed,

$ git clone [https://github.com/linux-test-project/ltp.git](https://github.com/linux-test-project/ltp.git)  
$ cd ltp  
$ make autotools  
$ ./configure  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

```auto
These are required to run complete LTP
$cd testcases/kernel/

```

```auto

```

```auto

```

``

```auto
$ cd testcases/lib
$ make
$ cd ../commands/
$ PATH=$PATH:$PWD:$PWD/../../lib/

$ cd testcases/open_posix_testsuite/
$ make generate-makefiles
$ cd conformance/interfaces/
$ make

$cd /root/ltp
$ make
$ make install

It will take couple of hours to build
/ ******************************************************************* /

 I have followed all above test but as per document you can try running this single test

$cd /root/ltp/testcases/kernel

$make

$cd /mem/tunable

$make

$./min_free_kbytes

Please refer
https://github.com/linux-test-project/ltp
```

---

<div class="post-metadata">

**Author:** ![nick.knight](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/nick.knight/32/1046_2.png) [@nick.knight](https://forums.sifive.com/u/nick.knight)\
**Post date:** [February 27, 2020, 5:11pm UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394/7 "2020-02-27T17:11:24Z")

</div>

Hi Pankaj,

I am unable to reproduce your error. Here’s the output I get:

```
# ./min_free_kbytes 
tst_test.c:1218: INFO: Timeout per run is disabled
mem.c:817: INFO: set overcommit_memory to 2
mem.c:817: INFO: set min_free_kbytes to 11429
memfree is 5855732 kB before eatup mem
memfree is 2023292 kB after eatup mem
mem.c:817: INFO: set min_free_kbytes to 22858
memfree is 5854196 kB before eatup mem
memfree is 2022788 kB after eatup mem
mem.c:817: INFO: set min_free_kbytes to 163303
memfree is 5852692 kB before eatup mem
memfree is 2023040 kB after eatup mem
mem.c:817: INFO: set overcommit_memory to 0
mem.c:817: INFO: set min_free_kbytes to 11429
memfree is 5852944 kB before eatup mem
mem.c:817: INFO: set min_free_kbytes to 22858
memfree is 8074888 kB before eatup mem
mem.c:817: INFO: set min_free_kbytes to 163303
memfree is 8064860 kB before eatup mem
mem.c:817: INFO: set overcommit_memory to 1
mem.c:817: INFO: set min_free_kbytes to 11429
memfree is 8067068 kB before eatup mem
mem.c:817: INFO: set min_free_kbytes to 22858
memfree is 8067836 kB before eatup mem
mem.c:817: INFO: set min_free_kbytes to 163303
memfree is 8067552 kB before eatup mem
min_free_kbytes.c:82: PASS: min_free_kbytes test pass
mem.c:817: INFO: set min_free_kbytes to 11429
mem.c:817: INFO: set overcommit_memory to 0

Summary:
passed 1
failed 0
skipped 0
warnings 0

```

I’m running on HiFive Unleashed using the latest release of meta-sifive (OpenEmbedded Linux), described here: [https://github.com/sifive/meta-sifive/tree/master](https://github.com/sifive/meta-sifive/tree/master)

I built LTP natively (on the HiFive Unleashed) using the default toolchain (GCC 9.2.0) and default compiler options.

Best,  
Nick

---

<div class="post-metadata">

**Author:** ![pankaj.joshi347](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@pankaj.joshi347](https://forums.sifive.com/u/pankaj.joshi347)\
**Post date:** [March 4, 2020, 12:38pm UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394/8 "2020-03-04T12:38:00Z")

</div>

Hi,  
what is the kernel version on which you have tested?

---

<div class="post-metadata">

**Author:** ![jimw](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jimw](https://forums.sifive.com/u/jimw)\
**Post date:** [March 5, 2020, 2:06am UTC](https://forums.sifive.com/t/failure-with-kernel-test-case/3394/9 "2020-03-05T02:06:31Z")

</div>

Nick gave the URL for the master branch of our open embedded layer. Looking at it, I see that it has a rule for a 5.5.x kernel. The exact version probably depends on when you build it, since it gets updated occasionally.

I was also able to correctly run the test on a Fedora rawhide system running on a 4.15 kernel.

GIven that the test is failing in vfprintf\_internal, maybe your glibc version is buggy, or was miscompiled? We can’t really say much about an OS build that we don’t have.
