• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Logic error found in MSPAINT for WinXP...

CZroe

Lifer
[EDIT]
I recently discovered this bug in MSPAINT.EXE (the 32-bit Windows Paint program).
Surprisingly, the bug appears to affect all 32-bit versions of MSPAINT.EXE, one of Microsoft's oldest 32-bit programs.

It has been confirmed to affect all versions of MSPAINT.EXE from Windows 95 to Windows XP Professional. I'm surprised that this type of bug (which causes 'data-loss') has gone unnoticed for so long.

-Reproducing the Error-

These steps are to set it up so that I know we are working with the same type of file, including details such as color-depth:

1. Right-Click on desktop and choose "New Bitmap Image"

2. This will create a blank 24-bit bitmap.

3. Open the image with MSPAINT.EXE.
(In recent versions of Windows, Right-Click the file and choose "Edit")

4. Scribble some lines on the image.
(you may want to make the image area smaller; editing a 24-bit bitmap on some machines is painfully slow)

5. Save the image.

6. Exit MSPAINT.

Now...

1. Open the bitmap with MSPAINT.
(In recent versions of Windows, Right-Click the file and choose "Edit")

2. Choose the selection tool.
(DO NOT CLICK ANYTHING ELSE)

3. Highlight a small areea of the image.
(DO NOT CLICK WITHIN THE SELECTED AREA YET)

4. Hold Shift THEN drag the selected area to 'smear' it.
(Make sure you are holding Shift BEFORE you press the mouse button)

5. Release the mouse button, THEN release Shift.
(Not really necessary, but a lousy mouse might move a pixel or two, which would mess it up)

6. Choose "Save" from the "File" menu.

7. Exit MSPAINT.

8. Open the file again with MSPAINT.

Notice that the contents have not changed.

Getting the bug to occur is not difficult, most of these restrictions are so that you don't accidentally mess it up. I actually have trouble making it NOT occur.
A common mistake when trying to reproduce it is to click inside a highlighted area without FIRST holding shift.
Even if the selected area doesn't move a single pixel, a regular 'click' is perceived as an 'edit' and the file will save properly, failing to reproduce the error.

Old message follows:
[/EDIT}


<< I had already posted this in FORUMS>OPERATING SYSTEMS before I realized that this category was more specific...

I recently encountered a serious logic error in one of Microsoft's oldest Windows programs.
Can anyone confirm this problem with MSPAINT on another Windows OS?

Open an existing bitmap image.
Highlight an area in the image using the selection tool (from the upper right).
Hold shift while dragging the selected area around on the image to wipe over everything.
Save the image.
Close MSPAINT.
Open the image again with MSPAINT.
The contents were never saved!

Make sure to not select any other tools while you are trying to duplicate the error.
The error will occur even if you "Save As" with a different filename.

MS programmers assume that because you have not resized the area, or used certain tools, that the image contents have not changed.
If the save option is avalible (and not grayed out), good programming practice dictates that it should go through the actual saving process.
How could this sloppy programming go unnoticed for so long?
Is it new to the Windows XP version of MSPAINT?
>>

 
Able to duplicate problem under Win2K

Will check Win98SE at home tonight and post results unless some-one else gets here first
 
Thanks for the feedback!
Does anyone know of a good way to let MS know? They could whip up a patch for www.windowsupdate.com in a jiffy...
The 'normal' way to submit this type of thing has been fruitless for me in the past...
 
Able to duplicate in Win2K, BUT using Save As... will save the file.

More importantly, WHO THE HELL CARES?!? Why you you do this AND if it can only be created in a specific and unusual way, then what's the point.

OK, we get ya...we should all use Linux or a Mac. Say a prayer for us poor M$ victims.
 
You have no idea how much time and pain this bug has cost me while working on a Visual Basic project for school.
I do not care to go into the details, but the program is not funtioning properly.
 
Able to duplicate under Win2k

Yes, that is a major error, the program should save the current contents no matter what you do.
 
Does this problem not affect Win95, 98, 98SE, ME?
Or has nobody tried it on these operating systems yet?
 
I can vouch that my brother (who started this thread) spent an hour or so trying to figure out why MS Paint wouldn't save his work!
 
CyberZer0, you really gotta get this crap with your brother straightened out... kick his ass or something. Or change your password. People are gonna start thinking you are a psycho.
 
I have changed my password but there is an apparent security flaw in the forums: I left a work computer, a few friend's computers (That don't even know Anandtech exists) and several school computers logged in BEFORE I changed it, but they were still logged in even though the password changed. When it's logged in, all you have to do is type the new password. He hasn't even noticed that I changed the password because he's been using so many different computers!
 
So:
Windows 95B OSR2 (Thnx Shalmanese)
Windows 98
Windows 98SE (Thnx EagleKeeper)
Windows 2000 (Thnx bjb86s, DefRef, EagleKeeper)
Windows ME
Windows XP Home
Windows XP Pro
Are all confirmed to have the flaw in their versions of MS Paint.

That covers nearly everything except NT. Thnx guys! Windows 3.1x used a TOTALLY diferent version of MS Paint with many unrefined functions, so it would probably be just coincidental if it also has the flaw.
The trend looks like it affects every version since Windows 95 (Probably A).

EagleKeeper: Heh, I wonder how they could cover this one up as a feature?
"Safety Fallback Anti-save function"

Back to what DefRep says (This coming from the REAL CZroe):


<< More importantly, WHO THE HELL CARES?!? Why you you do this AND if it can only be created in a specific and unusual way, then what's the point. >>


I can vouch that my brother did waste a lot of time and work because of this bug. So obviously, the people that it affects care (Does that answer your 1st question?). He was working on a "calculator" program for his extremely easy Visual Basic class (It's his mid-term project). Because he's way more advanced than everyone else there, he wanted to make his "Electronic Abacus" something immediately noticeable as "superior." He had heard his teacher marveling at such silly things as "skins" so he thought he'd make it skinnable just to amuse her (To her, skins were a BIG deal). He was creating the bitmap images for the buttons using MSPAINT. When developing the program, he'd have to redesign and rearrange the buttons many times. One such occasion, all he had to do was remove the numbers from the already drawn buttons. Because they had a grey background, and he was not sure which "grey" it was to right click, and so he couldn't use the eraser (He could have use the suction tool but he knows better ways to do things). He used the selection tool that he routinely uses instead to highlight a gray area and wipe over the numbers by holding shift. How "unusual" is that? Does that answer your second question? It was after he did this to every button that he noticed his program had never updated the skin displayed. After spending HOURS editing bitmaps, he finally figured out that it didn't save ANY of the 30 or so bmp's he edited. Then, it took him even longer to find out why! Back to the first question: Should he "not care" about it when it caused him this much trouble? Think about that. Sorry he didn't go into so much detail in his original post, but please try to have a little imagination before coming down on him like that.
BTW: "Save As" with a different filename will NOT save the file like you said, but it will copy the unedited original, meaning it still never saved your work.
 
Like I said the other day when you posted this same topic on another forum, I have run your test several times and find I can't replicate it. My system saves the bitmap changes perfectly. ???
 
What system are you running?

Alternate-Click on your Desktop and select New>Bitmap Image
If Paint is not associated w/ *.bmp files, see if the "Edit" menu option appears when Alt-Clicking on the file.
Regardless, just open it with paint.
Draw anything.
Save it and close Paint.
Open the file in Paint again.
Without changing anything, use the selection tool (upper right in the toolbox) to select a blank area.
Hold shift, and drag the selected area over some or all of the black line.
Now select "Save" or "Save As" from the File menu (Make up a name if using Save As) and close Paint
Now open the saved file.
It will still have the entire line.
 
I was able to reproduce reliably the MSPAINT.EXE error you're reporting in WinXP. I did notice that all you have to do is to unselect the box (click anywhere else on the bitmap) to get the changes in the line committed to the saved files. But if you do what you've described and do the save without unselecting, then the line is saved as a whole with no erasures recorded. I wonder if any of the other tools behave similarly.

- Collin
 
Not so about the deselecting bit, I have tested many times.
Unselecting the selected area does not register a change.
The bug will still occur even if you select multiple areas multiple times and save, as long as you do not select another tool.
 
That's interesting. I just tested again. I most definitely do NOT have to select another tool to get the changes recorded. All I have to do is to click on any part of the bitmap then save. In that case the changes are recorded reliably.

It's odd that this behavior would vary from system-to-system in the same OS, isn't it?

- Collin
 
I am using XP Pro, what version are you using?
I have also just tested the deselecting thing on ME just now, still no saving... Even after deselecting the area.
 
What system are you running?

1. Am running XP Pro.
2. I have MSPAINT available through a shortcut on my old 98/98SE/98ME Start menu.
3. I upgraded - did not do a clean install. (That may be significant.)
4. I have tried 4 different bitmapped images with file type BMP, PCX, JPG, and TIF.
5. They all work and save properly as advertised.
 


<< I am using XP Pro, what version are you using?
I have also just tested the deselecting thing on ME just now, still no saving... Even after deselecting the area.
>>



I tested on both WinXP Pro and WinXP HE. Got the same behavior on all of them. Deselecting the area results in proper saving behavior. But saving with the area still selected results in the exact same consequences as you report.

Just as a side note -- all of these machines were just updated early yesterday at the Windows Update site. I added the "Windows Highlighter" applet. (I usually check updates on a couple of test machines instead of installing on all of them, but I'm an old guy with old eyes, and the promise of being able to find off where I left off typing was too much of a temptation.)

It would be interesting to see how much, if any, this behavior can be modified by various GUI settings.

- Collin
 
Back
Top