[Vm-dev] [commit][3753] Do not use -O3 optimization, -O2 is safer and works well.
David T. Lewis
lewis at mail.msen.com
Wed Dec 21 14:35:00 UTC 2016
On Wed, Dec 21, 2016 at 10:11:39AM +0000, Jan Vrany wrote:
>
> On Tue, 2016-12-20 at 21:54 -0500, David T. Lewis wrote:
> > ??
> > On Wed, Dec 21, 2016 at 10:40:32AM +0800, Ben Coman wrote:
> > > ??
> > > I'd be interested to know the reason sends get slower (if known).
> > > cheers -ben
> >
> > No clue, I was just sanity checking to make sure that -O2 was not
> > horribly
> > worse. It was not. But I suspect all of this is likely to vary
> > depending on
> > gcc compiler version and phase of the moon.
>
> This post:
>
> http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html
>
> explains the dependency on moon phases (and compiler versions) :-)
>
Thanks. Indeed there is probably some undefined C behavior in there, although
I was not able to spot it. If anyone is interested in lending their eyes to
the problem, I was able to localize the crash to intermittent segfaults that
occurred in OSProcessPlugin>>fixPointersInArrayOfStrings: which is generated
in C (for a V3 image, not Spur) as:
/* Use the address offsets in offsetArray to fix up the pointers in cStringArray.
The result is a C array of pointers to char, used for argv and env vectors. */
static sqInt fixPointersInArrayOfStringswithOffsetscount(char *flattenedArrayOfStrings, sqInt *offsetArray, sqInt count) {
sqInt idx;
char **ptr;
ptr = ((char **) flattenedArrayOfStrings);
idx = 0;
while (idx < count) {
ptr[idx] = (flattenedArrayOfStrings + (((offsetArray[idx]) >> 1)));
idx += 1;
}
return null;
}
More information about the Vm-dev
mailing list