Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Debug Assertion Failed

Debug Assertion Failed

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelptutorial
21 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Cedric Moonen

    Davitor wrote:

    Now i hope you will help me..

    It would much easier if you provide the exact crash location, and eventually copy the call stack.

    Cédric Moonen Software developer
    Charting control [v2.0] OpenGL game tutorial in C++

    D Offline
    D Offline
    Davitor
    wrote on last edited by
    #7

    crash location showing here.

    ATLASSERT( nLength <= GetData()->nAllocLength );

    in file atlsimpstr.h. Plz help me..

    R 1 Reply Last reply
    0
    • R Rajesh R Subramanian

      Provide only the code that has relevance with this issue and take your time to align the code properly. Also, what is tr, finalstring, etc.,? There's a global tr (I don't see it declared anywhere) and another tr inside your worker thread function code with local scope. A perfect recipe for disaster. This is one rare case where I'm going to encourage cross-posting. You may kindly cross-post your code at the coding horror forum too.

      It is a crappy thing, but it's life -^ Carlo Pallini

      D Offline
      D Offline
      Davitor
      wrote on last edited by
      #8

      Thanks Subramanian ji i had send code where issue will be generated.And next time i align code proper.

      1 Reply Last reply
      0
      • D Davitor

        crash location showing here.

        ATLASSERT( nLength <= GetData()->nAllocLength );

        in file atlsimpstr.h. Plz help me..

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #9

        Hello! Which line of "your" code is triggering this assertion?

        It is a crappy thing, but it's life -^ Carlo Pallini

        D 1 Reply Last reply
        0
        • R Rajesh R Subramanian

          Provide only the code that has relevance with this issue and take your time to align the code properly. Also, what is tr, finalstring, etc.,? There's a global tr (I don't see it declared anywhere) and another tr inside your worker thread function code with local scope. A perfect recipe for disaster. This is one rare case where I'm going to encourage cross-posting. You may kindly cross-post your code at the coding horror forum too.

          It is a crappy thing, but it's life -^ Carlo Pallini

          D Offline
          D Offline
          Davitor
          wrote on last edited by
          #10

          Yes tr, finalstring both are globle. Worker thread it's not tr it is tt.So sorry for that.

          C 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            Hello! Which line of "your" code is triggering this assertion?

            It is a crappy thing, but it's life -^ Carlo Pallini

            D Offline
            D Offline
            Davitor
            wrote on last edited by
            #11

            That's a problem Subramanian ji. When i go through Debug then i han't got assertion and when i go through normal mode then i got some time this assertion.This assertion not come regullar.So i han't got exact line of code.If it is possible then help me

            R 1 Reply Last reply
            0
            • R Rajesh R Subramanian

              Provide only the code that has relevance with this issue and take your time to align the code properly. Also, what is tr, finalstring, etc.,? There's a global tr (I don't see it declared anywhere) and another tr inside your worker thread function code with local scope. A perfect recipe for disaster. This is one rare case where I'm going to encourage cross-posting. You may kindly cross-post your code at the coding horror forum too.

              It is a crappy thing, but it's life -^ Carlo Pallini

              C Offline
              C Offline
              Cedric Moonen
              wrote on last edited by
              #12

              Rajesh R Subramanian wrote:

              This is one rare case where I'm going to encourage cross-posting. You may kindly cross-post your code at the coding horror forum too.

              :laugh:

              Cédric Moonen Software developer
              Charting control [v2.0] OpenGL game tutorial in C++

              1 Reply Last reply
              0
              • D Davitor

                Yes tr, finalstring both are globle. Worker thread it's not tr it is tt.So sorry for that.

                C Offline
                C Offline
                chirag_chauhan
                wrote on last edited by
                #13

                It's better if you can try out sample application with minimum code including function that cause the error that will help you to get into exact problem. And it will also helps others to find out exact cause of problem and to give appropriate solution.

                1 Reply Last reply
                0
                • D Davitor

                  That's a problem Subramanian ji. When i go through Debug then i han't got assertion and when i go through normal mode then i got some time this assertion.This assertion not come regullar.So i han't got exact line of code.If it is possible then help me

                  R Offline
                  R Offline
                  Rajesh R Subramanian
                  wrote on last edited by
                  #14

                  Try different test cases and narrow down the number of cases for which the crash is occurring. You might as well output text to the debugger window from within your code (if you are not running under the VS debugger, you can still use an external debugger[^] (just connect it to the local machine) and use something like OutputDebugString[^] to print to the debugger). The actual problem might be something as trivial as writing to a pointer that has been released, accessing memory that you don't own, etc., But you need to locate it first.

                  It is a crappy thing, but it's life -^ Carlo Pallini

                  D 2 Replies Last reply
                  0
                  • R Rajesh R Subramanian

                    Try different test cases and narrow down the number of cases for which the crash is occurring. You might as well output text to the debugger window from within your code (if you are not running under the VS debugger, you can still use an external debugger[^] (just connect it to the local machine) and use something like OutputDebugString[^] to print to the debugger). The actual problem might be something as trivial as writing to a pointer that has been released, accessing memory that you don't own, etc., But you need to locate it first.

                    It is a crappy thing, but it's life -^ Carlo Pallini

                    D Offline
                    D Offline
                    Davitor
                    wrote on last edited by
                    #15

                    Thanks for debugger information.How can i use it?

                    1 Reply Last reply
                    0
                    • R Rajesh R Subramanian

                      Try different test cases and narrow down the number of cases for which the crash is occurring. You might as well output text to the debugger window from within your code (if you are not running under the VS debugger, you can still use an external debugger[^] (just connect it to the local machine) and use something like OutputDebugString[^] to print to the debugger). The actual problem might be something as trivial as writing to a pointer that has been released, accessing memory that you don't own, etc., But you need to locate it first.

                      It is a crappy thing, but it's life -^ Carlo Pallini

                      D Offline
                      D Offline
                      Davitor
                      wrote on last edited by
                      #16

                      external debugger

                      is not working.And i have no idia how to find assertion line plz help me

                      1 Reply Last reply
                      0
                      • D Davitor

                        Hi All how to solve this Debug.

                        unhandled exception at 0x00541ccf in Test.exe:0xC0000005;Access vilolation reading location 0xfeeefeee

                        Plz help me

                        D Offline
                        D Offline
                        David Crow
                        wrote on last edited by
                        #17

                        An assertion is completely different than an exception. So which is it?

                        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                        1 Reply Last reply
                        0
                        • D Davitor

                          Hi All how to solve this Debug.

                          unhandled exception at 0x00541ccf in Test.exe:0xC0000005;Access vilolation reading location 0xfeeefeee

                          Plz help me

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #18

                          Davitor wrote:

                          Access vilolation reading location 0xfeeefeee

                          0xfeeefeee is a Magic Number[^] which has a meaning. This essentially means that you are trying to access memory AFTER it has been freed. You should begin debugging by checking the variables that you are accessing in your worker thread. Best Wishes, -David Delaune

                          1 Reply Last reply
                          0
                          • D Davitor

                            Hi All how to solve this Debug.

                            unhandled exception at 0x00541ccf in Test.exe:0xC0000005;Access vilolation reading location 0xfeeefeee

                            Plz help me

                            S Offline
                            S Offline
                            Stephen Hewitt
                            wrote on last edited by
                            #19

                            Google is your friend: try this[^].

                            Steve

                            1 Reply Last reply
                            0
                            • R Rajesh R Subramanian

                              Provide only the code that has relevance with this issue and take your time to align the code properly. Also, what is tr, finalstring, etc.,? There's a global tr (I don't see it declared anywhere) and another tr inside your worker thread function code with local scope. A perfect recipe for disaster. This is one rare case where I'm going to encourage cross-posting. You may kindly cross-post your code at the coding horror forum too.

                              It is a crappy thing, but it's life -^ Carlo Pallini

                              C Offline
                              C Offline
                              CPallini
                              wrote on last edited by
                              #20

                              Welcome pal. BTW That's wonderful. :-D

                              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                              [My articles]

                              R 1 Reply Last reply
                              0
                              • C CPallini

                                Welcome pal. BTW That's wonderful. :-D

                                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                [My articles]

                                R Offline
                                R Offline
                                Rajesh R Subramanian
                                wrote on last edited by
                                #21

                                Ah, thanks. :-O

                                It is a crappy thing, but it's life -^ Carlo Pallini

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups