All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] or1k system calls appear broken
@ 2017-11-20 13:09 Joel Stanley
  2017-11-21  3:56 ` Waldemar Brodkorb
  2017-11-28  6:49 ` Waldemar Brodkorb
  0 siblings, 2 replies; 14+ messages in thread
From: Joel Stanley @ 2017-11-20 13:09 UTC (permalink / raw)
  To: buildroot

Hello,

I did a build of the Buildroot Openrisc Qemu defconfig and attempted
to run some userspace tools. They were failing in strange ways:

# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
ping: clock_gettime(MONOTONIC) failed

I tested with Ubuntu's Qemu 2.10.1, and a Qemu 2.11-rc0 that I built
myself. Buildroot is master, 2017.11-rc2-21-g250170e92252.

I'm also seeing this with my own 4.14 based kernel running on or1k
hardware (a softcore inside a FPGA). Stafford can reproduce on
hardware using my buildroot initrd, but his hand compiled busybox
build is fine.

I've attached the output of strace below, which is hard to read as the
process_vm_readv calls made by strace are failing as well.

I cross compiled some of the LTP tests and the expected-failure test
passed, but the expected-succeeds test failed.

# clock_gettime02
clock_gettime02    1  TFAIL  :  clock_gettime02.c:97: failed:
TEST_ERRNO=EFAULT(14): Bad address
clock_gettime02    2  TFAIL  :  clock_gettime02.c:97: failed:
TEST_ERRNO=EFAULT(14): Bad address

# clock_gettime03
clock_gettime03    1  TPASS  :  got expected failure:
TEST_ERRNO=EFAULT(14): Bad address
clock_gettime03    2  TPASS  :  got expected failure:
TEST_ERRNO=EFAULT(14): Bad address
clock_gettime03    3  TPASS  :  got expected failure:
TEST_ERRNO=EINVAL(22): Invalid argument
clock_gettime03    4  TPASS  :  got expected failure:
TEST_ERRNO=EINVAL(22): Invalid argument
clock_gettime03    5  TPASS  :  got expected failure:
TEST_ERRNO=EFAULT(14): Bad address
clock_gettime03    6  TPASS  :  got expected failure:
TEST_ERRNO=EFAULT(14): Bad address

strace of clock_gettime2 shows the second argument is NULL, so the
kernel is doing the correct thing here and returning EFAULT. The
source shows it passing the address of a local variable.

Finally, a hand compiled test program succeeds:

#include <time.h>
#include <errno.h>

int main()
{
    struct timespec ts;
    int r = clock_gettime(CLOCK_MONOTONIC, &ts);
    if (r < 0)
        return errno;
    return 0;
}

# t
# echo $?
0

Does this make sense to anyone?

Cheers,

Joel

--

# strace ping 127.0.0.1
execve(strace: process_vm_readv: pid:83 @0x7f900c30: Invalid argument
0x7f900c30, strace: process_vm_readv: pid:83 @0x7f901e68: Invalid argument
0x7f901e68, 0x7f901e74strace: process_vm_readv: pid:83 @0x7f901e74:
Invalid argument
) = 0
readlinkat(AT_FDCWD, strace: process_vm_readv: pid:83 @0x300051e8:
Invalid argument
0x300051e8, strace: process_vm_readv: pid:83 @0x7f83cb58: Invalid argument
0x7f83cb58, 4096) = 12
mmap2(NULL, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x3000a000
openat(AT_FDCWD, strace: process_vm_readv: pid:83 @0x7f83d318: Invalid argument
0x7f83d318, O_RDONLY)  = 3
fstat64(3, strace: process_vm_readv: pid:83 @0x7f83d1f8: Invalid argument
0x7f83d1f8)                  = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x3000c000
read(3, strace: process_vm_readv: pid:83 @0x3000c000: Invalid argument
0x3000c000, 8192)               = 8192
mmap2(NULL, 761856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3000e000
mmap2(0x3000e000, 636828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
3, 0) = 0x3000e000
mmap2(0x300aa000, 27060, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x9a000) = 0x300aa000
mmap2(0x300b2000, 84480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x300b2000
mprotect(0x3000e000, 636828, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
close(3)                                = 0
munmap(0x3000c000, 8192)                = 0
fstatat64(AT_FDCWD, strace: process_vm_readv: pid:83 @0x3000a358:
Invalid argument
0x3000a358, strace: process_vm_readv: pid:83 @0x7f83dad4: Invalid argument
0x7f83dad4, 0) = 0
mprotect(0xf6000, 8192, PROT_READ)      = 0
mprotect(0x300aa000, 8192, PROT_READ)   = 0
mprotect(0x30006000, 8192, PROT_READ)   = 0
mprotect(0x3000e000, 636828, PROT_READ|PROT_EXEC) = 0
ioctl(0, TCGETS, strace: process_vm_readv: pid:83 @0x7f83dab0: Invalid argument
0x7f83dab0)            = 0
ioctl(1, TCGETS, strace: process_vm_readv: pid:83 @0x7f83dab0: Invalid argument
0x7f83dab0)            = 0
getpid()                                = 83
getrlimit(RLIMIT_STACK, strace: process_vm_readv: pid:83 @0x7f83db08:
Invalid argument
0x7f83db08)     = 0
rt_sigaction(SIGRTMIN, strace: process_vm_readv: pid:83 @0x7f83db10:
Invalid argument
0x7f83db10, NULL, 8) = 0
rt_sigaction(SIGRT_1, strace: process_vm_readv: pid:83 @0x7f83db10:
Invalid argument
0x7f83db10, NULL, 8) = 0
rt_sigaction(SIGRT_2, strace: process_vm_readv: pid:83 @0x7f83db10:
Invalid argument
0x7f83db10, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, strace: process_vm_readv: pid:83
@0x7f83db00: Invalid argument
0x7f83db00, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, strace: process_vm_readv: pid:83
@0x7f83db00: Invalid argument
0x7f83db00, NULL, 8) = 0
or1k_atomic(SWAP, 0x300ac2ac, 0x7f83da68) = 0
or1k_atomic(SWAP, 0x300ac1d0, 0x7f83d9d8) = 0
brk(NULL)                               = 0xfa000
brk(0xfc000)                            = 0xfc000
brk(0xfc000)                            = 0xfc000
or1k_atomic(SWAP, 0x300ac1d0, 0x7f83ddb0) = 0
or1k_atomic(SWAP, 0x300ac1d0, 0x7f83ddb0) = 0
getuid()                                = 0
getpid()                                = 83
or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dc74) = 0
or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dc0c) = 0
or1k_atomic(SWAP, 0x300ac124, 0x7f83dcf0) = 0
or1k_atomic(SWAP, 0x300ac124, 0x7f83dcf0) = 0
write(1, strace: process_vm_readv: pid:83 @0x300b1d4c: Invalid argument
0x300b1d4c, 42PING 127.0.0.1 (127.0.0.1): 56 data bytes
)                = 42
socket(AF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
dup3(3, 0, 0)                           = 0
close(3)                                = 0
or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dcc8) = 0
or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dcc8) = 0
setsockopt(0, SOL_SOCKET, SO_BROADCAST, strace: process_vm_readv:
pid:83 @0x7f83dd60: Invalid argument
0x7f83dd60, 4) = 0
setsockopt(0, SOL_SOCKET, SO_RCVBUF, strace: process_vm_readv: pid:83
@0x7f83dd70: Invalid argument
0x7f83dd70, 4) = 0
rt_sigaction(SIGINT, strace: process_vm_readv: pid:83 @0x7f83dd1c:
Invalid argument
0x7f83dd1c, strace: process_vm_readv: pid:83 @0x7f83dd5c: Invalid argument
0x7f83dd5c, 8) = 0
clock_gettime(0x53 /* CLOCK_??? */, NULL) = -1 EINVAL (Invalid argument)
or1k_atomic(SWAP, 0x300ac074, 0x7f83dbf4) = 0
or1k_atomic(SWAP, 0x300ac08c, 0x7f83dbf4) = 0
or1k_atomic(SWAP, 0x300ac124, 0x7f83dbf4) = 0
or1k_atomic(SWAP, 0x300ac074, 0x7f83dba8) = 0
write(2, strace: process_vm_readv: pid:83 @0x7f83dcc4: Invalid argument
0x7f83dcc4, 38ping: clock_gettime(MONOTONIC) failed
)                = 38
or1k_atomic(SWAP, 0x300ac2ac, 0x7f83dcc0) = 0
or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dc80) = 0
or1k_atomic(SWAP, 0x300ac0e4, 0x7f83dcd0) = 0
or1k_atomic(SWAP, 0x300ac124, 0x7f83dcd0) = 0
or1k_atomic(SWAP, 0x300ac164, 0x7f83dcd0) = 0
exit_group(1)                           = ?
+++ exited with 1 +++

