C Unexpected error from Valgrind

I am using Freebsd 10.4-RELEASE-p9 on i386. Today after a hiatus from programming work, I tried to use Valgrind and got the following error:

valgrind: I failed to allocate space for the application's stack.
valgrind: This may be the result of a very large --main-stacksize=
valgrind: setting. Cannot continue. Sorry.


Googling for this brought me to an old, unresolved bug report here:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224878

I tried changing the --main-stacksize option but nothing changed.

Does anyone have a suggestion for an angle of attack for this problem?

Valgrind has been a bit flaky on FreeBSD recently, is this another symptom?
 
No reply but I'll post my progress.

I found several things online. First I tried the source code for valgrind, here:

http://valgrind.org/downloads/current.html#current

This won't install since it doesn't like freebsd:

checking for a supported OS... no (freebsd10.4)
configure: error: Valgrind is operating system specific. Sorry.


I looked at another page here:

https://bitbucket.org/stass/valgrind-freebsd

This one was last updated two years ago, so I suppose it can't fix the bug.

I also downloaded this:

https://github.com/FreeBSDFoundation/valgrind

It was last updated 17 days ago, and it says "FreeBSDFoundation", I'm not sure if it's official or not though.

I had to install "automake" to get this to work, but it still stopped at the same error:

configure: error: Valgrind is operating system specific. Sorry.

I tried various greps of the source code to find how to make FreeBSD work, but didn't see anything obvious.
 
In the mean time, a new version of valgrind has come out, yet the maintainer seems to be completely ignoring these bug reports (there are now two of them for the same bug).
 
Somewhat related - I found that using ASAN and UBSAN libraries is better than valgrind. Programs built with these libs and the corresponding compiler flags run a bit faster than under valgrind and more errors are detected.
 
Back
Top