Skip to content

Conversation

@Databean
Copy link
Member

SplitRamdiskModules called many functions that returned Results, and is only called within a CF_EXPECT invocation. This means it can forward errors out to its caller as a Result, rather than use CHECKs or conditionals on the Results it calls.

Tested with

$ bazel run //cuttlefish/package:cvd -- fetch --default_build=git_main/aosp_cf_x86_64_only_phone-trunk_staging-userdebug --target_directory=$HOME/dl_kernel --kernel_build=aosp_kernel-common-android-mainline/kernel_virt_x86_64
$ bazel run //cuttlefish/package:cvd -- create --host_path=$HOME/dl_kernel --product_path=$HOME/dl_kernel --host_substitutions=bin/assemble_cvd,bin/run_cvd

Bug: b/464082938

`SplitRamdiskModules` called many functions that returned `Result`s, and
is only called within a `CF_EXPECT` invocation. This means it can
forward errors out to its caller as a `Result`, rather than use `CHECK`s
or conditionals on the `Result`s it calls.

Tested with
```
$ bazel run //cuttlefish/package:cvd -- fetch --default_build=git_main/aosp_cf_x86_64_only_phone-trunk_staging-userdebug --target_directory=$HOME/dl_kernel --kernel_build=aosp_kernel-common-android-mainline/kernel_virt_x86_64
$ bazel run //cuttlefish/package:cvd -- create --host_path=$HOME/dl_kernel --product_path=$HOME/dl_kernel --host_substitutions=bin/assemble_cvd,bin/run_cvd
```

Bug: b/464082938
Databean added a commit to Databean/android-cuttlefish that referenced this pull request Nov 27, 2025
While writing google#1850 I
ran into an issue that the compiler didn't check return type mismatches
between the same function, leading to segfaults at runtime.

Including the header makes the functions explicitly conflict.

Bug: b/464088042
@Databean Databean added the kokoro:run Run e2e tests. label Nov 27, 2025
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Nov 27, 2025
@Databean
Copy link
Member Author

Thanks for reviewing!

@Databean Databean added this pull request to the merge queue Nov 27, 2025
Merged via the queue into google:main with commit 4f02e03 Nov 27, 2025
22 checks passed
Databean added a commit to Databean/android-cuttlefish that referenced this pull request Dec 1, 2025
While writing google#1850 I
ran into an issue that the compiler didn't check return type mismatches
between the same function, leading to segfaults at runtime.

Including the header makes the functions explicitly conflict.

Bug: b/464088042
github-merge-queue bot pushed a commit that referenced this pull request Dec 9, 2025
While writing #1850 I
ran into an issue that the compiler didn't check return type mismatches
between the same function, leading to segfaults at runtime.

Including the header makes the functions explicitly conflict.

Bug: b/464088042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants