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. Legacy VC 6.0 Works Differently in Debug Mode

Legacy VC 6.0 Works Differently in Debug Mode

Scheduled Pinned Locked Moved C / C++ / MFC
c++debuggingquestion
5 Posts 4 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.
  • R Offline
    R Offline
    Reagan Conservative
    wrote on last edited by
    #1

    OK, I have never seen this before --- maybe some of you folks have. I have a legacy VC++ 6.0 program that communicates with a host computer. This program is all dialog-based and sends requests to the host through pressing buttons on the dialogs. Now if I step through a certain section of code that I'm trying to implement, it reacts differently during the Debug that it does during normal operation. It appears that one of the messages I am sending to the host either gets "lost" somewhere during normal ops, but gets handled when stepping through the code. Does anyone have any idea what could possibly be going on here? Thanks for any and all input. This one has me almost to the point of pulling out my hair by the roots.

    John P.

    M L D R 4 Replies Last reply
    0
    • R Reagan Conservative

      OK, I have never seen this before --- maybe some of you folks have. I have a legacy VC++ 6.0 program that communicates with a host computer. This program is all dialog-based and sends requests to the host through pressing buttons on the dialogs. Now if I step through a certain section of code that I'm trying to implement, it reacts differently during the Debug that it does during normal operation. It appears that one of the messages I am sending to the host either gets "lost" somewhere during normal ops, but gets handled when stepping through the code. Does anyone have any idea what could possibly be going on here? Thanks for any and all input. This one has me almost to the point of pulling out my hair by the roots.

      John P.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      This may be completely unrelated, but if you are using TCP/IP and sockets, are you checking your recv() calls to make sure you are getting all the bytes you are requesting? recv() only guarantees 1 byte received on any successful call (although almost always you get more) and this is a common mistake. It happens with named pipes as well (that WTF cost me many hours once :laugh:) Also, remember that threads behave differently single stepping so you may be exposing a synchronization problem that will bite you later on. My 2 cents. Mark

      1 Reply Last reply
      0
      • R Reagan Conservative

        OK, I have never seen this before --- maybe some of you folks have. I have a legacy VC++ 6.0 program that communicates with a host computer. This program is all dialog-based and sends requests to the host through pressing buttons on the dialogs. Now if I step through a certain section of code that I'm trying to implement, it reacts differently during the Debug that it does during normal operation. It appears that one of the messages I am sending to the host either gets "lost" somewhere during normal ops, but gets handled when stepping through the code. Does anyone have any idea what could possibly be going on here? Thanks for any and all input. This one has me almost to the point of pulling out my hair by the roots.

        John P.

        L Offline
        L Offline
        Leah_Garrett
        wrote on last edited by
        #3

        Something like this happened to me once. Turned out there was a memory leak that must have wondered into the buffered space in debug mode and not hurt anything but in release mode it caused a crash. We used Bounds Checker to track the memory leak.

        1 Reply Last reply
        0
        • R Reagan Conservative

          OK, I have never seen this before --- maybe some of you folks have. I have a legacy VC++ 6.0 program that communicates with a host computer. This program is all dialog-based and sends requests to the host through pressing buttons on the dialogs. Now if I step through a certain section of code that I'm trying to implement, it reacts differently during the Debug that it does during normal operation. It appears that one of the messages I am sending to the host either gets "lost" somewhere during normal ops, but gets handled when stepping through the code. Does anyone have any idea what could possibly be going on here? Thanks for any and all input. This one has me almost to the point of pulling out my hair by the roots.

          John P.

          D Offline
          D Offline
          Don Fletcher
          wrote on last edited by
          #4

          I've also seen problems like this when you have multiple threads on the client or server and don't put appropriate synchonization in place, eg mutex. Single-stepping in the debugger gives the app time to breathe between calls so the conflicts don't occur. It could also be something to do with not blocking correctly on the tcp socket Don

          1 Reply Last reply
          0
          • R Reagan Conservative

            OK, I have never seen this before --- maybe some of you folks have. I have a legacy VC++ 6.0 program that communicates with a host computer. This program is all dialog-based and sends requests to the host through pressing buttons on the dialogs. Now if I step through a certain section of code that I'm trying to implement, it reacts differently during the Debug that it does during normal operation. It appears that one of the messages I am sending to the host either gets "lost" somewhere during normal ops, but gets handled when stepping through the code. Does anyone have any idea what could possibly be going on here? Thanks for any and all input. This one has me almost to the point of pulling out my hair by the roots.

            John P.

            R Offline
            R Offline
            Reagan Conservative
            wrote on last edited by
            #5

            Thank you all for you responses.

            John P.

            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