Skip to content
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

ostree admin kargs edit-in-place assertion reached when deployments are pending #2679

Closed
travier opened this issue Jul 25, 2022 · 8 comments · Fixed by #2695
Closed

ostree admin kargs edit-in-place assertion reached when deployments are pending #2679

travier opened this issue Jul 25, 2022 · 8 comments · Fixed by #2695
Assignees
Labels

Comments

@travier
Copy link
Member

travier commented Jul 25, 2022

See #2664:

Jul 25 13:57:17 fedora ostree-sysroot-readonly[2417]: + ostree admin kargs edit-in-place --append-if-missing=rw
Jul 25 13:57:17 fedora audit[2427]: ANOM_ABEND auid=4294967295 uid=0 gid=0 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 pid=2427 comm="ostree" exe="/usr/bin/ostree" sig=6 res=1
Jul 25 13:57:17 fedora ostree-sysroot-readonly[2427]: **
Jul 25 13:57:17 fedora ostree-sysroot-readonly[2427]: OSTree:ERROR:src/libostree/ostree-sysroot-deploy.c:3618:ostree_sysroot_deployment_set_kargs_in_place: assertion failed: (!ostree_deployment_is_staged (deployment))
Jul 25 13:57:17 fedora ostree-sysroot-readonly[2427]: Bail out! OSTree:ERROR:src/libostree/ostree-sysroot-deploy.c:3618:ostree_sysroot_deployment_set_kargs_in_place: assertion failed: (!ostree_deployment_is_staged (deployment))
Jul 25 13:57:17 fedora systemd[1]: Created slice system-systemd\x2dcoredump.slice - Slice /system/systemd-coredump.
Jul 25 13:57:17 fedora audit: BPF prog-id=131 op=LOAD
Jul 25 13:57:17 fedora audit: BPF prog-id=132 op=LOAD
Jul 25 13:57:17 fedora audit: BPF prog-id=133 op=LOAD
Jul 25 13:57:17 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@0-2428-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=>
Jul 25 13:57:17 fedora systemd[1]: Started [email protected] - Process Core Dump (PID 2428/UID 0).
Jul 25 13:57:17 fedora [2430]: [164B blob data]
Jul 25 13:57:17 fedora systemd-coredump[2429]: [🡕] Process 2427 (ostree) of user 0 dumped core.
                                               
                                               Module linux-vdso.so.1 with build-id 539b6f5c64df6de29594035a5c6820a79cbe1e44
                                               Module libcrypt.so.2 with build-id 9924d3a82ca8fa6b94bc574a6520bcf84ccf831f
                                               Stack trace of thread 2427:
                                               #0  0x00007fccfb34dc4c __pthread_kill_implementation (libc.so.6 + 0x8ec4c)
                                               #1  0x00007fccfb2fd9c6 raise (libc.so.6 + 0x3e9c6)
                                               #2  0x00007fccfb2e77f4 abort (libc.so.6 + 0x287f4)
                                               #3  0x00007fccfb5ced18 g_assertion_message.cold (libglib-2.0.so.0 + 0x1ed18)
                                               #4  0x00007fccfb62ebae g_assertion_message_expr (libglib-2.0.so.0 + 0x7ebae)
                                               #5  0x00007fccfb9a856d ostree_sysroot_deployment_set_kargs_in_place (libostree-1.so.1 + 0x8256d)
                                               #6  0x0000556a2e4d7e08 ot_admin_kargs_builtin_edit_in_place (ostree + 0x32e08)
                                               #7  0x0000556a2e4d4f47 ot_admin_builtin_kargs (ostree + 0x2ff47)
                                               #8  0x0000556a2e4cd540 ostree_builtin_admin (ostree + 0x28540)
                                               #9  0x0000556a2e4c0ad3 main (ostree + 0x1bad3)
                                               #10 0x00007fccfb2e8550 __libc_start_call_main (libc.so.6 + 0x29550)
                                               #11 0x00007fccfb2e8609 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x29609)
                                               #12 0x0000556a2e4c0d75 _start (ostree + 0x1bd75)
                                               ELF object binary architecture: AMD x86-64
@travier
Copy link
Member Author

travier commented Jul 25, 2022

This is lower priority as this should not happen in the currently planned use case but it would be great to not have ostree crash and exit cleanly instead.

@HuijingHei
Copy link
Collaborator

Thanks @travier for your report! Maybe should skip pending deployments? (https://github.com/ostreedev/ostree/blob/main/src/libostree/ostree-sysroot-deploy.c#L3618)

@travier
Copy link
Member Author

travier commented Jul 25, 2022

I'd say yes, skip pending deployments

@travier
Copy link
Member Author

travier commented Jul 25, 2022

A warning should be enough

@cgwalters
Copy link
Member

I had to actually go look at the code for this, but it's worth noting that staged deployments today capture override kargs. So in theory, we should also apply edits to those I think.

For example, let's try e.g.:

$ rpm-ostree kargs --append=foo=bar
$ ostree admin kargs edit-in-place --append-if-missing=rw

The desired behavior is to have both i.e. foo=bar rw right?

@cgwalters
Copy link
Member

Implementing this will require deserializing the staged deployment (see _ostree_sysroot_reload_staged) modifying its kargs member, then reserializing it (see the serialization bits in ostree_sysroot_stage_tree_with_options).

@HuijingHei
Copy link
Collaborator

Thanks @cgwalters and @travier for the suggestion, will do this when I finish my handy task

@travier
Copy link
Member Author

travier commented Jul 26, 2022

Indeed, make sense to apply to the pending deployment too.

@HuijingHei HuijingHei self-assigned this Aug 16, 2022
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 19, 2022
deployments are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=rw
```
After reboot we get both `foo=bar rw`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 19, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=rw
```
After reboot we get both `foo=bar rw`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 19, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=rw
```
After reboot we get both `foo=bar rw`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 22, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=rw
```
After reboot we get both `foo=bar rw`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 22, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=rw
```
After reboot we get both `foo=bar rw`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 22, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=rw
```
After reboot we get both `foo=bar rw`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 25, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=foobar
```
After reboot we get both `foo=bar foobar`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 25, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=foobar
```
After reboot we get both `foo=bar foobar`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 25, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=foobar
```
After reboot we get both `foo=bar foobar`.

Fix ostreedev#2679
HuijingHei added a commit to HuijingHei/ostree that referenced this issue Aug 29, 2022
are pending

This is to support pending deployments instead of rasing assertion.
For example:
```
$ sudo rpm-ostree kargs --append=foo=bar
$ sudo ostree admin kargs edit-in-place --append-if-missing=foobar
```
After reboot we get both `foo=bar foobar`.

Fix ostreedev#2679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants