diff options
author | Yann Sionneau <ysionneau@kalray.eu> | 2019-04-12 17:13:22 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbrodkorb@conet.de> | 2019-04-14 09:57:39 +0200 |
commit | a0c8d634ff51697fbe86483c32d787d5896fa43f (patch) | |
tree | 1fcfa9c4f5063ab8caa990ac2da9b5ced65797cc /test/dlopen/dlstatic.c | |
parent | 4ca1af3298dae7b24bdc2607d09778f9dfe6e1e4 (diff) |
Fix tst-mallocfork test
This test was changed from using fork to vfork by:
https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=822e4896c1072b9f84b17f4f7bcb7c51d1a57723
This change was wrong because man page says the child of vfork() must ONLY do either:
- a call to one of exec(2)
- a call to _exit(2)
- get killed by a signal
BUT the test case does:
- a call to kill
- and also a call to exit(3) and not _exit(2)
This test produces a double free() causing assert in free because this is called several times:
https://elixir.bootlin.com/uclibc-ng/latest/source/libc/stdlib/_atexit.c#L270
So, it seems wrong both in theory (according to man page) and in fact in practice (assert in free).
Here I propose to get back to testing fork(), which is the original test case from:
https://sourceware.org/bugzilla/show_bug.cgi?id=838
And to just "PASS" on no-mmu systems.
For the record, here is the assert call stack:
FAIL tst-mallocfork got 1 expected 0
./tst-mallocfork: libc/stdlib/malloc-standard/malloc.c: 149: __do_check_inuse_chunk: Assertion `((((mchunkptr)(((char*)(p))+((p)->size & ~0x1)))->size) & 0x1)' failed.
Didn't expect signal from child: got `Aborted'
0 free (mem=0x3a010) at libc/stdlib/malloc-standard/free.c:285
1 0x00000000000220c4 in __exit_handler (status=1) at libc/stdlib/_atexit.c:270
2 0x000000000001afa0 in __GI_exit (rv=1) at libc/stdlib/_atexit.c:301
3 0x0000000000010dcc in main (argc=1, argv=0x7ffffffd98) at ../test-skeleton.c:405
4 0x000000000001cba8 in __uClibc_main (main=0x10988 <main>, argc=1, argv=0x7ffffffd98, app_init=0x100e8, app_fini=0x23918 <_fini>, rtld_fini=0x0 <k1c_start>, stack_end=0x7ffffffd90) at libc/misc/internals/__uClibc_main.c:512
5 0x00000000000eb8b8 in ?? ()
Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
Diffstat (limited to 'test/dlopen/dlstatic.c')
0 files changed, 0 insertions, 0 deletions