Up Prev Next
From: "Stepan, Jamison" <Jamison dot Stepan at state dot mn dot us>
Subject: RE: Linking ctlib-linux-elf-dynamic on RedHat 5.1
Date: Aug 25 1998 3:22PM
Well, this is beyond me. Anyone out there able to tackle it?
> -----Original Message-----
> From: Michael Peppler [SMTP:email@example.com]
> Sent: Monday, August 24, 1998 6:04 PM
> To: SybPerl Discussion List
> Subject: RE: Linking ctlib-linux-elf-dynamic on RedHat 5.1
> I think you'd have to write a glue function called sigaction(), or
> maybe patch the libraries to call something else than sigaction() (eg
> sybaction()) and then write sybaction to actually call sigaction with
> the correct struct offsets.
> Not impossible, but a little kludgy... (of course, those of you who
> used perl4/sybperl 1.x will know of the savestr() collision between
> perl and Sybase DBlibrary, and how that was fixed...).
> Stepan, Jamison writes:
> > Would disassembling the libraries to machine code and re-assembling
> under a
> > glibc system do the trick?
> > Jamison
> > > -----Original Message-----
> > > From: Michael Peppler [SMTP:firstname.lastname@example.org]
> > > Sent: Monday, August 24, 1998 9:09 AM
> > > To: SybPerl Discussion List
> > > Cc: email@example.com; firstname.lastname@example.org
> > > Subject: Linking ctlib-linux-elf-dynamic on RedHat 5.1
> > >
> > > Ted Law writes:
> > > > After hours of machine level debugging, I finally figured out
> > > > going on. The symtom was that DBD::Sybase and Sybperl will work
> > > > running from bash but not from zsh, whether it was linked
> > > or
> > > > statically. It turned out to be just a smoke screen. The real
> > > > is that ctlib-linux-elf-dynamic was compiled with a definition of
> > > struct
> > > > sigaction that is different from the one compiled into glibc 6
> used in
> > > > RedHat 5.1.
> > > >
> > > > The offsets for sa_mask, sa_flags, and sa_restorer were 4, 132,
> > > > respectively in glibc. But ctlib-linux-elf-dynamic assumed 4, 8,
> > > > So when sigaction is called with a non-null value for old_act,
> > > > actually overwrites part of the stack. Then, when the overwritten
> > > > is used as an address to write to, a SEG fault occurs. The
> reason why
> > > > it would work when running from bash was that the incorrect
> > > > happens to fall into the unprotected gap between two shared
> > > >
> > > > A workaround would be to write a wrapper for all struct sigaction
> > > > related routines to bridge the two sides. But I don't know how to
> > > > that. Would some one please take this on?
> > >
> > > Wow!
> > >
> > > Thanks for spending the time to find the problems!
> > >
> > > Now to find a way to actually solve the problems....
> > >
> > > Michael
> > > --
> > > Michael Peppler -||- Data Migrations Inc.
> > > email@example.com -||- http://www.mbay.net/~mpeppler
> > > Int. Sybase User Group -||- http://www.isug.com
> Michael Peppler -||- Data Migrations Inc.
> firstname.lastname@example.org -||- http://www.mbay.net/~mpeppler
> Int. Sybase User Group -||- http://www.isug.com