spacetelescope/braindump

Diagnosing memory issues in Python extensions

drdavella opened this issue · 5 comments

In case it is of interest, I have prepared short demos on the following topics:

  • detecting memory leaks in Python extensions using valgrind
  • detecting buffer overruns in Python extensions using address sanitizer

Let me know if there are other topics that would be of interest. These might include using gdb to debug Python extensions, detecting undefined C behavior in extensions, etc.

pllim commented

So this is specific to only C-extensions? Can we apply the same tools to Cython?

I'm not really familiar with Cython to be honest. Does it have the same issues as C in terms of memory management?

pllim commented

Hmm maybe @eteq can comment. I never have to venture into Cython-land yet, for better or worse.

pllim commented

That was a great talk! Any chance memleak, segfault, and all the magical incantations would be added to this repo or somewhere?

Right now I have it in https://github.com/drdavella/debugging, but it's not well documented. I'll work on improving it when I find a bit of time.