Last Comment Bug 116562 - Flash movie is not loaded if disk cache is disabled
: Flash movie is not loaded if disk cache is disabled
Status: VERIFIED FIXED
patch
: regression
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: Trunk
: x86 All
: P3 normal with 2 votes (vote)
: mozilla0.9.9
Assigned To: gordon
: shrirang khanzode
Mentors:
http://www.macromedia.com/
: 89494 95096 116839 117244 117986 123280 123522 123618 123688 123701 123965 126223 126904 127346 127572 129058 130069 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2001-12-22 08:43 PST by Ed Fry
Modified: 2008-04-15 18:29 PDT (History)
35 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch for type of cache (1.08 KB, patch)
2002-02-11 16:05 PST, Sergi
no flags Details | Diff | Splinter Review
patch to return error if storage for policy is not enabled. (886 bytes, patch)
2002-02-14 17:55 PST, gordon
gagan: review+
gordon: superreview+
Details | Diff | Splinter Review

Description Ed Fry 2001-12-22 08:43:52 PST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.7) Gecko/20011221
BuildID:    2001122106

When loading a Page which uses The Macromedia Flash Plugin, The Plugin will not
load the Flash Animation. Right Clicking on the Flash Animation brings up a Menu
which says "Movie Not Loaded", Which is Greyed out.

Reproducible: Always
Steps to Reproduce:
1.Go to page with Flash Content
2.No Flash Content Displayed
3.Right clicking on Blank box where Flash content should be will reveal a menu
which says "Movie Not Loaded"

Actual Results:  No Flash Content Displayed

Expected Results:  Display Flash Content

Flash Animation loads correctly in Version 0.96, upgrading to version 0.97
causes to Problem, uninstalling and reinstalling 0.97 does not fix the problem.
Reinstalling the Flash Plugin with the newest Version doesn't fix the Problem.
Uninstalling and reinstalling 0.96 Does fix the Problem.

This also Occurs with Windows 2000.
Comment 1 Matthias Versen [:Matti] 2001-12-22 10:40:17 PST
wfm with win2k build 20011222..

Comment 2 Lorenzo Colitti 2001-12-23 07:03:02 PST
Happens to me too. Build 2001122106 on WinME.
Comment 3 Lorenzo Colitti 2001-12-23 07:49:43 PST
Confirming on 2001122208 WinME as well. About to try the latest nightly.
Comment 4 Lorenzo Colitti 2001-12-23 09:03:30 PST
Nope, nothing works. Going back to Mozilla 0.9.6 release (2001112009), which
does work on WinME.

Is there anything I can do to help clear this up? It's very annoying...

BTW: Flash version is 5.0 r41
Comment 5 Lorenzo Colitti 2001-12-23 18:17:39 PST
Ok, found it: Flash will not work if the disk cache is disabled.

For Flash to work, the disk cache must be enabled
(Preferences->Networking->Enable disk cache) and the cache size must not be zero
(Preferences->Advanced->Cache->Disk Cache).

I consider this a bug. I do not use a disk cache as I have a fast proxy server.

Reporter, could you change the Summary to "Flash plugin does not work if Disk
Cache disabled" please? I do not have sufficient privileges to do so.

Comment 6 Ed Fry 2001-12-24 17:32:50 PST
Setting the Disk cache to 1kb fixed it on my end.
Comment 7 shrirang khanzode 2001-12-26 11:31:22 PST
does this need to be reassigned to 'networking/cache' ?
Comment 8 av (gone) 2001-12-26 11:40:28 PST
This is a good question, maybe not. Peter, what are we supposed to do if a 
plugin requests a stream as STREAMASFILEONLY and we don't have any local disk 
capabilities? Is it legitimate just to fail? If user disables cache, does it 
mean he wants not to use the disk no matter what?

Maybe we should throw a pop up warning that caching mechanism the plugin relies 
on is disabled and the plugin is not going to work properly.

Changing summary to make it shorter.
Comment 9 Peter Lubczynski 2001-12-26 12:59:26 PST
Plugins are simply agents of the Necko cache, we use the same system. If a user
decides to disable the browser cache, plugins do not (and probably shouldn't)
have the authority to override the user's choice. Therefore, if a plugin
requests STREAMASFILEONLY stream, I think it is legitimate that it can fail
becuase the cache is disabled. It's up to Flash to decide how to handle the
error, and in this case, it simply doesn't load anything. It could be made
smarter, like some other plugins.

An argument can be made that plugins should use their own dedicated cache but
there are other problems with that plus I'm more in favor of recycling what
we've already got. Nominating---->Future
Comment 10 Ed Fry 2001-12-26 18:03:00 PST
Shouldn't STREAMASFILEONLY use the memory cache if a file cache is unavalable? 
My current settings is a 16Meg Memory Cache and a 1K Disk cache (for the 
workaround) and it works fine. of course setting the disk cache to 0k causes 
the problem.

If there has to be a Disk cache for compatibility with plugins, Is there a 
setting or could a setting be made for the disk cache to clear itself after 
the browser is closed? (similar to the "Empty Temporary Internet Files when 
browser is closed" option that Internet Explorer has) Not only would this 
option keep the hard disk cleaner and allow a cache to be avalable for plugins 
like flash, but it increases security on multi user systems as well.
Comment 11 Peter Lubczynski 2001-12-27 08:27:24 PST
No, the way STREAMASFILEONLY works is that we need to pass the plugin a path to
the filesystem. The plugin already does have a way of directly getting the bytes
from the stream without using the disk, but in this case, the plugin is
specifically asking the browser to cache to disk.

Why is the cache a security concern on multi-user systems? The cached files are
loacted with the user's profile in their home directory and security should be
set correct there.

There is one exception where we do not use the Necko cache because it refuses to
do the caching. For HTTPS documents, 4.x honored requests from the plugin to
cache to disk. This is needed for backwords compatibility with Acrobat but I
think updated versions of the plugin for Mozilla don't force writing to disk. In
the case of no cache, we create a folder and use the OS's temp directory. We
also clean up our files when done. 

It's possible we could do the same thing when the cache is disabled?
Comment 12 Olaf 2001-12-28 05:56:25 PST
same with 2001122108 on Linux
Comment 13 Ed Fry 2001-12-28 08:52:34 PST
The Security concern I was talking about was on multi user systems Running 
Windows 98 either under a WinNT domain without Roaming User Profiles or no 
login whatsoever. On Those systems, if one user logs in, it uses the default 
user profile, if that person logs off and someone else logs in, it still using 
the default user profile, as well as the cached files with it.

Of course, under that environment, the History would give much of the locations 
of the last user away.
Comment 14 Ian Flanigan 2001-12-28 13:45:29 PST
*** Bug 117244 has been marked as a duplicate of this bug. ***
Comment 15 Deneb Meketa 2001-12-28 17:24:34 PST
Okay, thanks to Ian, we at Macromedia now know about this problem.  It's 
entered in our own Flash Player bugbase.  Macromedia does not officially 
support Mozilla, but PLEASE let me know if there is going to be a Netscape 
release that will be affected by this, as we would take that seriously.  If we 
know about that in advance, we can bump up the priority of this issue.

I am not personally familiar with the NPAPI (although we have many people here 
who are), so I haven't yet tried to figure out why we're using STREAMASFILEONLY 
or what our alternatives would be - any architectural suggestions appreciated 
(including just "rtfm").
Comment 16 hub-san 2002-01-02 13:28:31 PST
Confirming on BuildID:2002010208 on MacOS9.1-Japanese as well.
Well, I want to add a comment to this bug.  When I uncheck "Enable disk
cache"(Preferences>Debug>Networking), QuickTime plugin doesn't work just like
Flash plugin.  But, MRJ plugin(Java applet) will work if the disk cache is
disabled.  What is the difference between Flash(or QuickTime) and MRJ(Java)? 

QuickTime: http://www.apple.co.jp/quicktime/
Java applet: http://www.hitsuji.to/appletHTML/ColorfulScroll.html
Comment 17 Deneb Meketa 2002-01-02 14:19:10 PST
Hmmm, I have an additional question: is this NEW behavior?  That is, do the 
Flash and Quicktime plug-ins work OK in prior builds of Mozilla (and especially 
Navigator 6.x) with the disk cache setting turned off?  If so, then wouldn't it 
be fair to say that this is a back-compatibility breaker?  Even if the new 
behavior is more correct in some way, is that correctness more important than 
supporting existing plug-ins?
Comment 18 hub-san 2002-01-03 13:12:15 PST
I tested four kinds of plug-in.  MRJ plug-in is installed by the default, when
installing Mozilla.  I have copied Shockwave Flash, Shockwave Director and
QuickTime plug-in from Netscape Communicator 4.7.x plug-ins folder to Mozilla
Plug-ins folder.  The result of Mozilla 0.9.6 and 0.9.7(or latest-trunk) was
compared.  It seems that this bug is regression.  The result was as follows.   
I'm sorry I didn't try Netscape Navigator 6.x.

Mozilla 0.9.6(Enable Disk Cache):
Shockwave Flash, Director, QuickTime and MRJ worked.  It seems all plug-in works
fine.

Mozilla 0.9.6(Disable Disk Cache):
All plug-in that I used worked as well as "Enable Disk Cache".

Mozilla 0.9.7(Enable Disk Cache):
Shockwave Flash, QuickTime and MRJ plug-in worked.  But, Shockwave Director
plug-in did not work.  

Mozilla 0.9.7(Disable Disk Cache):
Only MRJ plug-in worked.  Shockwave Flash, Director and QuickTIme plug-in didn't
work.  

Information of plug-in:
Macromedia Shockwave for Director Netscape plug-in, version 8.5r321
Shockwave Flash 5.0 r41
QuickTIme Plug-in 5.0.2
MRJ Plug-in(Java VM: MRJ 2.2.5)

Test page of Shockwave Flash and Director plug-in:
http://www.macromedia.com/jp/shockwave/welcome/main.html
Comment 19 Maik Amelmann 2002-01-12 14:42:31 PST
Well please bring the old behavior back. 0.9.6 worked perfectly without disc
cache, this is new and doesn't help anybody. i got lots of memory and a slow
hard drive, so i turned disk cache off. :( no flash and no quicktime for me now?
:( i guess a lot of people stare at a blank screen now where the old version
displayed the plugin correctly, and hadn't i found this bugzilla entry i'd still
install and reinstall different mozilla versions. >:(
Comment 20 Aleksey Nogin 2002-01-14 19:41:18 PST
I have exactly the same problem with plugger on Linux - plugger would fail to
work (will not pass an empty file name to the helper app) is disk cache is
disabled. Should we set OS to All, or should I file a separate bug for this?

I am currently running BuildID 2002011021 on RedHat Linux 7.2, plugger 4.0
(4.0-4 RPM from RedHat Rawhide).
Comment 21 Alon Altman 2002-01-26 23:22:41 PST
Confirmed on build 2002012606 on Linux. Changing OS to All.
Comment 22 Peter Lubczynski 2002-01-31 09:43:40 PST
Re-reading the comments, this is a regression between 0.9.6 and 0.9.7. 

..taking bug to investigate why running plugins without a disk cache in 0.9.6
builds worked...

I wish we could go back and pull mozilla builds to find when the regression
happened, but I don't think they go back that far??? However, I think Netscape
Commercial ones DO go back to November:
ftp://sweetlou.mcom.com/products/client/6.x/windows/32bit/x86/
Comment 23 shrirang khanzode 2002-01-31 09:47:53 PST
I will ry to find out when this happened.
Comment 24 shrirang khanzode 2002-02-04 09:13:30 PST
*** Bug 123280 has been marked as a duplicate of this bug. ***
Comment 25 shrirang khanzode 2002-02-05 10:58:02 PST
this broke between the dates 1129 and 1130 ( working on 1129 ..stopeed working 
on 1130). This happened after 6.2.1 was released (11/28).  Will try to get this 
into 0.9.8 release notes.
Comment 26 shrirang khanzode 2002-02-05 12:10:07 PST
*** Bug 123618 has been marked as a duplicate of this bug. ***
Comment 27 shrirang khanzode 2002-02-05 13:24:40 PST
*** Bug 123522 has been marked as a duplicate of this bug. ***
Comment 28 Peter Lubczynski 2002-02-05 13:32:13 PST
Thanks Shrirang, I love Bonsai! 

Okay, I think I may have found the problem. Backing out attachment #58176 [details] [diff] [review] from
bug 110405 fixes Flash running with a disabled disk cache.

Darin/Gordon, can this be returned to an ASSERTION or is there another workaround?
Comment 29 gordon 2002-02-05 14:19:17 PST
Strange.  I presume entry->IsAllowedInMemory() returns FALSE because the entry
has a storage policy of nsICache::STORE_ON_DISK_AS_FILE, so we can pass the file
to the plugin.  What I don't understand is how this could have worked before if
the entry was simply stored in memory.

I'd like to find a better solution than simply changing the condition back to an
assertion.  I'm not familiar with the interaction between plugins and http, however.
Comment 30 Michael Wardle 2002-02-05 16:09:08 PST
*** Bug 123688 has been marked as a duplicate of this bug. ***
Comment 31 shrirang khanzode 2002-02-05 16:34:20 PST
*** Bug 123701 has been marked as a duplicate of this bug. ***
Comment 32 shrirang khanzode 2002-02-06 10:25:04 PST
*** Bug 116839 has been marked as a duplicate of this bug. ***
Comment 33 Peter Lubczynski 2002-02-06 11:23:59 PST
Lots of dups with 0.9.8...

-->over to Gordon, owner of bug 110405.

Comment 34 shrirang khanzode 2002-02-06 14:31:05 PST
*** Bug 123965 has been marked as a duplicate of this bug. ***
Comment 35 shrirang khanzode 2002-02-08 12:13:06 PST
*** Bug 95096 has been marked as a duplicate of this bug. ***
Comment 36 Seth Reagan 2002-02-10 08:43:58 PST
This *does* work with disabling of the cache and here is how I did it. It's weird.

Simply set *both* caches to zero. It's slow as a snail when on a page that uses
flash but it works.

This is on:
win2k
.98 build 20020204
Comment 37 Lorenzo Colitti 2002-02-10 10:21:44 PST
You mean disable the memory cache too? That's not much of a workaround, though...
Comment 38 Michael Coyle 2002-02-10 11:03:49 PST
Back with Netscape 4.7.x, it was believed that you could speed up the browser's
BACK function by setting the disk cache to zero, forced the page to be redrawn
from the memory cache instead. I have no idea whether this was true or not, but
it was tossed about as a solution to speed problems. This is why I first set the
cache to zero when I started using Mozilla at M1.

If I may suggest a solution as an end user and not a coder: You should not be
able to set the cache to zero. Setting it to zero should return some minimum
value. Maybe even a line of text can be added to the preference box stating the
minimum value.

OR if the cache can be set to zero, a dialog should popup stating it can cause
some plugins not to function.

I do not think it's correct to assume a user sets the cache to zero to
deliberately disable plugins.

I offer these suggestions because I want Mozilla 1.0 to KICK ASS! :)

Thanks,
Michael
Comment 39 Joerg Morbitzer 2002-02-10 22:46:27 PST
What about sides with hundres of users, like in Universitys, having their $HOME
on a shared nfs drive. As a system administrator you don't want every user to
have 50 megabyte of cache in nfs-server:/home/<user>/.mozilla/bla/Cache/.
Running squid as a caching server is the only solution - this is why setting the
disk cache to 0 should work!

Kind regards, Joerg.
Comment 40 Darin Fisher 2002-02-11 14:17:32 PST
another solution on such shared systems is to set a users cache directory to
something in /tmp or some equivalent local directory.
Comment 41 Graeme Humphries 2002-02-11 14:37:57 PST
The local/tmp trick only works in a workstation with enough local disk space,
however. This doesn't really resolve the situation in a low space (ie
50MB/machine for boot, nfsmount rest of dir structure) or no space (network card
boot rom) net boot situation. I'd rather see the problem fixed on Mozilla's end
of things, if at all possible.

At the very least, I second the idea that some sort of error dialogue should be
generated if a plugin tries to use STREAMASFILEONLY when disk cache is disabled.
At least then users (and administrators) are aware of the problem and know the
solution immediately. The biggest concern to me right now is that this problem
is easily resolved on the client side, but not easily detectable.

I suppose having a preference option which patches STREAMASFILEONLY to redirect
to the RAM cache is unworkable because of the filesystem i/o involved?
Comment 42 gordon 2002-02-11 15:43:52 PST
Yes, unfortunately the plugin interface expects access to a file, not just a
data stream.
Comment 43 Nicolas Bock 2002-02-11 15:48:18 PST
How does one set the user's cache directory? Is that some setting in prefs.js?
All I found was something along the lines of browser.cache.directory, but that
didn't work.
Comment 44 Darin Fisher 2002-02-11 15:50:04 PST
nicolas: in a recent nightly build, you can set the cache location via the
preferences panel.  (see Preferences->Advanced->Cache)
Comment 45 Nicolas Bock 2002-02-11 15:52:35 PST
How about in release 0.9.8? Is there a way to do that there?
Comment 46 Darin Fisher 2002-02-11 15:57:57 PST
user_pref("browser.cache.disk.parent_directory", "/tmp")

would create a directory called "Cache" for the disk cache in /tmp
Comment 47 Sergi 2002-02-11 16:05:46 PST
Created attachment 68938 [details] [diff] [review]
Patch for type of cache

This patch resolve problem. I just change
    rv = cacheChannel->SetCacheAsFile(PR_TRUE);
to
    rv = cacheChannel->SetCacheAsFile(PR_FALSE);
So, cache policy become STORE_ANYWHERE. This make plugin work with zero cache.
Not sure it's correct. Check it.
Comment 48 Darin Fisher 2002-02-11 16:28:50 PST
ah... looks like plugins have support for SetCacheAsFile failure.

gordon: perhaps we're not returning an error from SetCacheAsFile when the disk
cache is disabled?!?

sergi: that probably isn't the right patch...
Comment 49 gordon 2002-02-11 16:38:42 PST
SetCacheAsFile() is only called from nsPluginHostImpl.cpp and nsDownloader.cpp.
 nsPluginHostImpl appears to only use it as an optimization, so if
SetCacheAsFile(PR_TRUE) could return an error if the disk cache was currently
disabled, the existing code would work fine.

However nsDownloader cancels the download if SetCacheAsFile(PR_TRUE) returns and
error.  Maybe we should open a bug for that?
Comment 50 Sergi 2002-02-11 16:46:45 PST
If SetCacheAsFile() from nsPluginHostImpl will return error for zero disk
cache, nsPluginHostImpl will call SetupPluginCacheFile (and create file
in NS_OS_TEMP_DIR. What the reason for plugins to work with files if memory
cache works?
Comment 51 Darin Fisher 2002-02-11 16:55:34 PST
sergi: some plugins require "/path/to/file" and cannot utilize mozilla's memory
cache.

gordon: yeah, but i think fixing nsDownloader is lower priority.  i believe that
it is currently only used for remote jar files, which are currently not used ;-)
but if you could file a bug (and future it) that would be great!
Comment 52 Nicolas Bock 2002-02-11 17:31:10 PST
Another administrative question: If more than one user sets their
browser.cache.disk.parent_directory to /tmp then only the browser which created
the /tmp/Cache directory will be able to write to it, since it is created 700
and owned the creating browser process. Can I instead specify something like
/tmp/$USER or something of that sort for parent_directory?
Comment 53 Darin Fisher 2002-02-11 17:46:02 PST
i don't think /tmp/$USER will expand as you'd like it to.  not sure of a good
automatic way to achieve similar effect w/o editing each users prefs.js file.
Comment 54 shrirang khanzode 2002-02-14 08:57:42 PST
*** Bug 117986 has been marked as a duplicate of this bug. ***
Comment 55 gordon 2002-02-14 17:55:49 PST
Created attachment 69591 [details] [diff] [review]
patch to return error if storage for policy is not enabled.
Comment 56 gordon 2002-02-18 19:36:18 PST
Comment on attachment 69591 [details] [diff] [review]
patch to return error if storage for policy is not enabled.

sr=darin
Comment 57 Gagan 2002-02-18 19:44:09 PST
Comment on attachment 69591 [details] [diff] [review]
patch to return error if storage for policy is not enabled.

r=gagan
Comment 58 gordon 2002-02-18 22:48:53 PST
Patch checked in.  Marking FIXED.
Comment 59 shrirang khanzode 2002-02-19 09:27:12 PST
Anybody who has stumbled upon this bug..I kindly request you to pls try this fix 
with today's build and comment in the bug only if you think this is *not* 
working. I will verify this too. Thanks!!
Comment 60 Vidar Haarr (not reading bugmail) 2002-02-19 23:20:53 PST
This works for me now :)
Thanks !
Comment 61 Sergi 2002-02-20 10:51:38 PST
Shrir: works for me now.
Comment 62 shrirang khanzode 2002-02-20 11:04:19 PST
verified on all trunk builds 0220 (win/mac/linux).
Comment 63 shrirang khanzode 2002-02-21 09:32:36 PST
*** Bug 126904 has been marked as a duplicate of this bug. ***
Comment 64 R.K.Aa. 2002-02-22 16:10:48 PST
*** Bug 127346 has been marked as a duplicate of this bug. ***
Comment 65 Matthias Versen [:Matti] 2002-02-24 11:42:04 PST
*** Bug 127572 has been marked as a duplicate of this bug. ***
Comment 66 R.K.Aa. 2002-02-27 17:22:30 PST
*** Bug 89494 has been marked as a duplicate of this bug. ***
Comment 67 shrirang khanzode 2002-03-05 10:24:07 PST
*** Bug 129058 has been marked as a duplicate of this bug. ***
Comment 68 Tuukka Tolvanen (sp3000) 2002-03-11 08:54:33 PST
*** Bug 130069 has been marked as a duplicate of this bug. ***
Comment 69 anthonyd 2002-04-30 16:56:58 PDT
*** Bug 126223 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.