public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH 0/1] brk: use direct syscalls
@ 2022-11-28  9:15 Teo Couprie Diaz
  2022-11-28  9:15 ` [LTP] [RFC PATCH 1/1] syscalls/brk: use direct syscall Teo Couprie Diaz
  2022-11-28 19:30 ` [LTP] [RFC PATCH 0/1] brk: use direct syscalls Petr Vorel
  0 siblings, 2 replies; 10+ messages in thread
From: Teo Couprie Diaz @ 2022-11-28  9:15 UTC (permalink / raw)
  To: ltp

Hello LTP maintainers,

This patch slightly reworks the brk01 and brk02 tests to use direct
syscalls with tst_syscall rather than calling through the libc.

While running LTP on a musl-based distribution, we noticed that the brk
tests were failing. It turns out that Musl prevents the use of brk
with their wrapper: it always returns an error.
This isn't too egregious as using brk is deprecated in favor of malloc
and it isn't part of POSIX anymore since POSIX.1-2001, but it _is_
different from glibc's beavior, which allows using it.

This patch allows proper testing of brk's functionality, independent of
libc specifics, and thus allows the tests to pass on Musl-based
distributions like Alpine.

Do you think this is a correct approach for LTP ?
From what I could see there are a few tests that use tst_syscall directly
and it doesn't affect the logic much for brk.

Green build:
https://github.com/Teo-CD/ltp/actions/runs/3563193507

This was discovered in the context of the Morello project[0].
[0]: https://www.morello-project.org/

Teo Couprie Diaz (1):
  syscalls/brk: use direct syscall

 testcases/kernel/syscalls/brk/brk01.c | 15 ++++++---------
 testcases/kernel/syscalls/brk/brk02.c | 14 ++++++--------
 2 files changed, 12 insertions(+), 17 deletions(-)


base-commit: 498247917f40b0a82cb149e2ec1cb518acd7b632
-- 
2.25.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2022-11-30 14:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-28  9:15 [LTP] [RFC PATCH 0/1] brk: use direct syscalls Teo Couprie Diaz
2022-11-28  9:15 ` [LTP] [RFC PATCH 1/1] syscalls/brk: use direct syscall Teo Couprie Diaz
2022-11-28 19:30 ` [LTP] [RFC PATCH 0/1] brk: use direct syscalls Petr Vorel
2022-11-29 13:09   ` Cyril Hrubis
2022-11-29 13:36     ` Petr Vorel
2022-11-29 13:40       ` Cyril Hrubis
2022-11-30 13:03         ` Teo Couprie Diaz
2022-11-30 13:15           ` Cyril Hrubis
2022-11-30 14:22             ` Teo Couprie Diaz
2022-11-30 12:49   ` Teo Couprie Diaz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox