Problems building enable/kiva/agg

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems building enable/kiva/agg

Lee Taylor
I'm have a problem with a version of enaml built from the current git
version.  I'm using gcc 4.7.1 on Red Hat Enterprise Linux Workstation
release 6.3.  Everything builds fine but one of the test problems is
not working.

enaml/examples/widgets/enable_canvas.enaml will open a window and plot
an axis but fails to display an image.  Occasionally it crashes with a
segmentation fault.  When it does it is in agg.

agg_wrap.cpp: _wrap_GraphicsContextArray_draw_image
   result = (int)(arg1)->draw_image(arg2,arg3,arg4)

   ...a few layers of templates

   const int8u* pix_ptr(int x, int y) const {
     return m_rbuf->row_ptr(y) + x * pix_width;
   }

valgrind reports an error in this area (It also reports lots of other
errors)

==22723== Conditional jump or move depends on uninitialised value(s)
==22723==    at 0x18901C1E: (agg_image_accessors.h:68)
==22723==    by 0x18901FA0: (agg_renderer_scanline.h:189)
==22723==    by 0x1890208A: (kiva_graphics_context.h:702)
==22723==    by 0x18902529: (kiva_graphics_context.h:610)
==22723==    by 0x1890382C:
kiva::graphics_context<...>::transform_image(...)
(kiva_graphics_context.h:1613)
==22723==    by 0x189039EB: kiva::graphics_context<...>::draw_image(...)
(kiva_graphics_context.h:1448)
==22723==    by 0x18893A17: _wrap_GraphicsContextArray_draw_image
(agg_wrap.cpp:11135)

It works when compiled with gcc 4.1.2.  It works if I
replace the _agg.so in my build with the one from EPD 7.3.

I'm assuming it's something in the way I'm building enable/kiva/agg.
All I'm using is 'python setup.py install'.  Any suggestions?

Lee Taylor
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Problems building enable/kiva/agg

Robert Kern
On Mon, Feb 25, 2013 at 6:32 PM, Lee Taylor <[hidden email]> wrote:

> I'm have a problem with a version of enaml built from the current git
> version.  I'm using gcc 4.7.1 on Red Hat Enterprise Linux Workstation
> release 6.3.  Everything builds fine but one of the test problems is
> not working.
>
> enaml/examples/widgets/enable_canvas.enaml will open a window and plot
> an axis but fails to display an image.  Occasionally it crashes with a
> segmentation fault.  When it does it is in agg.
>
> agg_wrap.cpp: _wrap_GraphicsContextArray_draw_image
>    result = (int)(arg1)->draw_image(arg2,arg3,arg4)
>
>    ...a few layers of templates
>
>    const int8u* pix_ptr(int x, int y) const {
>      return m_rbuf->row_ptr(y) + x * pix_width;
>    }
>
> valgrind reports an error in this area (It also reports lots of other
> errors)
>
> ==22723== Conditional jump or move depends on uninitialised value(s)
> ==22723==    at 0x18901C1E: (agg_image_accessors.h:68)
> ==22723==    by 0x18901FA0: (agg_renderer_scanline.h:189)
> ==22723==    by 0x1890208A: (kiva_graphics_context.h:702)
> ==22723==    by 0x18902529: (kiva_graphics_context.h:610)
> ==22723==    by 0x1890382C:
> kiva::graphics_context<...>::transform_image(...)
> (kiva_graphics_context.h:1613)
> ==22723==    by 0x189039EB: kiva::graphics_context<...>::draw_image(...)
> (kiva_graphics_context.h:1448)
> ==22723==    by 0x18893A17: _wrap_GraphicsContextArray_draw_image
> (agg_wrap.cpp:11135)
>
> It works when compiled with gcc 4.1.2.  It works if I
> replace the _agg.so in my build with the one from EPD 7.3.
>
> I'm assuming it's something in the way I'm building enable/kiva/agg.
> All I'm using is 'python setup.py install'.  Any suggestions?

Agg uses a lot of C++ template features, and it's getting pretty dated
at this point. It's entirely possible that the C++ dialect that gcc
4.7 implements is slightly different from the dialect that gcc 4.1
implements, particularly in areas that may have been undefined by the
C++ standard at the time. Does gcc 4.7 implement C++11 by default? In
the short term, you may want to look for a gcc 4.7 command line flag
that you can set to get the older semantics. In the longer term, we
will need to fix Agg to compile correctly with more recent compilers.
It's going to be tricky given the amount of template nonsense that
goes on in Agg. Since valgrind seems to warn about uninitialized
values, it may be that Agg is relying on constructors to get run at
certain times that may be implementation-dependent.

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Problems building enable/kiva/agg

Lee Taylor
On 02/25/2013 11:08 AM, Robert Kern wrote:
> On Mon, Feb 25, 2013 at 6:32 PM, Lee Taylor <[hidden email]> wrote:
>> I'm have a problem with a version of enaml built from the current git
>> version.  I'm using gcc 4.7.1 on Red Hat Enterprise Linux Workstation
>> release 6.3.  Everything builds fine but one of the test problems is
>> not working.
>>

I was able to build with gcc 4.6.3.  I tried a snap shot of 4.8
(gcc-4.8-20130224) and it acts like gcc 4.7.1
>
> Agg uses a lot of C++ template features, and it's getting pretty dated
> at this point.

Are there any plans to update/replace the agg backend?  The agg library
seems to be used in a large number of projects, but there is not an
official, current distribution.  For example, the version of agg in
matplotlib is different than the version in kiva.

I found this mail from Eric Jones in 2006
https://mail.enthought.com/pipermail/enthought-dev/2006-April/001613.html: 
"At some point in the future I
can see making a Cairo backend to kiva and dropping the antigrain
backend if the speeds are comparable.  This should be straight forward."

> Does gcc 4.7 implement C++11 by default?

 From what I can tell, -ansi is equivalent to -std=c++98

> In
> the short term, you may want to look for a gcc 4.7 command line flag
> that you can set to get the older semantics.

I couldn't find any flags that may apply.  I'm more of a C/Fortran guy
and didn't want to dive too much into the C++ template world.

I think for now I'll use gcc 4.6.3.

Lee Taylor

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev