Subject: Re: keyboard-interactive method gives access violation in MSVC 2008

Re: keyboard-interactive method gives access violation in MSVC 2008

From: Alexander Lamaison <>
Date: Wed, 8 Sep 2010 00:03:01 +0100

On 7 September 2010 22:02, Jose Baars <> wrote:
>  Op 9/7/2010 4:13 PM, Ezequiel Ruiz schreef:
>>>> Indeed. I've tested the code with Mingw (GCC 4.4) and it works OK.
>>> This will be because Mingw doesn't give you the option of linking to
>>> different runtime versions (such as Debug variants), not because MSVC
>>> is 'broken' and Mingw is not.  Your code will still be violating the
>>> rules and works by luck.
>>> Alex
> Can someone provide a url where these rules are roughly explained?
> Jose

Hmmm. The first rule, "always deallocate memory with the same
allocator that allocated it" is as old a houses and probably isn't
written anywhere formal. For instance, you would never dream of using
`malloc` to allocate and `delete` to deallocate .However it follows
from the basic rule that if you want to access some data stored in one
location in memory, accessing a completely different location in
memory isn't going to get you the data you were after! The data in
this case being the allocator's table of allocated regions.

The second 'rule' is in fact the absence of a rule: the rule that
different implementations of the C runtime must store their data in a
common location and manipulate it in a common way. There is no such
rule in the C specification and therefore you can't rely on in. In
fact, as has been shown here often, real implementations _don't_ share
their data and any cross-module manipulation leads to memory

See also:


Swish - Easy SFTP for Windows Explorer (
Received on 2010-09-08