Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu 14.04 x86_64 运行时错误 #30

Closed
IronBlood opened this issue Oct 1, 2014 · 3 comments
Closed

ubuntu 14.04 x86_64 运行时错误 #30

IronBlood opened this issue Oct 1, 2014 · 3 comments

Comments

@IronBlood
Copy link
Member

telnet 下回复另一个 ID 的帖子,在 add_notification.c 函数中执行到 free 的时候出错。

Debug 显示:

glibc detected free(): invalid next size (fast)

如果此处 title_utf8 换成声明为字符数组,而非通过 malloc() 获取,则提示有关什么 stack smashing detected 的错误。最终指向的是:

in __GI_raise at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.

初步检查如 stackoverflow 上的这个 QA 显示:

#include <stdlib.h>
void foo() { abort(); }
int main() { foo(); return 0; }

该代码在调试的时候同样会返回有关 __GI_raise 的错误。

@IronBlood
Copy link
Member Author

做了如下的尝试:

  1. 编译了 glibc-2.20、gcc-4.9.1;
  2. 附带参数 -fPIE 重新编译 ythtlib、libythtbbs
  3. 编译 src 的时候加上 -pie 选项,同时指向第一步编译出来的 libc.so、libm.a

目前发帖暂不会掉线。有待进一步测试。

@IronBlood
Copy link
Member Author

可能与 a981004 有关

@IronBlood
Copy link
Member Author

近一个月没有出现该问题,关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant