[yt-dev] cython debugging?

Matthew Turk matthewturk at gmail.com
Tue Oct 15 18:36:04 PDT 2013


Hi Chris,

On Wed, Oct 16, 2013 at 10:32 AM, Chris Malone <chris.m.malone at gmail.com> wrote:
> Hi all,
>
> I'm trying to extract some data for a surface, but am getting a segfault in
> the `YTSurfaceBase.get_data` method - probably the same thing as this [1] yt
> issue.  I've tracked it down to the `FillTriangleValues` call in
> `march_cubes_grid` with a combination of pdb and gdb.  I can't figure out
> what is wrong, however, because all the variable values are optimized out.
>
> So my question:  anyone know how to re-run setup.py and turn on debugging
> flags for cython code?

Yup!  I have debugged this exact routine before, but thought I got all
of the errors.  Here's what I do:

Comment out all the @cython optimizers over top of the routine in question.
export CFLAGS=-O0
rebuild

GDB then will have the comments and variables, and it will also have
comments pointing at the line in question.  My recollection is that
there was some problem with getting the triangles if you sampled
without getting the samples first, so that may be the issue -- if you
extract, try grabbing the field first before exporting.  Something
like:

surf = ...
surf["Whatever"]
surf.export_obj(...)

I couldn't figure out why this was resulting in bad values, but I can
also try to take a look this week.

-Matt

>
> I've found information about cygdb, which would probably be easier than
> pdb+gdb.  Their documentation says to rebuild with the --pyrex-gdb flag to
> setup.py, but that doesn't seem to be recognized by setuptools.  Other
> webpages say to set the "-g" or "--cython-gdb" flags, but those also do not
> work.
>
> Chris
>
>
> [1]
> https://bitbucket.org/yt_analysis/yt/issue/633/vertices-not-correctly-created-in-surface
>
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>



More information about the yt-dev mailing list