Valgrind gives an error for nearly everything (Warning: client switching stacks?)

荒凉一梦 提交于 2019-12-04 22:30:23

I think I blew my first stack!

From here

Followed by many error messages like "Invalid read/write" containing a note: "Address is on thread 1's stack" then the cause is very simple. You are just allocating too large variables on stack - in my case I had too large array, as local variable, in one of functions.

Reducing sizes fixed the problem.

To point out the obvious, you could also do what valgrind suggests, and that is to change the maximum stack frame using --max-stackframe=4728552. You solved your problem directly, but this would also suppress those "Invalid read" errors.

On Linux, I was valgrinding a program, and was very sure that it was not overrunning its stack. To suppress the client switching stacks? error shown here, I used:

ulimit -s unlimited

...Now valgrind runs as desired!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!