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

Assertion `use_empty' failed. #28

Closed
GoogleCodeExporter opened this issue Apr 11, 2015 · 2 comments
Closed

Assertion `use_empty' failed. #28

GoogleCodeExporter opened this issue Apr 11, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Using sparsehash 1.4 on Ubuntu 8.10 64-bit:

yang@yang-xps410 ~/sandbox/cc
$ uname -a
Linux yang-xps410 2.6.27-11-generic #1 SMP Thu Jan 29 19:28:32 UTC 2009
x86_64 GNU/Linux

yang@yang-xps410 ~/sandbox/cc
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 8.10
Release:        8.10
Codename:       intrepid

yang@yang-xps410 ~/sandbox/cc
$ cat google_sparsehash.cc
#include <google/dense_hash_map>
using namespace google;
int main() {
  dense_hash_map<int,int> m;
  m[1] = 2; // failure happens only when this line is present.
  return 0;
}

yang@yang-xps410 ~/sandbox/cc
$ g++ -Wall -g3 -o google_sparsehash google_sparsehash.cc -Wextra
-Wconversion -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
-Winit-self -Wno-unused-parameter -Wparentheses -Wmissing-format-attribute
-Wfloat-equal -Winline -Woverloaded-virtual -Wsign-promo -Wc++0x-compat -Wsynth

yang@yang-xps410 ~/sandbox/cc
$ ./google_sparsehash
google_sparsehash:
/usr/local/include/google/sparsehash/densehashtable.h:375: bool
google::dense_hashtable<Value, Key, HashFcn, ExtractKey, EqualKey,
Alloc>::test_empty(size_t) const [with Value = std::pair<const int, int>,
Key = int, HashFcn = __gnu_cxx::hash<int>, ExtractKey =
google::dense_hash_map<int, int, __gnu_cxx::hash<int>, std::equal_to<int>,
std::allocator<int> >::SelectKey, EqualKey = std::equal_to<int>, Alloc =
std::allocator<int>]: Assertion `use_empty' failed.
Aborted

Original issue reported on code.google.com by yanghate...@gmail.com on 14 Feb 2009 at 8:54

@GoogleCodeExporter
Copy link
Author

I was also able to repro this on a 32-bit Ubuntu 8.10.

Anyway, just wondering if I'm incorrectly using the map or if this is a bug.

Original comment by yanghate...@gmail.com on 14 Feb 2009 at 8:55

@GoogleCodeExporter
Copy link
Author

You need to call set_empty_key() near the beginning of your program.  See
doc/dense_hash_map.html and also the all-caps comments at the top of
dense_hash_map:

http://code.google.com/p/google-sparsehash/source/browse/trunk/src/google/dense_
hash_map


Original comment by csilv...@gmail.com on 17 Feb 2009 at 1:30

  • Changed state: Invalid

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

No branches or pull requests

1 participant