Re: 64b Windows - crashes not detected
- From: phil oakleaf <news@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Aug 2009 17:33:01 +0100
Joseph M. Newcomer wrote:
In reading all the responses, I find it surprising that you would get a null-pointerJoe
dereference of a virtual method to work, ever.
But the environment of a 32-bit app on a 64-bit machine is going to be ever-so-slightly
different than the same app on a native 32-bit machine that there is the possibility that
undefined pointer problems will behave differently. But NULL pointers won't. These
differences are going to be pretty obscure; for example, 0xcccccccc is potentially a valid
address in a 32-bit app running on Win64, but it requires actually having allocated
storage at that space and having linked with /LARGEADDRESSAWARE.
Have you ever heard of ASSERT statements? If I really cared, I would have written
ASSERT(p != NULL);
at places where I had ever seen a null pointer dereference. Of course, I would never,
ever run release code until I had verified that the debug code worked.
In fact, if you compile /W4 you may see more places where there are potential problems; if
you have PreFast, it will detect potential problems as well.
You can also install a VM manager (such as the one from Microsoft, which I believe is
free) and install your 32-bit OS under a VM.
joe
On Thu, 20 Aug 2009 09:20:11 +0100, phil oakleaf <news@xxxxxxxxxxxxxxxxxxxxx> wrote:
I have recently switched to a 64bit Windows platform - we're still building a 32bit MFC Application.Joseph M. Newcomer [MVP]
I have found that some bugs in my code that would happily crash on 32bit windows (Invalid pointers) do not crash on 64bit.
This makes it very hard to know if the code has been debugged
Is there anything I can do about this other than re-install 32bit Windows
Any ideas will be really appreciated
Phil
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Thanks for the reply
I do use ASSERTS and I too verify the debug code works before going over to the release.
in the example I've posted if shows NULL->doSomething() does not crash on the 64bit system but does on the 32bit.
I do know that I should not allow NULL pointers but it seems reasonable to expect the debugger to catch any that do get through. On 32bit Windows it has done this for the last 15 years for me.
Thanks again
Phil
.
- Follow-Ups:
- Re: 64b Windows - crashes not detected
- From: Joseph M . Newcomer
- Re: 64b Windows - crashes not detected
- References:
- 64b Windows - crashes not detected
- From: phil oakleaf
- Re: 64b Windows - crashes not detected
- From: Joseph M . Newcomer
- 64b Windows - crashes not detected
- Prev by Date: Re: 64b Windows - crashes not detected
- Next by Date: Re: Adding an Icon To a CPropertySheet
- Previous by thread: Re: 64b Windows - crashes not detected
- Next by thread: Re: 64b Windows - crashes not detected
- Index(es):
Relevant Pages
|