Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
trolldbois committed Oct 22, 2015
1 parent 85b9442 commit e972550
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions haystack/mappings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ def __init__(self, mapping_list, _target, name):
self.__name = name
# book register to keep references to ctypes memory buffers
self.__book = _book()
self.__model = model.Model(self)
self.__user_model = model.Model(self)
self.__internal_model = model.Model(self)
# FIXME reduce open files.
self.__required_maps = []
# finish initialization
Expand Down Expand Up @@ -259,7 +260,7 @@ def get_ctypes_utils(self):

def get_model(self):
"""Returns the Model cache."""
return self.__model
return self.__user_model

# FIXME incorrect API
def _get_mapping(self, pathname):
Expand Down
3 changes: 2 additions & 1 deletion test/haystack/structures/libc/test_libcheapwalker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ def test_get_heap_walker(self):
def test_get_user_allocations(self):
# we should have 3 structures + 1 empty chunks
allocs = self.walker.get_user_allocations()
self.assertEquals(len(allocs), 35 + 255)
self.assertEquals(len(allocs), 35 + 255 + 16 + 16 + 16 + 3 )

def test_get_free_chunks(self):
# the empty chunk
free = self.walker.get_free_chunks()
self.assertEquals(len(free), 1)


class TestLibcHeapWalkerBigger(unittest.TestCase):
""" Test the libc heap walker on a bigger test case,
a ssh process dump.
Expand Down

0 comments on commit e972550

Please sign in to comment.