Just rewrote @musllibc's glob() this afternoon (commit coming soon) - long overdue, but a new bug report pushed it forward.
Previously, glob recursed at each path component level, consumed lots of stack, and opened each dir for reading (the big correctness problem).
-
-
Now, at each level of recursion, it consumes a maximal prefix of [escaped-]literal path components, and only opens the resulting dir for reading if there is a remaining non-literal pattern component, recursing into entries that match it.
Show this thread -
strace for something like a/*/b is down from a cascade of open/getdents to a single dir read and flat sequents of stat's. And stack usage is down from up to 4k*n_path_components to flat 4k+epsilon*n_nonliteral_path_components.
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.