Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Read Access exception in xtree for map::insert

Read Access exception in xtree for map::insert

Scheduled Pinned Locked Moved C / C++ / MFC
helpperformance
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    hi I am getting a read access error in xtree line 1607. This after i have inserted 4,527 map entries successfully I did a call to map::maxsize using a unsigned integer and it came up with a number 0x76767676 I dont think memory is the issue as I have 64 gb machine I bypassed the entry just to see if there was something wrong with that entry and go an error on the next as well here is the microsoft code I underlined the while statement with the issue intellesense is giving the message _Trnode was 0x40D51F000040. any guidence who i shoud go about debugging would be appreciated

    template
    _Tree_find_result<_Nodeptr> _Find_lower_bound(const _Keyty& _Keyval) const {
    const auto _Scary = _Get_scary();
    _Tree_find_result<_Nodeptr> _Result{{_Scary->_Myhead->_Parent, _Tree_child::_Right}, _Scary->_Myhead};
    _Nodeptr _Trynode = _Result._Location._Parent;
    while (!_Trynode->_Isnil) {
    _Result._Location._Parent = _Trynode;
    if (_DEBUG_LT_PRED(_Getcomp(), _Traits::_Kfn(_Trynode->_Myval), _Keyval)) {
    _Result._Location._Child = _Tree_child::_Right;
    _Trynode = _Trynode->_Right;
    } else {
    _Result._Location._Child = _Tree_child::_Left;
    _Result._Bound = _Trynode;
    _Trynode = _Trynode->_Left;
    }
    }

    F 1 Reply Last reply
    0
    • F ForNow

      hi I am getting a read access error in xtree line 1607. This after i have inserted 4,527 map entries successfully I did a call to map::maxsize using a unsigned integer and it came up with a number 0x76767676 I dont think memory is the issue as I have 64 gb machine I bypassed the entry just to see if there was something wrong with that entry and go an error on the next as well here is the microsoft code I underlined the while statement with the issue intellesense is giving the message _Trnode was 0x40D51F000040. any guidence who i shoud go about debugging would be appreciated

      template
      _Tree_find_result<_Nodeptr> _Find_lower_bound(const _Keyty& _Keyval) const {
      const auto _Scary = _Get_scary();
      _Tree_find_result<_Nodeptr> _Result{{_Scary->_Myhead->_Parent, _Tree_child::_Right}, _Scary->_Myhead};
      _Nodeptr _Trynode = _Result._Location._Parent;
      while (!_Trynode->_Isnil) {
      _Result._Location._Parent = _Trynode;
      if (_DEBUG_LT_PRED(_Getcomp(), _Traits::_Kfn(_Trynode->_Myval), _Keyval)) {
      _Result._Location._Child = _Tree_child::_Right;
      _Trynode = _Trynode->_Right;
      } else {
      _Result._Location._Child = _Tree_child::_Left;
      _Result._Bound = _Trynode;
      _Trynode = _Trynode->_Left;
      }
      }

      F Offline
      F Offline
      ForNow
      wrote on last edited by
      #2

      I had a buffer that was way too small it overlayed data inluding the pointer to the map class thanks

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups