monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] exit code of '1' in 0.37 win32 version when using s


From: Matthew Gregan
Subject: Re: [Monotone-devel] exit code of '1' in 0.37 win32 version when using ssh-agent signature
Date: Sun, 2 Dec 2007 12:54:50 +1300
User-agent: Mutt/1.5.17 (2007-11-01)

At 2007-12-02T02:44:04+1300, Matthew Gregan wrote:
> I'm seeing this too, except the exit code is 5 in my case.  What's
> happening is that we're crashing while in the dtor code of
> std::vector<Botan::RSA_PublicKey> when destroying ssh_agent as the program
> returns from cpp_main.

The problem turned out to be pretty simple but kinda ugly.  platform.hh
includes $platform/ssh_agent_platform.hh, where $platform is unix or win32.
The test to switch includes was using a non-existent define (WIN32_PLATFORM,
which is an Automake conditional, not a define) and we ended up including
unix/ssh_agent_platform.hh on every platform.  We still ended up executing
the code in win32/ssh_agent_platform.cc because we compile and link the
contents of win32/ on Windows and unix/ everywhere else.

The ssh_agent class inherits from ssh_agent_platform, which will change size
and layout depending on the declaration included via
$platform/ssh_agent_platform.hh.

The result of this is that code including ssh_agent.hh and the code in
win32/ssh_agent_platform.cc disagreed about the size of the
ssh_agent_platform class and the code in win32/ssh_agent_platform.cc ended
up clobbering bits of memory that the rest of the code thought belonged to
the ssh_agent subclass.

Fixed in 8d79f29eef6f1d9fef3eeaa30166fb63d684fbbf.

Cheers,
-mjg
-- 
Matthew Gregan                     |/
                                  /|                    address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]