Subject: | Perl scripts exit with Segmentation Fault |
When a perl script includes Clutter the Perl script will always exit
with a Segmentation Fault. This happens no matter how the program quits
even when exit 0 is called.
The following command results with a Segmentation Fault:
perl -MClutter -e '1'
I tried to use gdb to get a stack trace and it seems to be a problem
when the perl interpreter calls exit(). It was suggested in IRC that the
loading/unloading of the nvidia drivers could be the problem.
I've tried to play with dl_load_flags just as the Python bindings do it
but without success:
our @ISA = qw( DynaLoader Exporter );
# Constants stolen from /usr/include/bits/dlfcn.h on Linux
use constant RTLD_LAZY => 0x00001; # Lazy function call binding.
use constant RTLD_GLOBAL => 0x00100; # Make the symbols visible as if
the object
# were linked directly into the
program.
sub dl_load_flags { $^O eq 'darwin' ? 0x00 : RTLD_LAZY | RTLD_GLOBAL }
For the moment I had to add a very ugly patch that registers a SIGSEV
handler that calls exit. This way the perl interpreter doesn't exit with
a Segmentation Fault.
If there's no solution for this bug I could reformat the patch so that
the signal handler gets registered only if a particular environment
variable is set (ex: CLUTTER_NO_SIGSEV=1).