On 02/02/2012, at 12:20 AM, john skaller wrote:

> Pthreads are not working right. tools/launcg crashes,

OMFG .. I bow down to the Valgrind God!

Yep, Valgrind found the bug I've been hunting for two week in 2 seconds.

  var out = array_alloc[&char] t.len+1;

is making an array of char* to pass to execve. This is supposed to allocate
an array of the number of args + 1 for the NULL pointer terminator.

But it doesn't.. nope, it doesn't, this does:

  var out = array_alloc[&char] (t.len+1uz);

The first formula made an array 1 too short .. and the proceeded to increment
the pointer to the already too short array by one slot, so the store is actually
two slots too short!


--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to