由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 偶要疯了!
相关主题
怎样创造一个 segv (转载)SunOS 5.8, ld.so.1, fatal: libstdc++.so.5 open failed...
about Sun Workstations[转载] UNIX下的strtok
关于64位程序[转载] 活见鬼了---搞不定的程序
Anyone give some opinion about AIXWhat's defference between Saloris&SunOs?
rm 后的文件可以恢复不?Solaris Versions
netscape 莫名crashwhat's the use of "ta"
[转载] Unix下什么程序可以查机器型号?How to implement sopen on unix?
检了一台Sun spac workstation机器急!!!!
相关话题的讨论汇总
话题: phashlist话题: ent话题: maxnodes话题: pcursv话题: dd
进入Unix版参与讨论
1 (共1页)
j**t
发帖数: 439
1
已经一天了,真的要疯掉了.好象是个很小的问题,可就是通不过.
double ent,dd;
Node* pHashList;
pCurSV=....; //此处略去
pHashList=pCurSV->hashList;
maxNodes=pCurSV->maxNodes;
for (i=0;i {
ent=pHashList[i]->value; //value is a double
dd=ent+1;
printf("outcom =%f\n",i)
}
每次到i=5后,就出错.Segmentation Fault.
去掉dd=ent+1那一行, 则顺利通过.
真是奇怪极了.
OS is SunOS 5.7 Generic_106541-08 sun4u sparc SUNW,Ultra-60
可能和浮点运算有关.哪位大侠指点一下?
G**T
发帖数: 388
2
not sure ur problem. but ..

what is pHashList[i]?
the ith hash list's point?
what's the definition of object pHashList?
I think the problem maybe here.

【在 j**t 的大作中提到】
: 已经一天了,真的要疯掉了.好象是个很小的问题,可就是通不过.
: double ent,dd;
: Node* pHashList;
: pCurSV=....; //此处略去
: pHashList=pCurSV->hashList;
: maxNodes=pCurSV->maxNodes;
: for (i=0;i: {
: ent=pHashList[i]->value; //value is a double
: dd=ent+1;

w******r
发帖数: 55
3
it does not mean anything wrong with "dd=ent+1" here.
the segmentation error may occur before that line, most
likely your pointer
manipulations. you'd better to make sure your array does
not go out of bounds, no invalid objects in that array, or
even something already went wrong in codes other than this
piece!
use jdb or xxjdb to monitor the memeory behaviors.
segmentation faults do drive people crazy.

【在 j**t 的大作中提到】
: 已经一天了,真的要疯掉了.好象是个很小的问题,可就是通不过.
: double ent,dd;
: Node* pHashList;
: pCurSV=....; //此处略去
: pHashList=pCurSV->hashList;
: maxNodes=pCurSV->maxNodes;
: for (i=0;i: {
: ent=pHashList[i]->value; //value is a double
: dd=ent+1;

o**a
发帖数: 86
4
the pHashList[i] looks weird !
can you make sure Nodes are organized as a array ?
it seems more like a link list to me by its name.
so you can't cite with [] unless it's been overloaded.
在 jjtt (行者) 的大作中提到: 】
s******s
发帖数: 35
5
I guess it is the type of i is int while printf try to
acces a float type, whihc casue the access violaion.
so try to change printf("outcom=%d\n",i);
just guess.

【在 o**a 的大作中提到】
: the pHashList[i] looks weird !
: can you make sure Nodes are organized as a array ?
: it seems more like a link list to me by its name.
: so you can't cite with [] unless it's been overloaded.
: 在 jjtt (行者) 的大作中提到: 】

t****n
发帖数: 1347
6
Ding!
I think this is the right answer.

【在 s******s 的大作中提到】
: I guess it is the type of i is int while printf try to
: acces a float type, whihc casue the access violaion.
: so try to change printf("outcom=%d\n",i);
: just guess.

1 (共1页)
进入Unix版参与讨论
相关主题
急!!!!rm 后的文件可以恢复不?
为何我在Solaris下用netscape看不了中文?netscape 莫名crash
求救,ZhXWin Install.[转载] Unix下什么程序可以查机器型号?
为什么普通用户无法登陆?检了一台Sun spac workstation机器
怎样创造一个 segv (转载)SunOS 5.8, ld.so.1, fatal: libstdc++.so.5 open failed...
about Sun Workstations[转载] UNIX下的strtok
关于64位程序[转载] 活见鬼了---搞不定的程序
Anyone give some opinion about AIXWhat's defference between Saloris&SunOs?
相关话题的讨论汇总
话题: phashlist话题: ent话题: maxnodes话题: pcursv话题: dd