• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode 7 hanging with multi-dimensional vector resize DISREGARD
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode 7 hanging with multi-dimensional vector resize DISREGARD


  • Subject: Re: Xcode 7 hanging with multi-dimensional vector resize DISREGARD
  • From: Michael McLaughlin <email@hidden>
  • Date: Fri, 11 Dec 2015 14:38:35 -0500

Please ignore my last email.  I was indeed off by one index.

On Dec 11, 2015, at 2:11 PM, Jens Alfke <email@hidden> wrote:


On Dec 11, 2015, at 10:23 AM, Michael McLaughlin <email@hidden> 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
email@hidden





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Xcode 7 hanging with multi-dimensional vector resize (From: Michael McLaughlin <email@hidden>)

  • Prev by Date: Re: Xcode 7 hanging with multi-dimensional vector resize
  • Next by Date: XC 7 and uiviewcontroller outlets
  • Previous by thread: Re: Xcode 7 hanging with multi-dimensional vector resize
  • Next by thread: XC 7 and uiviewcontroller outlets
  • Index(es):
    • Date
    • Thread