Skip to content

fix(ll-init): make the no-arguments check reachable - #2123

Open
chennaji9 wants to merge 1 commit into
OpenAtom-Linyaps:masterfrom
chennaji9:fix/ll-init-empty-args-check
Open

chennaji9 wants to merge 1 commit into
OpenAtom-Linyaps:masterfrom
chennaji9:fix/ll-init-empty-args-check

Conversation

@chennaji9

@chennaji9 chennaji9 commented Sep 30, 2026 •

Copy link
Copy Markdown

What does this PR do?

parse_args() in ll-init appended the terminating nullptr unconditionally:

for (int i = 1; i < argc; ++i) {
    args.emplace_back(argv[i]);
}
args.emplace_back(nullptr);

so running ll-init with no arguments produced {nullptr}, never an empty vector. The if (args.empty()) guards in both callers — delegate_run() ("no arguments provided for delegate run") and run_init() ("no arguments provided") — were unreachable, and execution continued to ::execvp(args[0], ...) with a null file name (undefined behavior).

Return the empty vector when no arguments exist so the existing guards work; the terminating nullptr is only appended for non-empty argument lists.

Validation

  • Both caller sites verified: delegate_run and run_init only touch args[0]/args.data() after the (now reachable) empty check, so the empty vector is safe.
  • ll-init builds cleanly with the change (cmake --build --preset debug --target linglong__ll-init).

@deepin-ci-robot

Copy link
Copy Markdown
Collaborator

Hi @chennaji9. Thanks for your PR.

I'm waiting for a OpenAtom-Linyaps member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/ll-init/src/ll-init.cpp 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
apps/ll-init/src/ll-init.cpp 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

parse_args() always appended the terminating nullptr, so running ll-init without arguments produced {nullptr} instead of an empty vector; the "no arguments provided" branches in both callers were unreachable and execution fell through to execvp with a null file name; return an empty vector when no arguments exist.

Signed-off-by: 陈那几 <2078634206@qq.com>
@chennaji9
chennaji9 force-pushed the fix/ll-init-empty-args-check branch from 1d69e31 to 13988d2 Compare October 13, 2026 05:46
@chennaji9

Copy link
Copy Markdown
Author

@reddevillg 您好,打扰一下~CI 这边仍在等 org 成员的 /ok-to-test 放行(commitlint 问题 10-15 已修复跟进)。方便的话能否帮忙触发一下 CI?绿了之后也恳请帮忙 review、合入,辛苦了,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants