Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4008488
  • 博文数量: 536
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4825
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(536)

文章存档

2024年(3)

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(252)

2006年(73)

分类: C/C++

2009-08-27 11:10:41

同样的问题Linux, AIX, HPUX测试都没有问题,solaris出core了。

SunOS Bug:

$ uname -a
SunOS solaris10 5.10 Generic_127127-11 sun4u sparc SUNW,Ultra-250

$ gcc -v
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6
$

$ cat a.c
#include <stdio.h>

int main(int argc, char **argv)
{
  char *p = NULL;
  fprintf(stderr, "%s\n", p);

  return (0);
}
$ gcc -Wall a.c
$ ./a.out
Segmentation Fault(coredump)
$ gdb ./a.out core
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10"...
(no debugging symbols found)
Reading symbols from /lib/libc.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.1
Reading symbols from /lib/ld.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/ld.so.1
Core was generated by `./a.out

Program terminated with signal 11, Segmentation fault.
#0  0xff2b1d50 in strlen () from /lib/libc.so.1
(gdb) where
#0  0xff2b1d50 in strlen () from /lib/libc.so.1
#1  0xff31a324 in _ndoprnt () from /lib/libc.so.1
#2  0xff31c334 in fprintf () from /lib/libc.so.1
#3  0x000106c8 in main ()

阅读(2425) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~