当我尝试使用vfork()
. 这是代码!
#include <stdio.h>
#include <unistd.h>
main()
{
if(vfork() == 0)
{
printf("This is the child process\n");
} else{
printf("This is the parent process\n");
}
}
并使用 gdb 错误信息进行调试:
(gdb) r
Starting program: /home/shawn/Documents/gcc/demo/./a.out
This is the child process
This is the parent process
a.out: cxa_atexit.c:99: __new_exitfn: Assertion `l != ((void *)0)' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff7a48f77 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
有人可以帮忙吗?
我在用:
- ubuntu 13.10 64位操作系统
- gcc 版本 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8)