Debugging Solaris pstack输出:什么是;系统“0”;什么意思?
我在堆栈顶部遇到了“SYS#0”,并且找不到任何关于这意味着什么的文档Debugging Solaris pstack输出:什么是;系统“0”;什么意思?,debugging,gcc,solaris,Debugging,Gcc,Solaris,我在堆栈顶部遇到了“SYS#0”,并且找不到任何关于这意味着什么的文档 编译程序:g++ 操作系统:Solaris 9 拱门:斯巴克 内存管理器libcacad_32.so from 我们使用“gcore”生成一个核心文件。查看针对核心文件运行“pstack”命令的输出,唯一一个正在执行任何有趣操作的线程在其调用堆栈的最顶端有以下内容: ff309858 SYS#0 () ff309848 void MyHashMap<const void*,unsigned,AlignedMm
- 编译程序:g++
- 操作系统:Solaris 9
- 拱门:斯巴克
- 内存管理器libcacad_32.so from
ff309858 SYS#0 ()
ff309848 void MyHashMap<const void*,unsigned,AlignedMmapInstance<65536U>::SourceHeap>::set(const void*,unsigned) (ff31eed4, 9bf20000, 10000, 40, 9bf1fff0, ff31e738) + 134
...
我在Sun文档中找不到任何关于此语法的提及
编辑:在执行gcore之前,该进程似乎已挂起。“SYS#0”与进程挂起是否存在某种关联
编辑:添加了下一个堆栈框架和到囤积、pflags输出的链接
编辑:接受的答案是正确的。此外,至少在SPARC上,g1
注册了系统调用号,但在我们的核心文件中似乎不是这样
“什么是间接系统调用?”可能是回答另一个问题的好材料。试试这个:
$ cat foo.c
#include <stdio.h>
int main(int argc, char *argv[]) {
char buf[1024];
proc_sysname(0, buf, 1024);
printf("%s\n", buf);
}
$ gcc -ofoo -lproc foo.c
$ ./foo
SYS#0
$
间接系统调用
syscall(SYS#u syscall,foo,bar,…)
相当于直接调用syscall(foo,bar,…)
SYS#0之后的帧是什么?我们正在使用的囤积内存管理器版本3.5.1中。
$ cat foo.c
#include <stdio.h>
int main(int argc, char *argv[]) {
char buf[1024];
proc_sysname(0, buf, 1024);
printf("%s\n", buf);
}
$ gcc -ofoo -lproc foo.c
$ ./foo
SYS#0
$
/* syscall enumeration MUST begin with 1 */
/*
* SunOS/SPARC uses 0 for the indirect system call SYS_syscall
* but this doesn't count because it is just another way
* to specify the real system call number.
*/
#define SYS_syscall 0