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

Fixed "NoneType has no attribute 'item'" error #14

Merged
merged 1 commit into from
Mar 29, 2020
Merged

Fixed "NoneType has no attribute 'item'" error #14

merged 1 commit into from
Mar 29, 2020

Conversation

M4tsuri
Copy link
Contributor

@M4tsuri M4tsuri commented Mar 14, 2020

Fixed the error "NoneType has no attribute 'item'"
Screen Shot 2020-03-13 at 23 10 59

Fixed the message "NoneType has no attribute 'item'"
@M4tsuri M4tsuri changed the title Update ptmalloc.py Fixed "NoneType has no attribute 'item'" error Mar 14, 2020
@M4tsuri
Copy link
Contributor Author

M4tsuri commented Mar 14, 2020

I was trying to analyse this simple program:
Screen Shot 2020-03-14 at 10 51 48
And then two problems occurred

  1. If I launch the plugin before the first malloc function call, It will give me a "'NoneType' has no attribute 'item'" error when the first malloc() is called.
  2. It will give me a "'NoneType' has no attribute 'count'" error when the first free() is called and stop updating heap info.

So I searched for the code and I found the 'get_tcache_address' function in ptmalloc.py is the cause. I edited it like this and reload the plugin, then all errors disappeared.
(I changed the return statement so that it won't return a None value)

Screen Shot 2020-03-14 at 10 57 19

And I got this in the console:

656 compare to 592
self.tcache_perthread_s: 576
self.malloc_alignment: 16

My change just makes it look better, however I'm not sure what this if statement has done

if chunk.norm_size == (sizeof(self.tcache_perthread_s) + self.malloc_alignment):

@danigargu danigargu merged commit 5d8c13f into danigargu:master Mar 29, 2020
@danigargu
Copy link
Owner

danigargu commented Mar 29, 2020

Thanks! this commit seems to solve the issue ;)

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

Successfully merging this pull request may close these issues.

2 participants