error at 0x%08X

This is a discussion on error at 0x%08X within the C++ Programming forums, part of the General Programming Boards category; I open up my program with a binary editor and a found about a dozen mesages about bad stuff happening ...

  1. #1
    Bobish
    Guest

    Post error at 0x%08X

    I open up my program with a binary editor and a found about a dozen mesages about bad stuff happening at 0x%08X in the program now my question is where is 0x%08X in the memory stack and how would i find it useing VC++6.0.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,848
    > where is 0x%08X in the memory stack
    It isn't anywhere, this is just a printf formatting string

    At run time, if there is an error, the code will format whatever value is appropriate as 8 hex digits, with a leading 0x.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Bobish
    Guest
    So if there is an error there what would that mean and why would that be described as a location. My program is windows based useing direct draw and i haven't used printf in my program but stdio is included. I am useing of streams though here is the entire mesage:

    with debug mode on:

    Pixel DrawerWINXCLASSProgram execution begunddsd.lPitch = %ufirst surface creation failed%ldsizeof(lpddsprimary) = 0xflipfailed%p@ľBp.@.ÉľBP#@.ÓľBp(@ofstream.cpp.Ą..
    Ç@HŚBp.@P4@É6@└3@..E@ÉB@ C@`0@­1@đE@đD@p..ÉŚBp8@_ios.cppfilebuf1.cpp└ŚB­@@` D@0B@ÉE@..E@ÉB@ C@0j@0j@đE@đD@streamb.cppi386\chkesp.cThe value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.     .I@:I@_file.c.śBPM@dbgdel.cpp_BLOCK_TYPE_IS_VA LID(pHead->nBlockUse)ioinit.cAssertion FailedErrorWarning%s(%d) : %s

    Assertion failed!Assertion failed: _CrtDbgReport: String too long or IO ErrorSecond Chance Assertion Failed: File %s, Line %d
    wsprintfAuser32.dllMicrosoft Visual C++ Debug LibraryDebug %s!

    Program: %s%s%s%s%s%s%s%s%s%s%s

    (Press Retry to debug the application)
    Module:
    File:
    Line:

    Expression:

    For information on how your program can cause an assertion
    failure, see the Visual C++ documentation on asserts....<program name unknown>dbgrpt.cszUserMessage != NULLClientIgnoreCRTNormalFreeError: memory allocation: bad memory block type.
    Invalid allocation size: %u bytes.
    %sClient hook allocation failure.
    Client hook allocation failure at file %hs line %d.
    dbgheap.c_CrtCheckMemory()_pFirstBlock == pOldBlock_pLastBlock == pOldBlockfRealloc || (!fRealloc && pNewBlock == pOldBlock)_BLOCK_TYPE(pOldBlock->nBlockUse)==_BLOCK_TYPE(nBlockUse)pOldBlock->nLine == IGNORE_LINE && pOldBlock->lRequest == IGNORE_REQ_CrtIsValidHeapPointer(pUserData)Allocat ion too large or negative: %u bytes.
    Client hook re-allocation failure.
    Client hook re-allocation failure at file %hs line %d.
    _pFirstBlock == pHead_pLastBlock == pHeadpHead->nBlockUse == nBlockUsepHead->nLine == IGNORE_LINE && pHead->lRequest == IGNORE_REQDAMAGE: after %hs block (#%d) at 0x%08X.
    DAMAGE: before %hs block (#%d) at 0x%08X.
    Client hook free failure.
    memory check error at 0x%08X = 0x%02X, should be 0x%02X.
    %hs located at 0x%08X is %u bytes long.
    %hs allocated at file %hs(%d).
    DAMAGE: on top of Free block at 0x%08X.
    DAMAGED_heapchk fails with unknown return value!
    _heapchk fails with _HEAPBADPTR.
    _heapchk fails with _HEAPBADEND.
    _heapchk fails with _HEAPBADNODE.
    _heapchk fails with _HEAPBADBEGIN.
    Bad memory block found at 0x%08X.
    _CrtMemCheckPoint: NULL state pointer.
    _CrtMemDifference: NULL state pointer.
    Object dump complete.
    crt block at 0x%08X, subtype %x, %u bytes long.
    normal block at 0x%08X, %u bytes long.
    client block at 0x%08X, subtype %x, %u bytes long.
    {%ld} %hs(%d) : #File Error#(%d) : Dumping objects ->
    Data: <%s> %s
    %.2X Detected memory leaks!
    Total allocations: %ld bytes.
    Largest number used: %ld bytes.
    %ld bytes in %ld %hs Blocks.
    stdenvp.cstdargv.ca_env.cruntime error
    TLOSS error
    SING error
    DOMAIN error
    R6028
    - unable to initialize heap
    R6027
    - not enough space for lowio initialization
    R6026
    - not enough space for stdio initialization
    R6025
    - pure virtual function call
    R6024
    - not enough space for _onexit/atexit table
    R6019
    - unable to open console device
    R6018
    - unexpected heap error
    R6017
    - unexpected multithread lock error
    R6016
    - not enough space for thread data

    abnormal program termination
    R6009
    - not enough space for environment
    R6008
    - not enough space for arguments
    R6002
    - floating point not loaded
    Microsoft Visual C++ Runtime LibraryRuntime Error!

    Program:     Y..@f..@    â»@D»@Q»@    Č▓@▓▓@    .│@=│@    j┤@ L┤@R┤@    .Á@Ř┤@.Á@osfinfo.cchsize.csize >= 0format != NULLsprintf.cstring != NULLvsprintf.cGetLastActivePopupGetActiveWindowMes sageBoxAfclose.cstr != NULL("inconsistent IOB fields", stream->_ptr - stream->_base >= 0)_flsbuf.c..........EEE.....50P (8PX..700WP. ..`h````ppxxxx...........(null)(null)output.cch != _T('\0')    ˘ A˙ A    Â A╝ A    Č A▓ A_freebuf.cstream != NULL_getbuf.ccreateing DD objseting cooperation level to windowed mode normalC:\programming stuff\newgame\debugdump.txt


    and here it is with debug mode off

    runtime error
    TLOSS error
    SING error
    DOMAIN error
    R6028
    - unable to initialize heap
    R6027
    - not enough space for lowio initialization
    R6026
    - not enough space for stdio initialization
    R6025
    - pure virtual function call
    R6024
    - not enough space for _onexit/atexit table
    R6019
    - unable to open console device
    R6018
    - unexpected heap error
    R6017
    - unexpected multithread lock error
    R6016
    - not enough space for thread data

    abnormal program termination
    R6009
    - not enough space for environment
    R6008
    - not enough space for arguments
    R6002
    - floating point not loaded
    Microsoft Visual C++ Runtime Library

    Runtime Error!

    Program: ...<program name unknown>


    SleepKERNEL32.dlläDefWindowProcAÓ.PostQuitMessage╗ EndPaint BeginPaintĽDispatchMessageAé.TranslateMessage▄.Pee kMessageAYCreateWindowExA˛.RegisterClassAÜ.LoadCur sorA×.LoadIconAŮ.PostMessageAŃGetAsyncKeyStateUSER 32.dll_.GetStockObjectGDI32.dll.DirectDrawCreateDD RAW.dll&.GetModuleHandleAP.GetStartupInfoA╩GetComm andLineAt.GetVersion}ExitProcess/.RtlUnwind..GetLastError.CloseHandle▀.WriteFile..R eadFilej.SetFilePointerm.SetHandleCountR.GetStdHan dle..GetFileType4CreateFileAÖ.HeapAlloc×.Terminate Process¸GetCurrentProcess...UnhandledExceptionFilte r$.GetModuleFileNameA▓FreeEnvironmentStringsA│Free EnvironmentStringsWĎ.WideCharToMultiByte..GetEnvir onmentStrings..GetEnvironmentStringsWŁ.HeapDestroy Ť.HeapCreate┐.VirtualFreeč.HeapFree¬FlushFileBuffe rs|.SetStdHandlea.SetEndOfFile╗.VirtualAllocó.Heap ReAllocŞ.IsBadWritePtr┐GetCPInfo╣GetACP1.GetOEMCP> .GetProcAddress┬.LoadLibraryAő.SetUnhandledExcepti onFilterÁ.IsBadReadPtr▓.IsBadCodePtrń.MultiByteToW ideChar┐.LCMapStringA└.LCMapStringWS.GetStringType AV.GetStringTypeW

  4. #4
    Bobish
    Guest
    oops i though it would just wrap around

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,848
    > and i haven't used printf in my program
    That doesn't mean the run time library can't use it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    bobish
    Guest
    okay a few more questions:
    first i think there is something special about 0x%08X because that was used in the section on directX debging in sunlights tutorial.
    second why cand visual c++ put the error mesages in a more rational place then the EXE file(it was just by chance that i happend to look there).

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,848
    > first i think there is something special about 0x%08X
    Probably not - though it usually means that you've done something horribly wrong.

    > second why cand visual c++ put the error mesages in a more rational place then the EXE file
    Where else would they go?

    I mean, for things like
    R6028
    - unable to initialize heap
    You can look these up in the help.

    Without seeing the EXACT text of the error message you got, it's hard to tell you how to go about debugging such things in future.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  8. #8
    Bobish
    Guest
    Its about as close to exact as you can get. I was just wondering if the program used that message say as a generic error message for something or if it was just taking up space. At any rate i think ill just restart my progam from scratch and think of the last one as a learning experiance. Oh and thanks for the help.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21