# strace -o test t
strace: process_vm_readv: pid:110 @0x7fa96c30: Invalid argument
strace: process_vm_readv: pid:110 @0x7fa97e70: Invalid argument
strace: process_vm_readv: pid:110 @0x7fa97e78: Invalid argument
strace: process_vm_readv: pid:110 @0x300051e8: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff28b68: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29328: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29208: Invalid argument
strace: process_vm_readv: pid:110 @0x3000c000: Invalid argument
strace: process_vm_readv: pid:110 @0x3000a350: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29ae4: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29ac0: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29ac0: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29b18: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29b20: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29b20: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29b20: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29b10: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29b10: Invalid argument
strace: process_vm_readv: pid:110 @0x7ff29e3c: Invalid argument
# cat test  | grep gettime
clock_gettime(CLOCK_MONOTONIC, 0x7ff29e3c) = 0
# cat test
execve(0x7fa96c30, 0x7fa97e70, 0x7fa97e78) = 0
readlinkat(AT_FDCWD, 0x300051e8, 0x7ff28b68, 4096) = 10
mmap2(NULL, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x3000a000
openat(AT_FDCWD, 0x7ff29328, O_RDONLY)  = 3
fstat64(3, 0x7ff29208)                  = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x3000c000
read(3, 0x3000c000, 8192)               = 8192
mmap2(NULL, 761856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3000e000
mmap2(0x3000e000, 636828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
3, 0) = 0x3000e000
mmap2(0x300aa000, 27060, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x9a000) = 0x300aa000
mmap2(0x300b2000, 84480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x300b2000
mprotect(0x3000e000, 636828, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
close(3)                                = 0
munmap(0x3000c000, 8192)                = 0
fstatat64(AT_FDCWD, 0x3000a350, 0x7ff29ae4, 0) = 0
mprotect(0x4000, 8192, PROT_READ)       = 0
mprotect(0x300aa000, 8192, PROT_READ)   = 0
mprotect(0x30006000, 8192, PROT_READ)   = 0
mprotect(0x3000e000, 636828, PROT_READ|PROT_EXEC) = 0
ioctl(0, TCGETS, 0x7ff29ac0)            = 0
ioctl(1, TCGETS, 0x7ff29ac0)            = 0
getpid()                                = 110
getrlimit(RLIMIT_STACK, 0x7ff29b18)     = 0
rt_sigaction(SIGRTMIN, 0x7ff29b20, NULL, 8) = 0
rt_sigaction(SIGRT_1, 0x7ff29b20, NULL, 8) = 0
rt_sigaction(SIGRT_2, 0x7ff29b20, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, 0x7ff29b10, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, 0x7ff29b10, NULL, 8) = 0
or1k_atomic(SWAP, 0x300ac2ac, 0x7ff29a78) = 0
or1k_atomic(SWAP, 0x300ac1d0, 0x7ff299e8) = 0
brk(NULL)                               = 0x8000
brk(0xa000)                             = 0xa000
brk(0xa000)                             = 0xa000
clock_gettime(CLOCK_MONOTONIC, 0x7ff29e3c) = 0
or1k_atomic(SWAP, 0x300ac2ac, 0x7ff29dd8) = 0
or1k_atomic(SWAP, 0x300ac1d0, 0x7ff29d98) = 0
or1k_atomic(SWAP, 0x300ac0e4, 0x7ff29de8) = 0
or1k_atomic(SWAP, 0x300ac124, 0x7ff29de8) = 0
or1k_atomic(SWAP, 0x300ac164, 0x7ff29de8) = 0
exit_group(0)                           = ?
+++ exited with 0 +++

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-11-20 13:09 [Buildroot] or1k system calls appear broken Joel Stanley
@ 2017-11-21  3:56 ` Waldemar Brodkorb
       [not found]   ` <20171121092441.GW29237@lianli.shorne-pla.net>
  2017-11-28  6:49 ` Waldemar Brodkorb
  1 sibling, 1 reply; 14+ messages in thread
From: Waldemar Brodkorb @ 2017-11-21  3:56 UTC (permalink / raw)
  To: buildroot

Hi Joel,

Stafford is working on some issues we seen with uClibc-ng and NPTL.
The testsuite showed over 100 errors. He could already identify some issues and I pushed the changes to master. Can you try uClibc-ng master and test if your problems still exist?

Sorry for topposting I have limited access to my mail account..

thanks
 Waldemar 

> Am 20.11.2017 um 14:09 schrieb Joel Stanley <joel@jms.id.au>:
> 
> Hello,
> 
> I did a build of the Buildroot Openrisc Qemu defconfig and attempted
> to run some userspace tools. They were failing in strange ways:
> 
> # ping 127.0.0.1
> PING 127.0.0.1 (127.0.0.1): 56 data bytes
> ping: clock_gettime(MONOTONIC) failed
> 
> I tested with Ubuntu's Qemu 2.10.1, and a Qemu 2.11-rc0 that I built
> myself. Buildroot is master, 2017.11-rc2-21-g250170e92252.
> 
> I'm also seeing this with my own 4.14 based kernel running on or1k
> hardware (a softcore inside a FPGA). Stafford can reproduce on
> hardware using my buildroot initrd, but his hand compiled busybox
> build is fine.
> 
> I've attached the output of strace below, which is hard to read as the
> process_vm_readv calls made by strace are failing as well.
> 
> I cross compiled some of the LTP tests and the expected-failure test
> passed, but the expected-succeeds test failed.
> 
> # clock_gettime02
> clock_gettime02    1  TFAIL  :  clock_gettime02.c:97: failed:
> TEST_ERRNO=EFAULT(14): Bad address
> clock_gettime02    2  TFAIL  :  clock_gettime02.c:97: failed:
> TEST_ERRNO=EFAULT(14): Bad address
> 
> # clock_gettime03
> clock_gettime03    1  TPASS  :  got expected failure:
> TEST_ERRNO=EFAULT(14): Bad address
> clock_gettime03    2  TPASS  :  got expected failure:
> TEST_ERRNO=EFAULT(14): Bad address
> clock_gettime03    3  TPASS  :  got expected failure:
> TEST_ERRNO=EINVAL(22): Invalid argument
> clock_gettime03    4  TPASS  :  got expected failure:
> TEST_ERRNO=EINVAL(22): Invalid argument
> clock_gettime03    5  TPASS  :  got expected failure:
> TEST_ERRNO=EFAULT(14): Bad address
> clock_gettime03    6  TPASS  :  got expected failure:
> TEST_ERRNO=EFAULT(14): Bad address
> 
> strace of clock_gettime2 shows the second argument is NULL, so the
> kernel is doing the correct thing here and returning EFAULT. The
> source shows it passing the address of a local variable.
> 
> Finally, a hand compiled test program succeeds:
> 
> #include <time.h>
> #include <errno.h>
> 
> int main()
> {
>    struct timespec ts;
>    int r = clock_gettime(CLOCK_MONOTONIC, &ts);
>    if (r < 0)
>        return errno;
>    return 0;
> }
> 
> # t
> # echo $?
> 0
> 
> Does this make sense to anyone?
> 
> Cheers,
> 
> Joel
> 
> --
> 
> # strace ping 127.0.0.1
> execve(strace: process_vm_readv: pid:83 @0x7f900c30: Invalid argument
> 0x7f900c30, strace: process_vm_readv: pid:83 @0x7f901e68: Invalid argument
> 0x7f901e68, 0x7f901e74strace: process_vm_readv: pid:83 @0x7f901e74:
> Invalid argument
> ) = 0
> readlinkat(AT_FDCWD, strace: process_vm_readv: pid:83 @0x300051e8:
> Invalid argument
> 0x300051e8, strace: process_vm_readv: pid:83 @0x7f83cb58: Invalid argument
> 0x7f83cb58, 4096) = 12
> mmap2(NULL, 8192, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x3000a000
> openat(AT_FDCWD, strace: process_vm_readv: pid:83 @0x7f83d318: Invalid argument
> 0x7f83d318, O_RDONLY)  = 3
> fstat64(3, strace: process_vm_readv: pid:83 @0x7f83d1f8: Invalid argument
> 0x7f83d1f8)                  = 0
> mmap2(NULL, 8192, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x3000c000
> read(3, strace: process_vm_readv: pid:83 @0x3000c000: Invalid argument
> 0x3000c000, 8192)               = 8192
> mmap2(NULL, 761856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3000e000
> mmap2(0x3000e000, 636828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
> 3, 0) = 0x3000e000
> mmap2(0x300aa000, 27060, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
> 3, 0x9a000) = 0x300aa000
> mmap2(0x300b2000, 84480, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x300b2000
> mprotect(0x3000e000, 636828, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
> close(3)                                = 0
> munmap(0x3000c000, 8192)                = 0
> fstatat64(AT_FDCWD, strace: process_vm_readv: pid:83 @0x3000a358:
> Invalid argument
> 0x3000a358, strace: process_vm_readv: pid:83 @0x7f83dad4: Invalid argument
> 0x7f83dad4, 0) = 0
> mprotect(0xf6000, 8192, PROT_READ)      = 0
> mprotect(0x300aa000, 8192, PROT_READ)   = 0
> mprotect(0x30006000, 8192, PROT_READ)   = 0
> mprotect(0x3000e000, 636828, PROT_READ|PROT_EXEC) = 0
> ioctl(0, TCGETS, strace: process_vm_readv: pid:83 @0x7f83dab0: Invalid argument
> 0x7f83dab0)            = 0
> ioctl(1, TCGETS, strace: process_vm_readv: pid:83 @0x7f83dab0: Invalid argument
> 0x7f83dab0)            = 0
> getpid()                                = 83
> getrlimit(RLIMIT_STACK, strace: process_vm_readv: pid:83 @0x7f83db08:
> Invalid argument
> 0x7f83db08)     = 0
> rt_sigaction(SIGRTMIN, strace: process_vm_readv: pid:83 @0x7f83db10:
> Invalid argument
> 0x7f83db10, NULL, 8) = 0
> rt_sigaction(SIGRT_1, strace: process_vm_readv: pid:83 @0x7f83db10:
> Invalid argument
> 0x7f83db10, NULL, 8) = 0
> rt_sigaction(SIGRT_2, strace: process_vm_readv: pid:83 @0x7f83db10:
> Invalid argument
> 0x7f83db10, NULL, 8) = 0
> rt_sigprocmask(SIG_BLOCK, strace: process_vm_readv: pid:83
> @0x7f83db00: Invalid argument
> 0x7f83db00, NULL, 8) = 0
> rt_sigprocmask(SIG_UNBLOCK, strace: process_vm_readv: pid:83
> @0x7f83db00: Invalid argument
> 0x7f83db00, NULL, 8) = 0
> or1k_atomic(SWAP, 0x300ac2ac, 0x7f83da68) = 0
> or1k_atomic(SWAP, 0x300ac1d0, 0x7f83d9d8) = 0
> brk(NULL)                               = 0xfa000
> brk(0xfc000)                            = 0xfc000
> brk(0xfc000)                            = 0xfc000
> or1k_atomic(SWAP, 0x300ac1d0, 0x7f83ddb0) = 0
> or1k_atomic(SWAP, 0x300ac1d0, 0x7f83ddb0) = 0
> getuid()                                = 0
> getpid()                                = 83
> or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dc74) = 0
> or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dc0c) = 0
> or1k_atomic(SWAP, 0x300ac124, 0x7f83dcf0) = 0
> or1k_atomic(SWAP, 0x300ac124, 0x7f83dcf0) = 0
> write(1, strace: process_vm_readv: pid:83 @0x300b1d4c: Invalid argument
> 0x300b1d4c, 42PING 127.0.0.1 (127.0.0.1): 56 data bytes
> )                = 42
> socket(AF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
> dup3(3, 0, 0)                           = 0
> close(3)                                = 0
> or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dcc8) = 0
> or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dcc8) = 0
> setsockopt(0, SOL_SOCKET, SO_BROADCAST, strace: process_vm_readv:
> pid:83 @0x7f83dd60: Invalid argument
> 0x7f83dd60, 4) = 0
> setsockopt(0, SOL_SOCKET, SO_RCVBUF, strace: process_vm_readv: pid:83
> @0x7f83dd70: Invalid argument
> 0x7f83dd70, 4) = 0
> rt_sigaction(SIGINT, strace: process_vm_readv: pid:83 @0x7f83dd1c:
> Invalid argument
> 0x7f83dd1c, strace: process_vm_readv: pid:83 @0x7f83dd5c: Invalid argument
> 0x7f83dd5c, 8) = 0
> clock_gettime(0x53 /* CLOCK_??? */, NULL) = -1 EINVAL (Invalid argument)
> or1k_atomic(SWAP, 0x300ac074, 0x7f83dbf4) = 0
> or1k_atomic(SWAP, 0x300ac08c, 0x7f83dbf4) = 0
> or1k_atomic(SWAP, 0x300ac124, 0x7f83dbf4) = 0
> or1k_atomic(SWAP, 0x300ac074, 0x7f83dba8) = 0
> write(2, strace: process_vm_readv: pid:83 @0x7f83dcc4: Invalid argument
> 0x7f83dcc4, 38ping: clock_gettime(MONOTONIC) failed
> )                = 38
> or1k_atomic(SWAP, 0x300ac2ac, 0x7f83dcc0) = 0
> or1k_atomic(SWAP, 0x300ac1d0, 0x7f83dc80) = 0
> or1k_atomic(SWAP, 0x300ac0e4, 0x7f83dcd0) = 0
> or1k_atomic(SWAP, 0x300ac124, 0x7f83dcd0) = 0
> or1k_atomic(SWAP, 0x300ac164, 0x7f83dcd0) = 0
> exit_group(1)                           = ?
> +++ exited with 1 +++
> 
> # strace -o test t
> strace: process_vm_readv: pid:110 @0x7fa96c30: Invalid argument
> strace: process_vm_readv: pid:110 @0x7fa97e70: Invalid argument
> strace: process_vm_readv: pid:110 @0x7fa97e78: Invalid argument
> strace: process_vm_readv: pid:110 @0x300051e8: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff28b68: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29328: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29208: Invalid argument
> strace: process_vm_readv: pid:110 @0x3000c000: Invalid argument
> strace: process_vm_readv: pid:110 @0x3000a350: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29ae4: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29ac0: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29ac0: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29b18: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29b20: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29b20: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29b20: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29b10: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29b10: Invalid argument
> strace: process_vm_readv: pid:110 @0x7ff29e3c: Invalid argument
> # cat test  | grep gettime
> clock_gettime(CLOCK_MONOTONIC, 0x7ff29e3c) = 0
> # cat test
> execve(0x7fa96c30, 0x7fa97e70, 0x7fa97e78) = 0
> readlinkat(AT_FDCWD, 0x300051e8, 0x7ff28b68, 4096) = 10
> mmap2(NULL, 8192, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x3000a000
> openat(AT_FDCWD, 0x7ff29328, O_RDONLY)  = 3
> fstat64(3, 0x7ff29208)                  = 0
> mmap2(NULL, 8192, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x3000c000
> read(3, 0x3000c000, 8192)               = 8192
> mmap2(NULL, 761856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3000e000
> mmap2(0x3000e000, 636828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
> 3, 0) = 0x3000e000
> mmap2(0x300aa000, 27060, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
> 3, 0x9a000) = 0x300aa000
> mmap2(0x300b2000, 84480, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x300b2000
> mprotect(0x3000e000, 636828, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
> close(3)                                = 0
> munmap(0x3000c000, 8192)                = 0
> fstatat64(AT_FDCWD, 0x3000a350, 0x7ff29ae4, 0) = 0
> mprotect(0x4000, 8192, PROT_READ)       = 0
> mprotect(0x300aa000, 8192, PROT_READ)   = 0
> mprotect(0x30006000, 8192, PROT_READ)   = 0
> mprotect(0x3000e000, 636828, PROT_READ|PROT_EXEC) = 0
> ioctl(0, TCGETS, 0x7ff29ac0)            = 0
> ioctl(1, TCGETS, 0x7ff29ac0)            = 0
> getpid()                                = 110
> getrlimit(RLIMIT_STACK, 0x7ff29b18)     = 0
> rt_sigaction(SIGRTMIN, 0x7ff29b20, NULL, 8) = 0
> rt_sigaction(SIGRT_1, 0x7ff29b20, NULL, 8) = 0
> rt_sigaction(SIGRT_2, 0x7ff29b20, NULL, 8) = 0
> rt_sigprocmask(SIG_BLOCK, 0x7ff29b10, NULL, 8) = 0
> rt_sigprocmask(SIG_UNBLOCK, 0x7ff29b10, NULL, 8) = 0
> or1k_atomic(SWAP, 0x300ac2ac, 0x7ff29a78) = 0
> or1k_atomic(SWAP, 0x300ac1d0, 0x7ff299e8) = 0
> brk(NULL)                               = 0x8000
> brk(0xa000)                             = 0xa000
> brk(0xa000)                             = 0xa000
> clock_gettime(CLOCK_MONOTONIC, 0x7ff29e3c) = 0
> or1k_atomic(SWAP, 0x300ac2ac, 0x7ff29dd8) = 0
> or1k_atomic(SWAP, 0x300ac1d0, 0x7ff29d98) = 0
> or1k_atomic(SWAP, 0x300ac0e4, 0x7ff29de8) = 0
> or1k_atomic(SWAP, 0x300ac124, 0x7ff29de8) = 0
> or1k_atomic(SWAP, 0x300ac164, 0x7ff29de8) = 0
> exit_group(0)                           = ?
> +++ exited with 0 +++
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
       [not found]   ` <20171121092441.GW29237@lianli.shorne-pla.net>
@ 2017-11-21 19:56     ` Waldemar Brodkorb
  0 siblings, 0 replies; 14+ messages in thread
From: Waldemar Brodkorb @ 2017-11-21 19:56 UTC (permalink / raw)
  To: buildroot

Hi,

> Am 21.11.2017 um 10:24 schrieb Stafford Horne <shorne@gmail.com>:
> 
>> On Tue, Nov 21, 2017 at 04:56:06AM +0100, Waldemar Brodkorb wrote:
>> Hi Joel,
>> 
>> Stafford is working on some issues we seen with uClibc-ng and NPTL.
>> The testsuite showed over 100 errors. He could already identify some issues and I pushed the changes to master. Can you try uClibc-ng master and test if your problems still exist?
>> 
>> Sorry for topposting I have limited access to my mail account..
>> 
> 
> Hello,
> 
> I have talked to Joel about this.  He is getting issues throughout the system
> calls.  I seem to have only seen these issues in nptl.  Maybe I havent been
> looking close enough.  Waldemar, do you think the lastest uclibc-ng is broken in
> more places than nptl now?

The results for linuxthreads when using the uclibc-ng testsuite are not so bad. With NPTL we have right now 99 errors. 
The problem is that I took the code from the old uclibc fork and merged the glibc nptl stuff. So with Stafford the first time an or1k expert is looking into it.
It took me very long to start with the runtime testing as I had a non working kernel config for a long time.

> I found a few more issues last night, but also I noticed that Christian Svensson
> has possibly already fixed the issues over here:
> 
>  https://github.com/bluecmd/or1k-glibc/commits/master
> 
> -Stafford

I think this was the base for my try to integrate NPTL support.

I hope we can identify the open issues and make the port a well working port like Arm, nds32, Mips, Xtensa and Arc.

best regards
 Waldemar 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-11-20 13:09 [Buildroot] or1k system calls appear broken Joel Stanley
  2017-11-21  3:56 ` Waldemar Brodkorb
@ 2017-11-28  6:49 ` Waldemar Brodkorb
  2017-12-06  0:41   ` Stafford Horne
  1 sibling, 1 reply; 14+ messages in thread
From: Waldemar Brodkorb @ 2017-11-28  6:49 UTC (permalink / raw)
  To: buildroot

Hi Joel,
Joel Stanley wrote,

> Hello,
> 
> I did a build of the Buildroot Openrisc Qemu defconfig and attempted
> to run some userspace tools. They were failing in strange ways:

Can you test the buildroot patch I have sent to the mailinglist,
it updates uClibc-ng 1.0.27. This contains a lot of critical
bugfixes for or1k from Stafford.

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-11-28  6:49 ` Waldemar Brodkorb
@ 2017-12-06  0:41   ` Stafford Horne
  2017-12-06 12:38     ` Joel Stanley
  0 siblings, 1 reply; 14+ messages in thread
From: Stafford Horne @ 2017-12-06  0:41 UTC (permalink / raw)
  To: buildroot

On Tue, Nov 28, 2017 at 07:49:21AM +0100, Waldemar Brodkorb wrote:
> Hi Joel,
> Joel Stanley wrote,
> 
> > Hello,
> > 
> > I did a build of the Buildroot Openrisc Qemu defconfig and attempted
> > to run some userspace tools. They were failing in strange ways:
> 
> Can you test the buildroot patch I have sent to the mailinglist,
> it updates uClibc-ng 1.0.27. This contains a lot of critical
> bugfixes for or1k from Stafford.

Hello,

I tested with this I am still getting the same error.  I think I figured
out the issue though.  The issue is busybox internally calls syscall(2).

 - in unistd.h defined something like
   int syscall(nr, ....)

 - in syscall.c (common) implemented as
   int syscall(nr, arg1, arg3, arg3, arg4, arg5, arg6)

This will not work, busybox thinks syscall should have varargs calling
conventions.  But it doesnt in the uclibc implementation so no args go through.

Most architectures this will work.  But on openrisc varargs are all sent on the
stack.  Regular args are passed in registers.

For openrisc I think we need a custom implementation of syscall(2).

-Stafford

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-06  0:41   ` Stafford Horne
@ 2017-12-06 12:38     ` Joel Stanley
  2017-12-06 12:55       ` Stafford Horne
  0 siblings, 1 reply; 14+ messages in thread
From: Joel Stanley @ 2017-12-06 12:38 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 6, 2017 at 11:11 AM, Stafford Horne <shorne@gmail.com> wrote:
> I tested with this I am still getting the same error.  I think I figured
> out the issue though.  The issue is busybox internally calls syscall(2).
>
>  - in unistd.h defined something like
>    int syscall(nr, ....)
>
>  - in syscall.c (common) implemented as
>    int syscall(nr, arg1, arg3, arg3, arg4, arg5, arg6)
>
> This will not work, busybox thinks syscall should have varargs calling
> conventions.  But it doesnt in the uclibc implementation so no args go through.
>
> Most architectures this will work.  But on openrisc varargs are all sent on the
> stack.  Regular args are passed in registers.
>
> For openrisc I think we need a custom implementation of syscall(2).

Great find! I hacked up an implementation up and did a buildroot
build, and it passed my testcase (`strace ping 127.0.0.1`).

The patch is attached. It might be a better idea to load the varargs
directly into registers like the cx6 port does. Let me know what you
think, and I can post it to the uclibc-ng list.

Cheers,

Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-or1k-syscall-Pass-arguments-on-the-stack.patch
Type: text/x-patch
Size: 2557 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20171206/0e6b6207/attachment.bin>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-06 12:38     ` Joel Stanley
@ 2017-12-06 12:55       ` Stafford Horne
  2017-12-06 18:20         ` Waldemar Brodkorb
  0 siblings, 1 reply; 14+ messages in thread
From: Stafford Horne @ 2017-12-06 12:55 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 06, 2017 at 11:08:41PM +1030, Joel Stanley wrote:
> On Wed, Dec 6, 2017 at 11:11 AM, Stafford Horne <shorne@gmail.com> wrote:
> > I tested with this I am still getting the same error.  I think I figured
> > out the issue though.  The issue is busybox internally calls syscall(2).
> >
> >  - in unistd.h defined something like
> >    int syscall(nr, ....)
> >
> >  - in syscall.c (common) implemented as
> >    int syscall(nr, arg1, arg3, arg3, arg4, arg5, arg6)
> >
> > This will not work, busybox thinks syscall should have varargs calling
> > conventions.  But it doesnt in the uclibc implementation so no args go through.
> >
> > Most architectures this will work.  But on openrisc varargs are all sent on the
> > stack.  Regular args are passed in registers.
> >
> > For openrisc I think we need a custom implementation of syscall(2).
> 
> Great find! I hacked up an implementation up and did a buildroot
> build, and it passed my testcase (`strace ping 127.0.0.1`).
> 
> The patch is attached. It might be a better idea to load the varargs
> directly into registers like the cx6 port does. Let me know what you
> think, and I can post it to the uclibc-ng list.

Thanks Joel, this is pretty much what I was thinking too.

> From 8ecc5c37c1db31cde93929e9d2d969872990cb7d Mon Sep 17 00:00:00 2001
> From: Joel Stanley <joel@jms.id.au>
> Date: Wed, 6 Dec 2017 12:26:21 +1030
> Subject: [PATCH] or1k: syscall: Pass arguments on the stack
> 
> Busybox internally calls syscall(2).
> 
>  - in unistd.h defined something like
>    int syscall(nr, ....)
> 
>  - in syscall.c (common) implemented as
>    int syscall(nr, arg1, arg3, arg3, arg4, arg5, arg6)
> 
> This will not work, busybox thinks syscall should have varargs calling
> conventions.  But it doesnt in the uclibc implementation so no args go through.
> 
> Most architectures this will work.  But on openrisc varargs are all sent on the
> stack.  Regular args are passed in registers.
> 
> Commit message and idea from Stafford Horne <shorne@gmail.com>.
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
>  libc/sysdeps/linux/or1k/Makefile.arch |  2 +-
>  libc/sysdeps/linux/or1k/syscall.c     | 32 ++++++++++++++++++++++++++++++++
>  2 files changed, 33 insertions(+), 1 deletion(-)
>  create mode 100644 libc/sysdeps/linux/or1k/syscall.c
> 
> diff --git a/libc/sysdeps/linux/or1k/Makefile.arch b/libc/sysdeps/linux/or1k/Makefile.arch
> index f6758fa63fa3..191eebafde9d 100644
> --- a/libc/sysdeps/linux/or1k/Makefile.arch
> +++ b/libc/sysdeps/linux/or1k/Makefile.arch
> @@ -5,5 +5,5 @@
>  # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
>  #
>  
> -CSRC-y := __syscall_error.c __init_brk.c brk.c sbrk.c clone.c
> +CSRC-y := __syscall_error.c __init_brk.c brk.c sbrk.c clone.c syscall.c
>  SSRC-y := __longjmp.S setjmp.S or1k_clone.S
> diff --git a/libc/sysdeps/linux/or1k/syscall.c b/libc/sysdeps/linux/or1k/syscall.c
> new file mode 100644
> index 000000000000..2f4356737cf8
> --- /dev/null
> +++ b/libc/sysdeps/linux/or1k/syscall.c

I was thinking we can just update : libc/sysdeps/linux/common/syscall.c

There is not much openrisc specific about this.  But it's up to Waldemar.

> @@ -0,0 +1,32 @@
> +/*
> + *  Copyright (C) 2017 Joel Stanley <joel@jms.id.au>
> + *  Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
> + */
> +
> +#include <stdarg.h>
> +#include <sys/syscall.h>
> +#include <unistd.h>
> +
> +long int syscall (long num, ...)
> +{
> +	unsigned long arg1 = 0;
> +	unsigned long arg2 = 0;
> +	unsigned long arg3 = 0;
> +	unsigned long arg4 = 0;
> +	unsigned long arg5 = 0;
> +	unsigned long arg6 = 0;
> +	va_list arg;
> +
> +	va_start (arg, num);
> +	arg1 = va_arg (arg, unsigned long);
> +	arg2 = va_arg (arg, unsigned long);
> +	arg3 = va_arg (arg, unsigned long);
> +	arg4 = va_arg (arg, unsigned long);
> +	arg5 = va_arg (arg, unsigned long);
> +	arg6 = va_arg (arg, unsigned long);
> +	va_end (arg);
> +
> +        __asm__ volatile ( "" ::: "memory" );
> +
> +	return INLINE_SYSCALL_NCS(num, 6, arg1, arg2, arg3, arg4, arg5, arg6);
> +}
> -- 
> 2.14.1
> 

This looks ok to me its pretty much what I would have written.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-06 12:55       ` Stafford Horne
@ 2017-12-06 18:20         ` Waldemar Brodkorb
  2017-12-06 22:44           ` Stafford Horne
  0 siblings, 1 reply; 14+ messages in thread
From: Waldemar Brodkorb @ 2017-12-06 18:20 UTC (permalink / raw)
  To: buildroot

Hi Stafford,
Stafford Horne wrote,

> I was thinking we can just update : libc/sysdeps/linux/common/syscall.c
> 
> There is not much openrisc specific about this.  But it's up to Waldemar.

What are the advantages or disadvantages using it in
common/syscall.c?

Does it might break support for existing architectures using no
special syscall.c/syscall.S?

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-06 18:20         ` Waldemar Brodkorb
@ 2017-12-06 22:44           ` Stafford Horne
  2017-12-07 19:28             ` Waldemar Brodkorb
  0 siblings, 1 reply; 14+ messages in thread
From: Stafford Horne @ 2017-12-06 22:44 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 06, 2017 at 07:20:00PM +0100, Waldemar Brodkorb wrote:
> Hi Stafford,
> Stafford Horne wrote,
> 
> > I was thinking we can just update : libc/sysdeps/linux/common/syscall.c
> > 
> > There is not much openrisc specific about this.  But it's up to Waldemar.
> 
> What are the advantages or disadvantages using it in
> common/syscall.c?

The advantages would be that the code is generic enough to work for any
architecture, reducing code needed for porting.  Also the implementation
arguments will match the header delared arguments.

> Does it might break support for existing architectures using no
> special syscall.c/syscall.S?

I dont think so, but some possible downsides:
  - if those architectures have buggy handling of vargs it will have issues
  - the varargs code might be sub optimal compared to the regular args code

I did a quick audit of some of the other syscall.c implementation so see if any
other architectures use generic c code.

    ./libc/sysdeps/linux/common/syscall.c   COMMON generic implementation
    ./libc/sysdeps/linux/arc/syscall.c      Same as COMMON
    ./libc/sysdeps/linux/hppa/syscall.c     varargs + asm
    ./libc/sysdeps/linux/frv/syscall.c      asm
    ./libc/sysdeps/linux/c6x/syscall.c      varargs + asm
    ./libc/sysdeps/linux/nds32/syscall.c    GENERIC varargs (7 args?)
    ./libc/sysdeps/linux/arm/syscall.c      asm
    ./libc/sysdeps/linux/metag/syscall.c    asm

So it looks like we could remove the arc and nds32 syscall.c files as they are
generic.

The architectures using the common syscall.c are:

  bfin
  h8300
  lm32
  m68k
  microblaze
  nios2
  or1k
  sh

If we feel we dont have good test coverage for these then maybe its best we just
add this as a OR1K only file as per Joel's patch.

To reiterate my thoughts for doing this are:
 - Reduce code needed for porting
 - Have a implementation which matches the unistd.h definition

-Stafford

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-06 22:44           ` Stafford Horne
@ 2017-12-07 19:28             ` Waldemar Brodkorb
  2017-12-07 19:33               ` Max Filippov
  0 siblings, 1 reply; 14+ messages in thread
From: Waldemar Brodkorb @ 2017-12-07 19:28 UTC (permalink / raw)
  To: buildroot

Hi,
Stafford Horne wrote,

> On Wed, Dec 06, 2017 at 07:20:00PM +0100, Waldemar Brodkorb wrote:
> > Hi Stafford,
> > Stafford Horne wrote,
> > 
> > > I was thinking we can just update : libc/sysdeps/linux/common/syscall.c
> > > 
> > > There is not much openrisc specific about this.  But it's up to Waldemar.
> > 
> > What are the advantages or disadvantages using it in
> > common/syscall.c?
> 
> The advantages would be that the code is generic enough to work for any
> architecture, reducing code needed for porting.  Also the implementation
> arguments will match the header delared arguments.
> 
> > Does it might break support for existing architectures using no
> > special syscall.c/syscall.S?
> 
> I dont think so, but some possible downsides:
>   - if those architectures have buggy handling of vargs it will have issues
>   - the varargs code might be sub optimal compared to the regular args code
> 
> I did a quick audit of some of the other syscall.c implementation so see if any
> other architectures use generic c code.
> 
>     ./libc/sysdeps/linux/common/syscall.c   COMMON generic implementation
>     ./libc/sysdeps/linux/arc/syscall.c      Same as COMMON
>     ./libc/sysdeps/linux/hppa/syscall.c     varargs + asm
>     ./libc/sysdeps/linux/frv/syscall.c      asm
>     ./libc/sysdeps/linux/c6x/syscall.c      varargs + asm
>     ./libc/sysdeps/linux/nds32/syscall.c    GENERIC varargs (7 args?)
>     ./libc/sysdeps/linux/arm/syscall.c      asm
>     ./libc/sysdeps/linux/metag/syscall.c    asm
> 
> So it looks like we could remove the arc and nds32 syscall.c files as they are
> generic.
> 
> The architectures using the common syscall.c are:
> 
>   bfin
>   h8300
>   lm32
>   m68k
>   microblaze
>   nios2
>   or1k
>   sh
> 
> If we feel we dont have good test coverage for these then maybe its best we just
> add this as a OR1K only file as per Joel's patch.

I checked the test suite and no syscall() is used.
Would it be possible for you to suggest a test case for syscall()?

Then I can run the tests for all architectures, where I can do
runtime testing.

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-07 19:28             ` Waldemar Brodkorb
@ 2017-12-07 19:33               ` Max Filippov
  2017-12-10 10:17                 ` Waldemar Brodkorb
  0 siblings, 1 reply; 14+ messages in thread
From: Max Filippov @ 2017-12-07 19:33 UTC (permalink / raw)
  To: buildroot

On Thu, Dec 7, 2017 at 11:28 AM, Waldemar Brodkorb <wbx@openadk.org> wrote:
> I checked the test suite and no syscall() is used.
> Would it be possible for you to suggest a test case for syscall()?
>
> Then I can run the tests for all architectures, where I can do
> runtime testing.

LTP ( http://linux-test-project.github.io )?

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-07 19:33               ` Max Filippov
@ 2017-12-10 10:17                 ` Waldemar Brodkorb
  2017-12-10 11:10                   ` Stafford Horne
  0 siblings, 1 reply; 14+ messages in thread
From: Waldemar Brodkorb @ 2017-12-10 10:17 UTC (permalink / raw)
  To: buildroot

Hi Max,
Max Filippov wrote,

> On Thu, Dec 7, 2017 at 11:28 AM, Waldemar Brodkorb <wbx@openadk.org> wrote:
> > I checked the test suite and no syscall() is used.
> > Would it be possible for you to suggest a test case for syscall()?
> >
> > Then I can run the tests for all architectures, where I can do
> > runtime testing.
> 
> LTP ( http://linux-test-project.github.io )?

The problem with LTP is that some of the automatic tests via
qemu in system mode are done in a small environment, which not much
RAM or any hard disk. I somtimes try to make more architectures and
targets to work with LTP, but for this small cleanup I would
prefer a simple test case included in uClibc-ng-test.

Anyone?

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-10 10:17                 ` Waldemar Brodkorb
@ 2017-12-10 11:10                   ` Stafford Horne
  2017-12-12 19:37                     ` Waldemar Brodkorb
  0 siblings, 1 reply; 14+ messages in thread
From: Stafford Horne @ 2017-12-10 11:10 UTC (permalink / raw)
  To: buildroot

On Sun, Dec 10, 2017 at 11:17:55AM +0100, Waldemar Brodkorb wrote:
> Hi Max,
> Max Filippov wrote,
> 
> > On Thu, Dec 7, 2017 at 11:28 AM, Waldemar Brodkorb <wbx@openadk.org> wrote:
> > > I checked the test suite and no syscall() is used.
> > > Would it be possible for you to suggest a test case for syscall()?
> > >
> > > Then I can run the tests for all architectures, where I can do
> > > runtime testing.
> > 
> > LTP ( http://linux-test-project.github.io )?
> 
> The problem with LTP is that some of the automatic tests via
> qemu in system mode are done in a small environment, which not much
> RAM or any hard disk. I somtimes try to make more architectures and
> targets to work with LTP, but for this small cleanup I would
> prefer a simple test case included in uClibc-ng-test.

I agree, we are trying to test a specific layer of uclibc, its not a linux issue
as per my opinion.

> Anyone?

I have an idea to write simple tests to test syscall() with examples of 0-6
args.  I havent had time the last few days for much coding though.

Perhaps you can accept Joel's patch, and in the mean time I can work on the
testing and cosolidation patch?

-Stafford

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] or1k system calls appear broken
  2017-12-10 11:10                   ` Stafford Horne
@ 2017-12-12 19:37                     ` Waldemar Brodkorb
  0 siblings, 0 replies; 14+ messages in thread
From: Waldemar Brodkorb @ 2017-12-12 19:37 UTC (permalink / raw)
  To: buildroot

Hi,
Stafford Horne wrote,

> I have an idea to write simple tests to test syscall() with examples of 0-6
> args.  I havent had time the last few days for much coding though.
> 
> Perhaps you can accept Joel's patch, and in the mean time I can work on the
> testing and cosolidation patch?

Patch applied and pushed.

I have seen your progress on IRC and hopefully can do some testing
this week.

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-12-12 19:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-20 13:09 [Buildroot] or1k system calls appear broken Joel Stanley
2017-11-21  3:56 ` Waldemar Brodkorb
     [not found]   ` <20171121092441.GW29237@lianli.shorne-pla.net>
2017-11-21 19:56     ` Waldemar Brodkorb
2017-11-28  6:49 ` Waldemar Brodkorb
2017-12-06  0:41   ` Stafford Horne
2017-12-06 12:38     ` Joel Stanley
2017-12-06 12:55       ` Stafford Horne
2017-12-06 18:20         ` Waldemar Brodkorb
2017-12-06 22:44           ` Stafford Horne
2017-12-07 19:28             ` Waldemar Brodkorb
2017-12-07 19:33               ` Max Filippov
2017-12-10 10:17                 ` Waldemar Brodkorb
2017-12-10 11:10                   ` Stafford Horne
2017-12-12 19:37                     ` Waldemar Brodkorb

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.