Differences between release and debug

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Differences between release and debug

    Hi,

    does anyone know what would be the (most common) reasons
    to get difference answers in VC++.net between running in
    release and debug ?

    Thanks,

    JC
  • Carl Daniel [VC++ MVP]

    #2
    Re: Differences between release and debug

    jean.cabello@ed s.com wrote:[color=blue]
    > Hi,
    >
    > does anyone know what would be the (most common) reasons
    > to get difference answers in VC++.net between running in
    > release and debug ?[/color]

    Reliance on content of uninitialized memory.

    -cd


    Comment

    • Patrick Philippot

      #3
      Re: Differences between release and debug

      jean.cabello@ed s.com wrote:[color=blue]
      > Hi,
      > does anyone know what would be the (most common) reasons
      > to get difference answers in VC++.net between running in
      > release and debug ?[/color]

      For unmanaged code, the two main reasons for getting a different
      behavior between release and debug versions are :

      1/ The memory allocation mechanism. Unitialized or incorrectly
      initiliazed pointers will be handled differently.

      2/ Optimizations which are usually disabled in debug versions. For
      example, my current project systematically crashes under Win9x when I
      optimize for speed or size (I'm using VC6 for this one but the same
      remarks apply). If I disable optimizations or use default optimization,
      there's no problem. The same program runs fine in all cases under Win NT
      +.

      What differences are you observing?

      --
      Patrick Philippot - Microsoft MVP [.Net]
      MainSoft Consulting Services

      (replace .xx with .fr when replying by e-mail)



      Comment

      • Guest's Avatar

        #4
        Re: Differences between release and debug

        I am seing exceptions thrown in release mode that do not
        occur in debug mode.

        The optimisation is critical as there is usually a factor
        of 10 speed between release and debug. So my next question
        is ...

        Is there a compile flag in debug that will set all
        uninitialised variable to invalid values and show where
        the problem is ?

        Thanks,


        [color=blue]
        >-----Original Message-----
        >jean.cabello@e ds.com wrote:[color=green]
        >> Hi,
        >> does anyone know what would be the (most common) reasons
        >> to get difference answers in VC++.net between running in
        >> release and debug ?[/color]
        >
        >For unmanaged code, the two main reasons for getting a[/color]
        different[color=blue]
        >behavior between release and debug versions are :
        >
        >1/ The memory allocation mechanism. Unitialized or[/color]
        incorrectly[color=blue]
        >initiliazed pointers will be handled differently.
        >
        >2/ Optimizations which are usually disabled in debug[/color]
        versions. For[color=blue]
        >example, my current project systematically crashes under[/color]
        Win9x when I[color=blue]
        >optimize for speed or size (I'm using VC6 for this one[/color]
        but the same[color=blue]
        >remarks apply). If I disable optimizations or use default[/color]
        optimization,[color=blue]
        >there's no problem. The same program runs fine in all[/color]
        cases under Win NT[color=blue]
        >+.
        >
        >What differences are you observing?
        >
        >--
        >Patrick Philippot - Microsoft MVP [.Net]
        >MainSoft Consulting Services
        >www.mainsoft.xx
        >(replace .xx with .fr when replying by e-mail)
        >
        >
        >
        >.
        >[/color]

        Comment

        • Doug Forster

          #5
          Re: Differences between release and debug

          Hi,
          [color=blue]
          > Is there a compile flag in debug that will set all
          > uninitialised variable to invalid values and show where
          > the problem is ?[/color]

          Debug does this by default I think. Which version of VS are you using? Does
          your app still crash when you vary the optimization settings? I had similar
          sounding problems which simply vanished with VS 2003

          Cheers

          Doug Forster

          <jean.cabello@e ds.com> wrote in message
          news:08ec01c3a9 47$4ba013a0$a00 1280a@phx.gbl.. .[color=blue]
          > I am seing exceptions thrown in release mode that do not
          > occur in debug mode.
          >
          > The optimisation is critical as there is usually a factor
          > of 10 speed between release and debug. So my next question
          > is ...
          >
          > Is there a compile flag in debug that will set all
          > uninitialised variable to invalid values and show where
          > the problem is ?
          >
          > Thanks,
          >
          >
          >[color=green]
          > >-----Original Message-----
          > >jean.cabello@e ds.com wrote:[color=darkred]
          > >> Hi,
          > >> does anyone know what would be the (most common) reasons
          > >> to get difference answers in VC++.net between running in
          > >> release and debug ?[/color]
          > >
          > >For unmanaged code, the two main reasons for getting a[/color]
          > different[color=green]
          > >behavior between release and debug versions are :
          > >
          > >1/ The memory allocation mechanism. Unitialized or[/color]
          > incorrectly[color=green]
          > >initiliazed pointers will be handled differently.
          > >
          > >2/ Optimizations which are usually disabled in debug[/color]
          > versions. For[color=green]
          > >example, my current project systematically crashes under[/color]
          > Win9x when I[color=green]
          > >optimize for speed or size (I'm using VC6 for this one[/color]
          > but the same[color=green]
          > >remarks apply). If I disable optimizations or use default[/color]
          > optimization,[color=green]
          > >there's no problem. The same program runs fine in all[/color]
          > cases under Win NT[color=green]
          > >+.
          > >
          > >What differences are you observing?
          > >
          > >--
          > >Patrick Philippot - Microsoft MVP [.Net]
          > >MainSoft Consulting Services
          > >www.mainsoft.xx
          > >(replace .xx with .fr when replying by e-mail)
          > >
          > >
          > >
          > >.
          > >[/color][/color]


          Comment

          Working...