|
From: Anton K. <dra...@gm...> - 2013-05-05 14:20:16
|
Hi! I'm doing a port of some custom OS to usermode (x86/linux), just as usermode linux, with one of goals to use valgrind on it. To make some things simplier and explicit, it doesn't link with host's libc at now, but have some minimal subset (of libc) builtin. I've faced a problem when running on valgrind, stack is not original one and signal arrived: " Can't extend stack during signal delivery for thread", and it segfaults. What's strange, by simple run or gdb it perfrom normally. I reproduced it with small program. I also noticied, when program is linked with libc, everything goes ok. Example is attached. It's like so: $ make # build two versions, with libc and bare one $ make TARGET=valgrind_test vg # run bare version, it will sleeps until killed with SIGCHLD (17). On signal it segfaults $ gbd valgrind_test (gdb) r # on SIGCHILD it exits normally $ make TARGET=valgrind_test_libc vg # run libc version, sleeps until SIGCHLD and exit ok. I also attach logs of my run. Valgrind with more debugging info was used (patch attached) So, the question is, what mechanism can be used to make bare version act like libc one? I've tried to do STACK_REGISTER, but it brought no success. I've tried valgrind 3.8.1 and svn r13380, all the same. With best regards, Anton |