作者SILee (打卡上班的日子)
看板LinuxDev
标题[问题] link出现的错误
时间Thu May 1 21:37:03 2008
请问程式link时出现这样的错误的错误讯息是什麽原因造成的?
undefined reference to '__stack_chk_fail'
我只要在程式里面宣告一个大一点的array,在link阶段就会出现这种错误
但是把array拿到function外面宣告成global的就没这个问题
看起来像是程式将local variable塞到stack时overflow了
但是stack overflow应该是run time error怎麽会在link就出问题?
thanks!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.59.105.115
1F:推 Bencrie:不能用malloc吗 ? 05/01 21:37
2F:→ SILee:我是在Linux上开发一些低阶的系统程式 没有OS的support 05/01 21:38
3F:→ SILee:所以也没有malloc这类的指令可以用 05/01 21:39
4F:推 Falldog:kmalloc? 05/01 21:59