Bus error

来源:互联网 发布:淘宝店外其他来源 编辑:程序博客网 时间:2024/04/30 14:42
给两个例子:


1、在设备上



u32 sqlite3_get_s8(sqlite3_res *res, u32 nrow, s8 *fields, s8 **dst)
{
u32 ret;
//这里有问题,返回是一个s8的指针类型
*dst = (s8 )sqlite3_get_value(res, nrow, fields, &ret);

return ret;
}


出现
root@OpenWrt:/tmp# ./test
Bus error
root@OpenWrt:/tmp


2、在pc上


char *buff="aaaaa";


int get_char_p(char **buf)

{

//这里有问题,返回是一个s8的指针类型

*buf=(char)buff;
};


int main()
{
char *eth=NULL;

get_char_p(ðeth);
printf("eth %s\n", eth);

return 0;


}


[root@localhost t]# ./a.out    
段错误 (core dumped)
[root@localhost t]# 
0 0