Andreas Hasenack | 1 Oct 17:02

stackguard?

Is there somebody else besides us and the authors using stackguard?

Seth Arnold | 1 Oct 23:01

Re: stackguard?

On Tue, Oct 01, 2002 at 12:05:46PM -0300, Andreas Hasenack wrote:
> Is there somebody else besides us and the authors using stackguard?

StackGuard the implementation, not that I know of. StackGuard the idea,
Microsoft has incorporated canary checking into their VC++ compiler.
(/gs switch.)

Are you having a problem with stackguard?

--

-- 
Too bad life doesn't have a :q! command.
Andreas Hasenack | 1 Oct 23:10

Re: stackguard?

Em Tue, Oct 01, 2002 at 02:01:35PM -0700, Seth Arnold escreveu:
> Are you having a problem with stackguard?

Yes, I was compiling imap with it and got this error
when I loaded php4-imap into apache-2:

PHP Warning:  Unable to load dynamic library '/usr/lib/php4/imap.so' - /usr/lib/php4/imap.so:
undefined symbol
: __canary_death_handler in Unknown on line 0

I'm not compiling php nor apache with stackguard.
Never had this error with php/apache/imap before, but I recently completely
redid our php package, perhaps this error was somehow "clouded" before.

Alexander Bokovoy | 2 Oct 09:20

Re: stackguard?

On Tue, Oct 01, 2002 at 06:10:58PM -0300, Andreas Hasenack wrote:
> Em Tue, Oct 01, 2002 at 02:01:35PM -0700, Seth Arnold escreveu:
> > Are you having a problem with stackguard?
> 
> Yes, I was compiling imap with it and got this error
> when I loaded php4-imap into apache-2:
> 
> PHP Warning:  Unable to load dynamic library '/usr/lib/php4/imap.so' - /usr/lib/php4/imap.so:
undefined symbol
> : __canary_death_handler in Unknown on line 0
> 
> I'm not compiling php nor apache with stackguard.
> Never had this error with php/apache/imap before, but I recently completely
> redid our php package, perhaps this error was somehow "clouded" before.
Looks like some -Wl,-rpath -Wl,/path/to/libstackguard.so is missing during
imap.so compilation...

--

-- 
/ Alexander Bokovoy
---
Many receive advice, few profit by it.
		-- Publilius Syrus

Andreas Hasenack | 2 Oct 20:11

Re: stackguard?

Em Wed, Oct 02, 2002 at 10:20:03AM +0300, Alexander Bokovoy escreveu:
> > PHP Warning:  Unable to load dynamic library '/usr/lib/php4/imap.so' - /usr/lib/php4/imap.so:
undefined symbol
> > : __canary_death_handler in Unknown on line 0
> > 
> > I'm not compiling php nor apache with stackguard.
> > Never had this error with php/apache/imap before, but I recently completely
> > redid our php package, perhaps this error was somehow "clouded" before.
> Looks like some -Wl,-rpath -Wl,/path/to/libstackguard.so is missing during
> imap.so compilation...

There is no libstackguard. One solution would be to compile php (and apache) with
stackguard too.

Alexander Bokovoy | 2 Oct 21:13

Re: stackguard?

On Wed, Oct 02, 2002 at 03:11:00PM -0300, Andreas Hasenack wrote:
> Em Wed, Oct 02, 2002 at 10:20:03AM +0300, Alexander Bokovoy escreveu:
> > > PHP Warning:  Unable to load dynamic library '/usr/lib/php4/imap.so'
> > > - /usr/lib/php4/imap.so: undefined symbol : __canary_death_handler
> > > in Unknown on line 0
> > > 
> > > I'm not compiling php nor apache with stackguard.
> > > Never had this error with php/apache/imap before, but I recently completely
> > > redid our php package, perhaps this error was somehow "clouded" before.
> > Looks like some -Wl,-rpath -Wl,/path/to/libstackguard.so is missing during
> > imap.so compilation...
> 
> There is no libstackguard. One solution would be to compile php (and apache) with
> stackguard too.
But the symbol itself is provided by something. I can see its definition in
Immunix's glibc/stackguard patch. Do you have glibc compiled with it as
well?

The patch I'm talking about is
http://download.immunix.org/ImmunixOS/7.0/i386/extras/glibc-2.2-StackGuard.patch
(easy to point to but outdated)

There is a new version of it in
http://download.immunix.org/ImmunixOS/7+-beta/SRPMS/glibc-2.2-12_imnx_19.src.rpm

--

-- 
/ Alexander Bokovoy
---
	"Have you lived here all your life?"
	"Oh, twice that long."
(Continue reading)

Steve Beattie | 2 Oct 21:28
X-Face

Re: stackguard?

On Wed, Oct 02, 2002 at 10:13:30PM +0300, Alexander Bokovoy wrote:
> On Wed, Oct 02, 2002 at 03:11:00PM -0300, Andreas Hasenack wrote:
> > Em Wed, Oct 02, 2002 at 10:20:03AM +0300, Alexander Bokovoy escreveu:
> > > > PHP Warning:  Unable to load dynamic library '/usr/lib/php4/imap.so'
> > > > - /usr/lib/php4/imap.so: undefined symbol : __canary_death_handler
> > > > in Unknown on line 0
> > > > 
> > > > I'm not compiling php nor apache with stackguard.
> > > > Never had this error with php/apache/imap before, but I recently completely
> > > > redid our php package, perhaps this error was somehow "clouded" before.
> > > Looks like some -Wl,-rpath -Wl,/path/to/libstackguard.so is missing during
> > > imap.so compilation...
> > 
> > There is no libstackguard. One solution would be to compile php (and apache) with
> > stackguard too.
> But the symbol itself is provided by something. I can see its definition in
> Immunix's glibc/stackguard patch. Do you have glibc compiled with it as
> well?

Alas, the symbol provided in glibc is visible internally to glibc only.
The __canary_death_handler is also provided by the compiler in crtbegin.o
and libgcc.a, but those are not commonly linked in when linking a shared
library. 

Andreas, you'll either need to compile php and apache with stackguard,
or link in a version of canary.o into imap.so.

--

-- 
Steve Beattie                               Don't trust programmers?
<steve@...>                         Complete StackGuard distro at
(Continue reading)

Mark Hatle | 3 Oct 03:14

Re: stackguard?

Ahah!  I should have spoken up earlier..  We see this problem all of the time in 
our stuff.. (generally cross compiled.. or built for a set of libraries 
incompatable with the building system.. anyway..)

Our solution to these issues is to change almost all of the linking in the 
system to use "gcc" instead of "ld".  This makes sure that all of the 
appropriate symbols get linked in..  (primarily due to libgcc.a or crt*.o).. 
There are a few cases where you need to use "ld" still.. (mind you I can't think 
of any off hand.. but I know they exist)  For those you will need to carfully 
craft your ld line to include crt*.o or libgcc.a or both depending on your 
requirements..

But we make a point in our docs and customer conversations you should ALWAYS 
link w/ gcc..  This has significantly reduced support issues for things like 
this.  (This may be even more important w/ gcc 3.x because it does a few things 
differently..)

--Mark

> Alas, the symbol provided in glibc is visible internally to glibc only.
> The __canary_death_handler is also provided by the compiler in crtbegin.o
> and libgcc.a, but those are not commonly linked in when linking a shared
> library. 
> 
> Andreas, you'll either need to compile php and apache with stackguard,
> or link in a version of canary.o into imap.so.
> 


Gmane