Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock sleep, crash #11

Closed
mmxcraft opened this issue Aug 3, 2020 · 2 comments
Closed

Mock sleep, crash #11

mmxcraft opened this issue Aug 3, 2020 · 2 comments

Comments

@mmxcraft
Copy link

mmxcraft commented Aug 3, 2020

I use Emock to mock sleep, it will crash at exit.

TEST_F(MockExpect, mockSleep)
{
EMOCK(sleep).stubs().will(returnValue(1));
sleep(5);

GlobalMockObject::verify();

}

call stack:
Program received signal SIGSEGV, Segmentation fault.
__GI__exit (status=status@entry=0) at ../sysdeps/unix/sysv/linux/_exit.c:27
27 ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.
(gdb) where
#0 __GI__exit (status=status@entry=0) at ../sysdeps/unix/sysv/linux/_exit.c:27
#1 0x00007ffff6c051c2 in __run_exit_handlers (status=0, listp=, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:132
#2 0x00007ffff6c051ea in __GI_exit (status=) at exit.c:139
#3 0x00007ffff6be3b9e in __libc_start_main (main=0x5555555609da <main(int, char**)>, argc=2, argv=0x7fffffffe498, init=, fini=, rtld_fini=, stack_end=0x7fffffffe488)
at ../csu/libc-start.c:344
#4 0x00005555555608fa in _start ()

my system: Ubuntu18, g++ 7.3

@orca-zhang
Copy link
Member

Sorry, functions that uses syscall has not been supported yet.
: (

@mmxcraft
Copy link
Author

mmxcraft commented Aug 5, 2020

Thanks, got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants