BBS水木清华站∶精华区

发信人: chenl (bigmouth), 信区: Linux 
标  题: Re: 求助高手 (转载) 
发信站: BBS 水木清华站 (Sat Aug  7 09:02:19 1999) WWW-POST 
 
【 在 valencia (郭靖) 的大作中提到: 】 
∶ 【 以下文字转载自 Unix 讨论区 】 
∶ 【 原文由 valencia 所发表 】 
∶ 我的一个程序(规模比较大):其中有一个函数中 
∶ 有一个变量:result, 
∶ 在执行过程中从没有修改过,但在某个地方 
∶ 突然变了,在其后语句“return result” 
∶ 时,程序死掉了有(SIGILL"信号) 
∶ 后修改程序,不return result 而是return 1 
∶ 依然以SIGILL死掉 
∶ 大虾门认为回有什么样的原因造成着个结果?怎么处理? 万分感谢 
∶ 在详细解释以下SIGILLC出现的原因 
∶ 我看了头文件“/* (*) illegal instruction (not reset when caught)*/” 
∶ aix                                     ^^^^^^^^^^^^^^^^^^^^^^^??? what  
∶ mean? 
∶ 感觉默默忽忽的,还是补台明白 
In C, all variants are stored in the stack. Some functions 
,as scanf use less_strict prototype check. So, the procedure  
as below will give u un-anticipated result: 
char i; 
int b; 
scanf("%d", &i); 
the scanf will fill in a integer result at the address i,  
to overlap the buffer of b.  
-- 
 
  舟摇摇而轻扬, 风飘飘以吹衣, 
  问征夫以前路, 恨晨光之曦微. 
 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 202.115.6.100]  

BBS水木清华站∶精华区