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

Malloc assertion failure when 65k DiscoDB objects go out of scope #1

Open
mittonk opened this issue Aug 2, 2012 · 2 comments
Open

Comments

@mittonk
Copy link

mittonk commented Aug 2, 2012

Using Python 2.6 and discodb 0.2 or 0.1:

import discodb

data = {'foo': 'bar'}
arr = []
for x in xrange(65537):
    print x
    data_disco = discodb.DiscoDB(data)
    arr.append(data_disco)
print "Got to the end safely."
1
...
65535
65536
Got to the end safely.
python: malloc.c:3551: munmap_chunk: Assertion `ret == 0' failed.
Aborted

Smaller collections of DiscoDB objects work as expected.

@tuulos
Copy link
Member

tuulos commented Mar 23, 2013

Thanks @mittonk for reporting the error - and sorry that it took this long for me to reply!

I can reproduce the error. It is most likely caused by the process exceeding the maximum number of mmaps, as defined in /proc/sys/vm/max_map_count, which at least on my machine is 65530.

Unfortunately the problem seems to be in realloc() which doesn't return NULL although it should in this situtation, see:

http://sourceware.org/bugzilla/show_bug.cgi?id=13276

Hence the bug doesn't seem to be in DiscoDB per se. The case is pretty extreme, so I guess there's not much we can do about it right now.

@mittonk
Copy link
Author

mittonk commented Mar 25, 2013

Nice investigation, @tuulos . glibc does seem like the right level to approach this, I'm fine with no changes to discodb.

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