This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Corrupted Loads From Stale .OBJs

Several of the developers here sometimes have a strange problem. UV2 will build a project with no unusual errors, yet the code from the build does not work correctly. Manually deleting all the object files from Windows (XP) and rebuilding (changing nothing else) creates a working load. "Build All" sometimes helps, and sometimes doesn't; reports seem mixed here.

What examination we've been able to do makes it seem like there are some linkage problems where one variable improperly overlays another. We see invalid values in some globals. But it's pretty unclear to us what's going on.

Needless to say, it's annoying to spend a day or a week chasing down a bug that turns out to have been a bad build. But we have no idea why the build would be bad, and why the usual build process doesn't create a coherent, up-to-date set of object files unless we delete them.

The project is relatively large (~70K lines of code, 120+ files, multiple targets). So it's likely to put more stress than normal on uV2. It also makes it hard for me to send tech support the usual small project that reproduces the problem. The size might itself be part of the problem.

Any ideas on conditions that might cause this behavior? We unfortunately don't have much solid information to go on. Anyone had any weird problems like this in their environment?

  • Do you use the "Register Colouring" (or whatever it's called) optimisation?

    I have seen cases where the results of "Register Colouring" (or whatever) from a previous build would have an effect even on doing a "Rebuild All"

    I think that was back at v6.??, though...?

  • Yes, we have that turned on. We bounce back and forth between levels 9 and 11, depending on which one gets us smaller code. Favor size, linker code packing on, absolute register addresses allowed.

    You may be on to something. I have noticed that every so often the linker will go into its 4-pass global register re-optimization for no reason apparent to me, and then even on the next build, it's happy. I suppose there's some information stored in those .objs that's important. Maybe our bug happens when the linker should have done the global optimization, but didn't notice that it needed to?