Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deferred_heap.h:511 "attempt to dereference null" #25

Open
hia3 opened this issue Jan 28, 2018 · 1 comment
Open

deferred_heap.h:511 "attempt to dereference null" #25

hia3 opened this issue Jan 28, 2018 · 1 comment

Comments

@hia3
Copy link

hia3 commented Jan 28, 2018

When compiling the code with STL's STL (that comes with VS2017)

#include "deferred_allocator.h"
using namespace gcpp;

int main()
{
    deferred_heap h;
    using my_map = deferred_unordered_map<int, int>;
    deferred_ptr<my_map> scopes(h.make<my_map>(h));
}

it fails at deferred_heap.h:511

image

@mgood7123
Copy link

mgood7123 commented Apr 29, 2023

This also happens in test_basic

deferred_heap heap;
auto v = deferred_vector<widget>(heap);
test_basic`gcpp::deferred_allocator<widget>::deferred_allocator(this=0x0000007fffffedd0, h_=0x0000007fffffee20) at deferred_allocator.h:66:9

deferred_allocator(deferred_heap& h_) noexcept
: h{ h_ }
(lldb) expr -R -- v
(gcpp::deferred_vector<widget>) $10 = {
  std::__ndk1::__vector_base<widget, gcpp::deferred_allocator<widget> > = {
    __begin_ = {
      gcpp::deferred_heap::deferred_ptr_void = {
        myheap = nullptr
        p = 0x0000000000000000
      }
    }
    __end_ = {
      gcpp::deferred_heap::deferred_ptr_void = {
        myheap = nullptr
        p = 0x0000000000000000
      }
    }
    __end_cap_ = {
      std::__ndk1::__compressed_pair_elem<gcpp::deferred_ptr<widget>, 0, false> = {
        __value_ = {
          gcpp::deferred_heap::deferred_ptr_void = {
            myheap = nullptr
            p = 0x0000000000000000
          }
        }
      }
      std::__ndk1::__compressed_pair_elem<gcpp::deferred_allocator<widget>, 1, false> = {
        __value_ = {
          h = 0x0000007fffffee20
        }
      }
    }
  }
}
test_basic`gcpp::deferred_ptr<widget>::operator->(this=0x0000007fffffedd8) const at deferred_heap.h:511:4

Expects(get() && "attempt to dereference null");
test_basic`test_deferred_allocator_vector() at test.cpp:285:6

v.push_back(i); // i = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants