
Dreamweaver CS3 crashes with files that are exactly 8KB in size - alxhill
https://forums.adobe.com/thread/417116?start=0&tstart=0#eightkb
======
userbinator
How does this happen? My guess is there is a loop that processes file contents
in 8KB blocks, something like this:

    
    
        bytesRemaining = fileSize;
        while(...) {
            ...
            bytesRemaining -= 8192;
            if(bytesRemaining < 0)
                break;
            ...
        }
        bytesRemaining += 8192;
        ...
        // process remaining bytes
    
    

See the bug? :-)

~~~
derekchiang
If this was the case then any multiple of 8KB should also cause the bug to
happen, but according to OP only exactly 8KB causes the bug.

~~~
JoshCole
The article itself says that multiples do cause the bug.

------
dmix
> caused by the presence of a file that's exactly 8,192 bytes (8KB) or a
> _multiple thereof_

So not simply 8kb as the (current) title states.

~~~
hrrsn
I wonder what %age of crashes are due to that bug?

~~~
r4pha
I suppose Bayes' theorem can help us estimate it:

P(filesize is multiple of 8192 | crashed) = P(crashed | filesize is multiple
of 8192) * P(filesize is multiple of 8192)/P(crashed)

Where:

\- The likelihood of crashing given the filesize is a multiple of 8192 is 1;

\- The naïve prior of the filesize being a multiple of 8192 is 1/8192;

The task is now to estimate the probability P(crashed), which is the
probability the program will crash for whatever reason.

------
vardump
Let me guess. 8192 byte buffer and assumption in code that <=0 [byte count/-1
error] from read() means read error.

Sometimes you will get zero bytes read return values. Like when there really
isn't a byte more to read. So zero bytes available doesn't signal an error.

~~~
icelancer
Yeah. This is a pretty common bug I've seen elsewhere.

------
crazy2be
This was posted on the daily wtf about a month ago:
[http://thedailywtf.com/articles/the-8k-bug](http://thedailywtf.com/articles/the-8k-bug)
Some discussion there:
[http://thedailywtf.com/articles/comments/the-8k-bug](http://thedailywtf.com/articles/comments/the-8k-bug)

Another reminder to always test the edge cases (as though we needed another :)
).

------
chris_wot
I'd love to know what's corrupting their cache. That the response is "delete
the cache and profile" is rather pathetic for an expensive program like
Dreamweaver.

If you want to sell your product as closed source, IMO you should put
something into place to detect corruption, or at least diagnose how it occurs.

Even worse is that this whole article is about workarounds... Unless I'm
mistaken, these seem to be known issues - will Adobe be making fixes? I'm
fairly certain that an 8kb bug should be fixed pretty easily.

------
thomasfoster96
Ah, this takes me back to my Dreamweaver days. I remember when it wouldn't let
me edit a file unless I deleted a certain Dreamweaver configuration file that
wasn't quite working correctly. I'm not sure why Dreamweaver couldn't just
delete the file itself, but it was a real pain having to find the file and
delete it so Dreamweaver could re-generate it again.

------
at-fates-hands
I remember dealing with this when I first started developing. One of my senior
developers thought it had to do with some kind of semicolon thresholds. Mainly
because it more often than not happened in his CSS files. The solution is
easy. Just add another comment and you'll surpass the 8kb size and be fine.

------
jmnicolas
Isn't the current version of Dreamweaver something like CS6 (I think they
abandoned version number since they went with Creative Cloud) ?

~~~
arthurfm
No. The current version of Dreamweaver is CC 2014.1.

[http://www.adobe.com/uk/products/dreamweaver/features.html](http://www.adobe.com/uk/products/dreamweaver/features.html)

~~~
jmnicolas
OK, but my point was that Dreamweaver CS3 is horribly outdated so why do we
speak about this bug ?

Maybe there's something interesting about it, but I fail to see what is so
special about this bug.

~~~
coldtea
The interestingess of a bug is not necessarilly related to the release date of
the program it appears in.

It's interesting as a classic example of an off-by-one bug, one that happens
in seemingly strange conditions (8K multiples), and one that affected a major
product from a big company.

------
scrapcode
I can't find much of anything particularly interesting about this link. Is
there a fix for this bug? Discussion about what causes it? I did a search and
couldn't find anything really useful about this. Maybe a break down of the
troubleshooting involved behind locating this bug, now that'd be interesting.

------
benguild
What could possibly be an explanation for this? Formatting thresholds?

