News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Windows solves our bugs automatically

Started by jj2007, February 25, 2015, 03:39:25 AM

Previous topic - Next topic

jj2007

It has happened to me several times, and I still have got used to it: Windows miraculously solves bugs in my proggies. You don't believe me? Make the test:

- open \Masm32\examples\exampl01\comctls\comctls.asm
- go to line 300
- insert
        xor ecx, ecx
        div ecx
- build and run.

And voilĂ , it builds and runs without any problems, isn't that cute? Note this is Win7-64 - on unsafe previous versions such as Win XP, the div ecx used to throw really, really bad exceptions. Kudos to Richmond, you are really making progress :t


ragdog

Hi

Yes div by zero a bug and in your debugger have you a Exception "division by zero"
But why should Ml not build ?

Greets,


ragdog

Yes but i have add it under WM_Init on a Dialog app and this programm crash if this code div by zero reached

sinsi

Fails silently on Win8Pro x64

Faulting application name: comctls.exe, version: 0.0.0.0, time stamp: 0x54ecced5
Faulting module name: comctls.exe, version: 0.0.0.0, time stamp: 0x54ecced5
Exception code: 0xc0000094
Fault offset: 0x000015dd
Faulting process ID: 0xa10
Faulting application start time: 0x01d05066e14ca7d9
Faulting application path: C:\masm32\examples\exampl01\comctls\comctls.exe
Faulting module path: C:\masm32\examples\exampl01\comctls\comctls.exe


adeyblue

Exceptions that are thrown from an application that runs in a 64-bit version of Windows are ignored

The stuff the hotfix from that article enables is included in 7 SP1 by default, and given what Sinsi says, probably above too.

dedndave

that exception is a good thing
i want to know if my code attempts divide by 0 so i can fix it

jj2007

Quote from: dedndave on February 25, 2015, 06:34:09 AM
that exception is a good thing
i want to know if my code attempts divide by 0 so i can fix it

Exactly. On my system, updated a hundred times since the KB linked by adeyblue was published in 2009, it "succeeds", only that I see 5 five toolbar icons instead of the 8 that should be there. This is a FAT WINDOWS BUG, and I am surprised it has not been solved automatically a long time ago.

@sinsi: What do you mean with "fails silently"? No window, or a window with 5 toolbar icons, like on my system?

sinsi

No window, shows in task manager for a few seconds then disappears. No indication of an error either, I looked in event viewer to check, that was the only sign of a problem.

I imagine a lot of programmers would be tearing their hair out trying to follow this 'bug'.

rrr314159

FWIW

On my Win8 system, also on my Win 8.1 system, integer div-by-zero crashes. Apparently I don't have that hotfix (or, hot-break).
I am NaN ;)