No.  As my code showed, I was implementing 1-based (FORTRAN) arrays.

While I am still curious about this, I think I’ll just flatten my matrices and 
do the indexing manually.  This is feasible for me since my matrices are never 
more than 3-D.  I tried this and it does not hang.

> On Dec 11, 2015, at 2:11 PM, Jens Alfke <j...@mooseyard.com> wrote:
> 
> 
>> On Dec 11, 2015, at 10:23 AM, Michael McLaughlin <mmclaughl...@cox.net 
>> <mailto:mmclaughl...@cox.net>> wrote:
>> 
>>          v2.resize(length);
>>          for (c = 0;c <= length;c++)
>>             v2[c].resize(length2);
> 
> You have an off-by-one bug and are writing past the end of the v2 vector. 
> (The “<=“ should be “<“.) For random reasons depending on how the heap 
> happens to be laid out at the moment, this will sometimes be benign and 
> sometimes cause terrible problems.
> 
> PSA: Turning on the Address Sanitizer in Xcode 7 (it’s in the Run and Test 
> sections of the scheme editor) would probably have caught this at the moment 
> it occurred.
> 
> —Jens
> 

--
Michael McLaughlin
mmclaughl...@cox.net





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (Xcode-users@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to