仅在发布版本中出现问题! [英] Problem only in release version!

查看:78
本文介绍了仅在发布版本中出现问题!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好吧

我正在使用嵌入式Visual Studio 4中的项目,我有一个

一般性问题我希望有人可以帮助我。我的问题

如下:

我的项目在调试版中工作正常但行为异常且

有时会在发布版本中运行时崩溃。我怀疑它是b / b
是某种内存问题但是找出问题确实是什么原因并不容易(项目相当大,可能是30000

代码行。

它应该是在两个版本中运行的相同代码,对吧?或者是

项目中的某些部分代码可能在调试和

发布版本上有所不同?


感谢您的光临所有你的帮助。

问候。

/ Babak

Hi everybody
I''m working with a project in embedded Visual Studio 4 and I have a
general problem which I hope that somebody can help me with. My problem
is the following:
My project works fine in debug version but behaves strangely and
sometimes crashes when I run it in release version. I suspect that it
is some sort of memory problem but it is not that easy to find out what
the problem exactly is (the project is rather big with maybe 30000
lines of code).
It should be the same code that runs in the both versions, right? Or is
there some part of the code in a project that might differ in debug and
release version?

Thanks for all your help.
Regards.
/Babak

推荐答案

你好babak!
Hi babak!
我的项目在调试版本中工作正常,但行为奇怪,当我在发布版本中运行时,有时会崩溃。
My project works fine in debug version but behaves strangely and
sometimes crashes when I run it in release version.



请参阅:幸存版本
http:// www .flounder.com / debug_release.htm


大部分都与未初始化的数据有关(在调试中,这些数据将获得

soe"默认值值;但在发布时它会得到一些随机数字。)


-

问候

Jochen

我关于Win32和.NET的博客
http://blog.kalmbachnet.de/



See: Surviving the Release Version
http://www.flounder.com/debug_release.htm

Mostly it has to do with uninitialized data (in debug this data will get
soe "default" value; but in release it will get some random numbers).

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/


为了肯定Jochen的观点,Debug版本初始化了大多数变量

为零。 Release版本不会初始化任何自然'

(意思是没有你编写代码来执行此操作),因此许多变量

通常会被赋予''加载时的'随机'值(''随机'',因为它们保持

它们碰巧被分配到的内存地址的内容)。


因此,你的新错误很可能是某个变量工作正常的结果

如果初始化为零,但如果没有初始化为零则不起作用(或者不在

某个范围,非负数等)。由于应用程序并不总是在同一个地方和内存中加载
,并且因为即使在
内存中的相同位置也可能具有不同的值,具体取决于您何时加载你的程序

(这就是为什么它的RAM不是ROM ......呵呵),你可以获得随机错误和不稳定

执行发布版本(即,根据变量的随机性质,它可能在不同的运行中执行不同的操作),即使

在调试模式下完全稳定。


希望有所帮助!!! :)

" Jochen Kalmbach [MVP]" <无******************** @ holzma.de>在消息中写道

新闻:O9 ************** @ TK2MSFTNGP12.phx.gbl ...
Just to affirm Jochen''s point, the Debug version initializes most variables
to zero. The Release version will not initialize anything ''naturally''
(meaning without you writing code to do so), and hence many of the variable
are often given a ''random'' value upon loading (''random'' in that they keep
the contents of the memory addresses they happen to get assigned to).

Thus, your new errors are likely the result of some variable that works fine
if initialized to zero, but don''t work if not initialized to zero (or not in
some range, non-negative, etc.). Since an application doesn''t always get
loaded at the same place and memory, and because even the same place in
memory can have different values depending on when you load your program
(that''s why it''s RAM not ROM...hehe), you can get random bugs and un-stable
executions of the Release version (i.e., it might do different things on
different runs depending on the ''random'' nature of your variables) even if
it is totally stable in Debug mode.

Hope that helps!!! : )
"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in message
news:O9**************@TK2MSFTNGP12.phx.gbl...
嗨babak!
Hi babak!
我的项目在调试版本中工作正常但行为异常且有时在发布版本中运行时会崩溃。
My project works fine in debug version but behaves strangely and
sometimes crashes when I run it in release version.



请参阅:Surviving发布版本
http://www.flounder.com/debug_release.htm

大多数情况下它与未初始化的数据有关(在调试中,这些数据会得到
soe默认值;但在发布时它会得到一些随机数字。)<问候
Jochen

关于Win32和.NET的博客
http://blog.kalmbachnet.de/



Jochen和彼得,

感谢您的回复。现在我的问题是找出

中我的代码变量可能未初始化的地方......(正如我之前所说,这是一个很大的项目我是''正在运行)。


问候。

/ Babak

Jochen and Peter,
Thanks for your replies. Now the problem for me is to find out where in
my code variables could be uninitialized... (as I said before, it is a
huge project I''m running).

Regards.
/Babak


这篇关于仅在发布版本中出现问题!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