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 24 1998 1:33PM
This is great work Ted!
If it's something this simple, would is be worth pestering Sybase to do a
recompile of the libraries for glibc?
Would they even do it?
> -----Original Message-----
> From: Ted Law [SMTP:email@example.com]
> Sent: Sunday, August 23, 1998 4:38 AM
> To: SybPerl Discussion List
> Cc: firstname.lastname@example.org; email@example.com
> Subject: Linking ctlib-linux-elf-dynamic on RedHat 5.1
> After hours of machine level debugging, I finally figured out what's
> going on. The symtom was that DBD::Sybase and Sybperl will work when
> running from bash but not from zsh, whether it was linked dynamically or
> statically. It turned out to be just a smoke screen. The real problem
> 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, 136,
> respectively in glibc. But ctlib-linux-elf-dynamic assumed 4, 8, 12.
> So when sigaction is called with a non-null value for old_act, glibc
> actually overwrites part of the stack. Then, when the overwritten part
> 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 address
> happens to fall into the unprotected gap between two shared libraries.
> 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 do
> that. Would some one please take this on?
> Ted Law