Settings

Theme

Dreamweaver CS3 crashes with files that are exactly 8KB in size

forums.adobe.com

105 points by alxhill 11 years ago · 27 comments

Reader

userbinator 11 years ago

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? :-)
  • Diamons 11 years ago

    The power of the almighty equal sign

  • meowface 11 years ago

    Very likely something like this or similar to this.

  • derekchiang 11 years ago

    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.

    • kvirani 11 years ago

      "and is caused by the presence of a file that's exactly 8,192 bytes (8KB) or a multiple thereof."

    • JoshCole 11 years ago

      The article itself says that multiples do cause the bug.

  • jerryr 11 years ago

    Yes. The while statement can't take variable arguments. Also, ellipsis is not a standalone expression. Also, if "fileSize" is exactly 8192 then ellipsis will execute because "bytesRemaining" will equal zero. If your compiler actually compiles ellipsis and "fileSize" is exactly 8192, then something bad will probably happen. Either the undefined behavior of the compiled ellipses or the unexpected negative number will likely cause a crash.

    Edit: I guess that was funnier in my head.

dmix 11 years ago

> 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 11 years ago

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

    • r4pha 11 years ago

      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.

  • kszx 11 years ago

    The current title has an implied if, not an iff.

vardump 11 years ago

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.

crazy2be 11 years ago

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

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

chris_wot 11 years ago

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 11 years ago

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 11 years ago

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 11 years ago

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

  • arthurfm 11 years ago

    No. The current version of Dreamweaver is CC 2014.1.

    http://www.adobe.com/uk/products/dreamweaver/features.html

    • jmnicolas 11 years ago

      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 11 years ago

        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 11 years ago

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 11 years ago

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

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection