-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix iptux stackoverflow when receiving dir #656
Conversation
Reviewer's Guide by SourceryThis pull request addresses a stack overflow issue caused by the recursive invocation of the 'g_mkdir' macro within the 'AnalogFS::mkdir' method. The solution involves renaming and updating the directory creation method from 'mkdir' to 'makeDir' to prevent self-referential calls in both the implementation and its usage. Updated Class Diagram for AnalogFS (Renaming mkdir to makeDir)classDiagram
class AnalogFS {
+int open(const char* fn, int flags)
+int open(const char* fn, int flags, mode_t mode)
+int stat(const char* fn, struct ::stat* st)
+int makeDir(const char* dir, mode_t mode)
+int64_t ftwsize(const char* dir)
+DIR* opendir(const char* dir)
}
note for AnalogFS "Renamed mkdir to makeDir to avoid recursive macro call causing stack overflow"
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @lidaobing - I've reviewed your changes - here's some feedback:
Overall Comments:
- Ensure all calls to the directory creation function have been updated to use makeDir to avoid inadvertent calls to the macro-expanded g_mkdir.
- Double-check that the interface change from mkdir to makeDir does not break any expected usage in the filesystem abstraction layer.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #656 +/- ##
==========================================
+ Coverage 52.47% 52.48% +0.01%
==========================================
Files 64 64
Lines 8558 8558
==========================================
+ Hits 4491 4492 +1
+ Misses 4067 4066 -1 ☔ View full report in Codecov by Sentry. |
/close #472
g_mkdir
is macro define tomkidr
, so when we call g_mkdir inAnalogFS::mkdir
, it will call itself. cause stackoverflow.Summary by Sourcery
Bug Fixes:
mkdir
recursively.