Skip to content

Segmentation fault with mlab.savefig multiple times using off_screen_rendering and resizing image #302

@kitchoi

Description

@kitchoi

I have tested VTK 5.8.0, 5.10.1, 6.2.0, 6.3.0 and only got seg faults for VTK 6.3.0

from __future__ import print_function
from mayavi import mlab


def mlab_save_figs(off_screen_rendering, **kwargs):
    for ifig in xrange(5):
        figure = mlab.figure()
        figure.scene.off_screen_rendering = off_screen_rendering

        mlab.test_contour3d()
        mlab.savefig("test{}.png".format(ifig), **kwargs)

        print("figure {} created".format(ifig))
        mlab.close()


## This is fine but the saved image dimension is different from the figure (window) size
# mlab_save_figs(True)

## This seg fault while making the second/third/... figure
# mlab_save_figs(True,  size=(100, 200))

## This won't segfault but 3/4 of the image is black
## as figure size < image size
# mlab_save_figs(False, size=(800, 700), magnification=1.0)

## This won't segfault and the image seems fine but the size is not exactly (800, 700)
# mlab_save_figs(False, size=(800, 700))

OS: Ubuntu 12.02 LTS 64bit
Branch: master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions