Fix stack initialization to correctness of passing argument tests #28
Closed
td1223 wants to merge 6 commits from
user-programs-stdout into user-programs
pull from: user-programs-stdout
merge into: :user-programs
:master
:vm/pagedir-spt-synch
:bad-synch
:vm/merged/pinning-synch
:vm/merged/themis-fix
:vm/merged/ethan-spt-synch
:vm/merged/themis
:vm/virtual-memory/saleh-synch
:vm/virtual-memory/themis-synch
:vm/shared-ro-executables/gleb
:vm/virtual-memory/frame-synch/saleh
:vm/mmap-write-back-on-eviction
:vm/virtual-memory/saleh
:vm/frame-pinning
:vm/shared-read-only-executables
:vm/page-swap-synch
:vm/stack-growth/saleh
:vm/memory-mapped-files
:vm/page-swap
:virtual-memory
:ethan-stack-growth
:vm/supplemental-page-table
:vm/lazy-loading
:vm/frame-table
:handle-unchecked-malloc-thread
:system-calls-fd-hashing
:task2/refactoring/saleh
:remove-filesys-ci
:themis/userprog-multi-oom
:system-calls
:task2/system-calls/saleh
:userprog-syn-write
:rox-check-fix
:user-memory
:userprog-merge
:userprog-stack-init
:task1/themis/priority-scheduling
:ethan-BSD
:task1/saleh/priority-scheduling
:gleb/BSD
:task1/priority-scheduling
No Reviewers
Labels
No items
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
cyclane (Gleb Koval)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Imperial-MEng/pintos_22#28
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fix stack initialization to pass stack addreses (rather than thread addresses) for the arguments and only pass name a single time
assigned to @gk1623
Lets extract
15to a constant (avoiding magic numbers)?Or perhaps at least
sizeof (file_name)to get the array size (since it's a direct array type)?Is this required?
Why are we keeping track of
argvat all, when during all the time that we use its value, it is equal toif_.esp?Agreed, Perhaps: FILE_NAME_LENGTH_MAX or FILE_NAME_MAX?
then yes in strlcpy I would also use sizeof.
I also agree with the comment to move the file naming to process_execute. So the other strlcpy line is to be moved there. Would still use sizeof though.
We must print the exit status as per the spec. But if you mean if it is required here, I agree with you that it is not, and should be instead left to
process_exit. See the other merge request.When I have a chance, I will also have a look at the process file, but maybe this will be after I am done with syscalls. So without reading the code, overall, try to extract logic into static functions, e.g., setting up the args, or lifting into the other functions when relevant.
sorry forgot that's now how
sizeofworks 😅 . I think I prefer just having the constant everywhere, wby?(otherwise we need to "assume" that char = byte, or have the rather ugly
sizeof (file_name) / sizeof (file_name[0]))Yeah that's very ugly. I think constant everywhere is the best approach too.
Pull request closed