XP/Windows 7 and VS 2010 Issue

Started by
8 comments, last by CrazyCdn 12 years, 11 months ago
So it's been a long time since I've posted on here. But I know some of the smartest people hang out on these forums so figured my wasted few hours of searching Google might get answered here.

Situation:
I have a Windows 7 development box (primary) and a Windows XP laptop.
Both have legal copies of Visual Studios 2010 installed on them (Not EE but Ultimate, doubt it makes much of a difference here).
Now I can take the solution from the Windows 7 box that compiles and runs fine and put the executable on the XP machine and it crashes with a memory error (all Debug build).
I can compile the same solution as above and it does the exact same thing.

I've also tried running it on several other XP machines and it does the same thing. I'm not doing ANY 64 bit coding and I've looked through the configuration of the solution several times and I see nothing glaring at me that could be wrong.

Oh, I'm also trying to find a Vista machine to test it on too, 32bit and 64bit (not tried 64 bit XP, don't have access to it).

Its crashing on a function that returns an ID (int, set to 0 in the constructor). In the debugger the value is valid and then it just blows up (I see nothing wrong anyways).

So before I start fighting with the code (oh and it needs to run on XP the clients are unwilling to upgrade, small business in this economy I'm not pushing the issue), I want to know if its some simple configuration issue or most likely code that I inherited.

Thanks in advance.

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

Advertisement
Debug run-time libraries are not redistributable. So unless you install full visual studio on those machines, you're missing that. If those libraries were somehow installed, they are likely incorrect version so anything can happen.
As I said, both have the exact same copy of Visual Studio installed (different key but used the same physical CD). I know the debug libraries are not redistributable, Microsoft makes that very clear, but thanks anyways.

Oh all our Window 7 boxes (we've completely changed over, I have two XP boxes at home and it does the same thing on those (they have Visual Studios 2010 EE on them). Compiles but does not run, just crashes.

Sent a copy to a friend who has Vista and I got the ok from the owner of the software.

Any other ideas?

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

Maybe need to check your WINVER/etc #defines? Make sure that they're not 0x600 or higher (i.e. that they're valid for XP) otherwise you might be linking to Vista+ specific code.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

XP uses a somewhat different heap implementation to 7. It's possible you have a bug which is only showing up on XP. Try using Application Verifier to enable page heap mode and see if that finds any issues.
Awesome both of you. I will check/do both Sunday (doing mothers day early) and report back.

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

I have had some funny issues with XP & 7 also. My work around was to compile with VS.net 2003 on my XP box and all was good. But this may not be an option for you here.

What happens if you complie with VS.net 2010 on your xp box first and use that executable for XP and Win 7.

I'd love to know if this fixes your problem.
Memory error eh? Something like 0xC0000005?

That usually means you've fucked up somewhere with your pointers.

My suggestion, make sure you have the appropriate visual studio redistributable, run it in release mode.

If you're running debug mode, do it from vs and start with debugging. at least that way you can find out where it's crashing.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Quick update:

@Adam_42:
I wasn't too sure if it did things the same or not as per heap allocations, I am using Boost Smart Pointers but think I'm going to move to 90% weak pointers and only have 1 actual smart pointer. I'm downloading Application Verifier shortly, PSU died on my PC today. Joy!

@lonewolff:
I have Visual Studios 2005 so I am going to try that more as a last resort. Compiled and ran both debug and release mode executable's from the XP machine on the 7 box and they ran fine. Doesn't really narrow down too much though, just that its compiling the same.

@Washu:
Yeah, starting to think the same thing, though it doesn't use raw pointers anywhere I can find, though I am about to throw in a lot more logging code to verify everything and narrow it down. I think its mostly frustrating that it works fine in 7 but doesn't in XP. Time to find out where it's trashing (or not allocating) memory. I was hoping it was just a settings issue for a simple fix. But this is now my current to-do list bug so gloves off time.

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

Solved.

I thought I had gone through all this guys code, but apparently I missed one critical file. He decided to write his own new/delete operators (global) and I've not found out what he was doing wrong but removing that from the project solved the issues completely and for as far as I care, fixes the problem. I'm assuming he did something 64bit related or otherwise weird. Would have been nice if the code was included in the solution file instead of being hidden inside some config.h and in a block of code minimized (I prefer my code fully expanded, for a reason).

Anyways thanks for all the help, still going to run Application Verifier just to see what it does and if it finds anything...

Thanks!

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

This topic is closed to new replies.

Advertisement