Page 1 of 1

Dependency on selinux?

Posted: 2010-06-03T11:18:20-07:00
by jamesanderson
I have an application that relies on a few of the imagemagick libraries, libMagickCore.so, libMagick++.so and libMagickWand.so to be exact. Anyway, they seem to have a dependency on libSELinux and I'm wondering if I can recompile without this dependency? Does anyone know if that's possible? Has anyone else run into this issue?

The reason I ask is that upon closing my app (shutting down) I get a segmentation fault. From what I've found, this is the fault of the selinux library, but because the imagemagick libs depend on this I was wondering if I could simply somehow remove the dependency.

Thanks,
James

Re: Dependency on selinux?

Posted: 2010-06-03T11:33:01-07:00
by magick
ImageMagick has no dependency on libSELinux. If you compile ImageMagick from source, it may resolve the problem.

Re: Dependency on selinux?

Posted: 2010-06-03T11:45:20-07:00
by jamesanderson
Hmmm... I did compile from source originally.

I find that when I check dependencies on libMagickCore.so it's definitely appearing in the list.

if I do an ldd libMagickCore.so, in the list I see libselinux.so.1 => ...

I'm guessing then, that if I compile on a box without libselinux it won't have that "dependency?"

Re: Dependency on selinux?

Posted: 2010-06-03T12:01:20-07:00
by magick
We have SELinux on our Fedora box and there is no dependency on libSELinux. Its possible that ImageMagick is linking to a library on your system that has a dependency on SELinux.

Re: Dependency on selinux?

Posted: 2010-06-03T13:11:12-07:00
by jamesanderson
I'll give another recompile a try. Thanks!

Re: Dependency on selinux?

Posted: 2010-06-10T12:33:44-07:00
by tfoertsch
I see the same problem here with perlmagick.

Code: Select all

$ perl -MImage::Magick -le 'print Image::Magick->VERSION; warn test'
6.5.9
test at -e line 1.
Segmentation fault
It does not depend upon the IM version. 6.6.2-4 behaves the same.

May it be the Perl version?

Code: Select all

$ perl -V                                                      
Summary of my perl5 (revision 5 version 12 subversion 1) configuration:                                       
                                                                                                              
  Platform:                                                                                                   
    osname=linux, osvers=2.6.30.2-domu-v4, archname=i686-linux                                                
    uname='linux kabatinte 2.6.30.2-domu-v4 #4 smp fri jul 31 15:57:07 cest 2009 i686 gnulinux '              
    config_args='-ds -e -Dprefix=/opt/perl -Di_db -Di_dbm -Di_ndbm -Di_gdbm - -Duseshrplib=true -Doptimize=-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe -Accflags=-DPERL_USE_SAFE_PUTENV -Dnoextensions=ODBM_File -Uuseithreads -Uusemultiplicity -UDEBUGGING'                                                                                                        
    hint=recommended, useposix=true, d_sigaction=define                                                       
    useithreads=undef, usemultiplicity=undef                                                                  
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef                                      
    use64bitint=undef, use64bitall=undef, uselongdouble=undef                                                 
    usemymalloc=n, bincompat5005=undef                                                                        
  Compiler:                                                                                                   
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',                                                                                       
    optimize='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wall -pipe -Accflags=-DPERL_USE_SAFE_PUTENV',                                                
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'                              
    ccversion='', gccversion='4.3.2', gccosandvers=''                                                         
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234                                            
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12                                       
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.7.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.7'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/opt/perl/lib/5.12.1/i686-linux/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wall -pipe -Accflags=-DPERL_USE_SAFE_PUTENV -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
                        USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
  Built under linux
  Compiled at Jun  9 2010 16:45:11
  @INC:
    /opt/perl/lib/site_perl/5.12.1/i686-linux
    /opt/perl/lib/site_perl/5.12.1
    /opt/perl/lib/5.12.1/i686-linux
    /opt/perl/lib/5.12.1
    .
Magick.xs contains an UNLOAD() function. So I have put a warning after the last line if the function and it is printed just before the segfault.

Re: Dependency on selinux?

Posted: 2010-06-11T06:20:02-07:00
by tfoertsch
Solved it.

Its not perl and not IM. The culprit is the libselinux version shipped with debian 5.0.4. After an upgrade to "testing", that means:

Code: Select all

Preparing to replace libselinux1 2.0.65-5 (using .../libselinux1_2.0.94-1_i386.deb) ...


all works as expected.

For the record, I think at least libselinux 2.0.82 is needed. See http://marc.info/?l=selinux&m=124577715731497&w=2