[prev in list] [next in list] [prev in thread] [next in thread] 

List:       applixware-redhat
Subject:    Re: Calling shared libraries from applix on Linux
From:       Peter Jaeckel <mo11 () nikko ! co ! uk>
Date:       1998-06-18 10:17:49
[Download RAW message or body]


Dear Marco,

Unfortunately, I don't have access to Applix 4.2. However, I did upgrade
all of the C and dl and ld.so etc packages to RedHat 5.1. No change.
Also, the linker switches -assert pure-text made no difference (the
-shared switch is mandatory to build a shared object and so I used it
anyway). Thank you for your feedback nevertheless.

Anyone any other ideas ?

Regards,

 Peter Jaeckel

On Wed, 17 Jun 1998, Marco Bizzarri wrote:
>
> Peter Jaeckel wrote:
> 
> > Dear Sirs,
> >
> > I had a good look around the mailing list archives on the following
> > problems and couldn't find anything. So, if this topic has already been
> > covered, please accept my apologies and just point me in the right
> > direction.
> >
> > For information: We are running applix 4.3.7 on a box-standard RedHat
> > 5.0 for intel (i686) under kernel 2.0.33.
> >
> > We are using external shared libraries with Applix under Solaris and
> > that works fine. I recently attempted to do the same embedding under
> > Linux and failed miserably. The same plain code, no matter how simple,
> > with the same function AxGetCallInfo for applix to register all
> > externally available functions, doesn't work under Linux. In fact, I had
> > quite a serious hack at it and discovered the following:
> >
> > 1.) When applix tries to dlopen the shared library, the entire applix
> >     session segfaults.
> >
> > 2.) This happens before it ever gets to call AxGetCallInfo or any other
> >     function in the shared library.
> >
> > 3.) Applix (probably implicitly through calls to getopt or getenv or even dlopen)
> >     appears to check for a variety of environment variables to be
> >     present in order to set its state for opening the shared library.
> >     After checking for a variable called "PRINT_STATS", it asks for a
> >     new one. You are probably familiar with the fact that for a call to
> >     getenv you provide a char * which points to a string that is the
> >     name of the variable that you are looking for. getenv checks each
> >     environment variable against that string by a call to strncmp().
> >     Thus it passes the original pointer on to strncmp. After the call to
> >     getenv with a pointer pointing to "PRINT_STATS", a call to strncmp
> >     occurs that contains a pointer which is completely invalid and thus
> >     when strncmp tries to read the string the segfault happens.
> >
> > 4.) When I write a simple standalone executable that calls dlopen etc on
> >     the shared library that I built previously, I can call my functions
> >     in that shared library just fine. It works. It does require,
> >     however, that the main executable was compiled/linked with the
> >     -rdynamic switch, otherwise the executable crashes with a segfault,
> >     too, albeit in a different place.
> >
> > Has anyone ever heard of this problem ?
> >
> > Has anyone ever got shared libraries to work under Applix for Linux ?
> >
> > Is there a chance to have applix compiled with the -rdynamic switch ?
> >
> > When will there be applix 4.4 for Linux ?
> >
> > I'd be more than grateful for any advice or news on this subject.
> >
> > Sincerely,
> >
> > Dr. Peter Jaeckel
> >                               Risk Management Department
> >                               Nikko Securities Global Holdings Ltd.
> >                               +44 171 2330668
> >                               p.jaeckel@nikko.co.uk
> >
> > --
> > To unsubscribe:
> > mail -s unsubscribe applixware-list-request@redhat.com < /dev/null
> 
>   Dear Peter,
> (sorry, but I'm used to be quite informal), I've been successful at building shared
> libraries for RH5.1 and AW4.2 (not AW4.3.7), with the following linking options:
> 
> -shared -assert pure-text
> 
> The options should be passed to the linker. If you think it could be useful, I can
> send you a makefile I used for an application.
> 
> Hope this could help.
> 
> Bye
> Marco
> 
> 

-- 
To unsubscribe:
mail -s unsubscribe applixware-list-request@redhat.com < /dev/null

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic