You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
exception not thrown when truncating filenames longer than 255 char #12076
Interesting, I don't remember us imposing a 255 character limit anywhere. But maybe it's a part of library_fs.js I'm not familiar with? It should be in there or maybe in library_path.js.
edit: Oh, hmm, unless it's a musl limitation and it happens there...
I looked to make a repro yesterday but didn't manage to make one demonstrating opening a file with a path basename longer than 255 characters. I suspected that the truncation happens here within the open: function which is the one I believe is called into through the pal code.
I also thought NAME_MAX was being used, but after grepping through files in this repo, its not obvious to me how the variable contributes to truncation.
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.
Activity
kripken commentedon Aug 31, 2020
Interesting, I don't remember us imposing a 255 character limit anywhere. But maybe it's a part of
library_fs.jsI'm not familiar with? It should be in there or maybe inlibrary_path.js.edit: Oh, hmm, unless it's a musl limitation and it happens there...
akoeplinger commentedon Sep 1, 2020
The limitation probably comes from
emscripten/system/include/libc/limits.h
Line 47 in 2bca083
However it's not clear to me where exactly the truncation happens.
mdh1418 commentedon Sep 1, 2020
I looked to make a repro yesterday but didn't manage to make one demonstrating
opening a file with a path basename longer than 255 characters. I suspected that the truncation happens here within theopen:function which is the one I believe is called into through the pal code.emscripten/src/library_fs.js
Line 1065 in b1a7889
emscripten/src/library_fs.js
Line 1047 in b1a7889
I also thought
NAME_MAXwas being used, but after grepping through files in this repo, its not obvious to me how the variable contributes to truncation.akoeplinger commentedon Sep 1, 2020
hm no, that first library_fs.js just truncated the file contents, not the name.
I think what probably happens is that when we create the inode we don't check for the length before filling this struct:
emscripten/system/lib/fetch/asmfs.cpp
Lines 37 to 38 in b9f357c
akoeplinger commentedon Sep 1, 2020
ah, I just read that asmfs is a work in progress so it's probably not that: #9534 😄
akoeplinger commentedon Sep 1, 2020
so most likely here:
emscripten/src/library_fs.js
Lines 645 to 646 in b1a7889
stale commentedon Sep 3, 2021
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.
akoeplinger commentedon Sep 3, 2021
From what I can see this is still an issue.