[program-l] Re: Problem with MinGW/GCC 4.7.2 C++0x, strange debug warnings

  • From: Soronel Haetir <soronel.haetir@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Thu, 31 Jan 2013 21:26:22 -0900

This warning means that you wrote past the end of the allocated size
of a block at some point in the past, for instance you allocated 28
bytes (0x1c), but wrote up to 36 bytes. (the difference between the
two addresses given)

This sort of error is usually going to be detected long after the
problem code executes.

On 1/11/13, QuentinC <webmaster@xxxxxxxxxxxx> wrote:
>
> Hello everybody,
>
> This is a question for C++ experts !
>
> When I run my program within gdb, I get strange warnings like this one :
>
> warning: Heap block at 003B3580 modified at 003B35A4 past requested size
> of 1c
>
> The biggest problem is, at that point of the program execution, the
> stack trace is
> * - first in some functions of the win API that I never called,
> something like getPrefferedUILanguage, or TraceDatabaseValidate for example
> * Then msvcrt!free
> * Then, and that's the most strange, functions being in the C++ runtime
> of MinGW/GCC: libstdc++-6.dll. All those functions begin with _ZNS
> * And finally somewhere in my own program, but I don't understand,
> because the corresponding source lines are as simple as s.value = value,
> where value are std::strings and s is a reference to an object.
> That object has some string and int members. If in GDC I type :
> p s.someIntMember
> it prints the expected value for that member, so I conclude that s
> correctly point to a valid object
> When I type
> s.someStringMember
> it prints something that seems to be correct
> but if I type
> s.someStringValue.c_str()
> it crashes, or print something like
> 0x123455 <0x123455 adress out of bounds>
>
> I have the impression that something goes wront with the string
> destructor...
>
> When I run the program normally outside gdb, it works correctly, the
> program doesn't crash and everything is fine; except that avaste seems
> to don't like that executable.
>
> Does someone has an idea ?
>
> Thank you very much.
> ** To leave the list, click on the immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
> ** If this link doesn't work then send a message to:
> ** program-l-request@xxxxxxxxxxxxx
> ** and in the Subject line type
> ** unsubscribe
> ** For other list commands such as vacation mode, click on the
> ** immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
> ** or send a message, to
> ** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
>


-- 
Soronel Haetir
soronel.haetir@xxxxxxxxx
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: