-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require('fs').stat mangling argument #8361
Comments
Can you provide a minimal, standalone test case? 'Standalone' in this context means core modules only, no third-party modules like express or request. If that is not an option, can you close this issue and open one over at https://github.com/nodejs/help/issues? Thanks. |
Certainly, I will try to get to that today. Thanks. |
Check this out. Run tester.js Let me know how I can help. Thanks. |
@cbaron When I executed this with Node.js v6.5.0, on Darwin Kernel 15.6.0, I got
Is this expected? |
Yes, I think that is expected. What is happening on my machine, is that sometimes, the file requested is not returned, but in fact another file's data is returned in the response because the Note the last two lines on STDOUT
The I ran it just now, and see the following:
Note that the debug.js.gz is requested, its size is 53243, but only 1514 bytes are read ( The number of bytes in the .css.gz file. On my machine, sometimes, but not every time, the http response sends back the wrong file. For example, Do you see that? I appreciate the involvement. I hope we can come to some conclusion here. I hope I am not wasting your time. |
@thefourtheye, @bnoordhuis -- what say you? Do you want more proof that something is potentially wrong ? |
At least an update?!? I'm trying to write an application on the bleeding edge.. |
I don't have time to look at this right now. If you think this is a node.js bug, you will either have to investigate yourself or get another contributor to look at it. |
@thefourtheye, or @mscdex, will you help me track down this bug? I don't understand how its not apparent that it is a bonafide nodejs bug. |
ping @thefourtheye, or @mscdex, can you at least confirm this is a bug ? |
@cbaron The problem is that you're missing a comma after the |
@mscdex, much appreciated. Perhaps you think little of my skills, but please let me know if I can be of help to you in the future. I owe you one. |
Version: v6.1.0, v6.5.0
Platform: Darwin ${mymacbook}.local 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64
Subsystem: fs
The repo is here : https://github.com/cbaron/Enterprise
It is a web application. The static file server I wrote is having an issue with the latest node. The
app.js
,router.js
, andlib/MyObject.js
files are of concern. Sometimes, everything works fine, other times, it seems that the closure in my code is not being respected as I will try to illustrate below. I would be happy to work through this issue if you do not have enough information.this.P
refers to the function ->this.FS
refers to require('fs')The
request
argument is an http request, theresponse
is the response object, andpath
is information that pertains to a file on the local system. You can simply pointfilePath
point to a local file on your system.The issue is occurring when my web page requests 3 static files at the same time.
When it works correctly, I get the following STDOUT
When it doesn't =>
Note that the
filePath
variable in thestatic
function is not being closed properly. It seems something is happening to that literal inrequire('fs').stat
.Let me know how I can help!
The text was updated successfully, but these errors were encountered: