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

Bootupd: thread 'main' panicked at src/bios.rs:116:62 #739

Closed
TheGreatDeadOne opened this issue Oct 1, 2024 · 5 comments · Fixed by #740
Closed

Bootupd: thread 'main' panicked at src/bios.rs:116:62 #739

TheGreatDeadOne opened this issue Oct 1, 2024 · 5 comments · Fixed by #740

Comments

@TheGreatDeadOne
Copy link

TheGreatDeadOne commented Oct 1, 2024

Describe the bug
After updating bootupd, this bug appeared when trying to check the status of bootupd.

To Reproduce
Please describe the steps needed to reproduce the bug:

  1. Update the system
  2. Reboot
  3. view bootupd status (or update)

Screenshots

Captura de tela de 2024-10-01 04-30-57

OS version:

State: idle
BootedDeployment:
● fedora:fedora/rawhide/x86_64/silverblue
                  Version: Rawhide.20240930.n.0 (2024-09-30T06:07:39Z)
                   Commit: d44afe119fb862868666a1829781e2a1888497d4c0189186e290289cc35c369d
             GPGSignature: Valid signature by B0F4950458F69E1150C6C5EDC8AC4916105EF944

Additional context
I ran it with RUST_BACKTRACE=full, but I didn't get any more information.

/boot/bootupd-state.json content:

{
  "installed": {
    "EFI": {
      "meta": {
        "timestamp": "2024-08-08T12:14:11Z",
        "version": "grub2-efi-ia32-1:2.12-4.fc41.x86_64,grub2-efi-x64-1:2.12-4.fc41.x86_64,shim-ia32-15.8-3.x86_64,shim-x64-15.8-3.x86_64"
      },
      "filetree": {
        "children": {
          "BOOT/BOOTIA32.EFI": {
            "size": 747681,
            "sha512": "sha512:6d4396f289400516b883733f0fd3621e7ec4d70afd02e988651f37db81298775da69c04b998d87a4760b2fa4b96130c70eb0875fad1cf290c52ea606ae40d12e"
          },
          "BOOT/BOOTX64.EFI": {
            "size": 949424,
            "sha512": "sha512:cc23d8c3cb2dcf749075268b77eb796fb430182cbbc04171ded14d43e32b4a5cdeeb1a08666ee0e288bd37d63f657a9af5e7f2012dd70694d11212d705c60b42"
          },
          "BOOT/fbia32.efi": {
            "size": 70360,
            "sha512": "sha512:c3e94b8d6f07ec9c88b66d48e5b887d29288dd1c9914bf8226af7656e35a023c07a6dbf8a2875994485c348ca358591e02a8eb19574299db3ffb6486697a1568"
          },
          "BOOT/fbx64.efi": {
            "size": 87816,
            "sha512": "sha512:d6107afdaebab6c6f3a9136334b54aeba089a8b40d53f38c74c791dca1274b9d6a02d744a634938516cedfa96a67cb0cff6a59c5537b36faf3c70e3bcee622af"
          },
          "fedora/BOOTIA32.CSV": {
            "size": 112,
            "sha512": "sha512:53a8ec886d24c049ee27f2377de3f02951d537171be1ab8d11459453f094e60ff3667c2b7608581392283643b7864008b7cc4d1cdac6a3ebcab3d0d7d410d9e1"
          },
          "fedora/BOOTX64.CSV": {
            "size": 110,
            "sha512": "sha512:0c29b8ae73171ef683ba690069c1bae711e130a084a81169af33a83dfbae4e07d909c2482dbe89a96ab26e171f17c53f1de8cb13d558bc1535412ff8accf253f"
          },
          "fedora/grubia32.efi": {
            "size": 3022144,
            "sha512": "sha512:a81b24b44fdd646d036e963e54dcc76b9465798209f02c89b4cf528966ecd72dbcac78f733b3fd177f0f48091b7605a48eaff0663768ea72b962e123065a2b88"
          },
          "fedora/grubx64.efi": {
            "size": 4066624,
            "sha512": "sha512:2981b7fe1c22969605104bab9ae6f45696c81412b0c08afb78827bc96dc8b53279661b4b9926679e864a7427bbf183169538aa78d3c29eafcc7468ffd70aa721"
          },
          "fedora/mmia32.efi": {
            "size": 673992,
            "sha512": "sha512:cd2cd82de67d2176d212fbe99caa6ef621f971b0f49f1fe7430dd1d4f1bf822fe8f87fcbf5a23512dbb8a9c90c75d5e2ff0e8f910954c62749ef35237e48720a"
          },
          "fedora/mmx64.efi": {
            "size": 848080,
            "sha512": "sha512:d62e003cae3321b3b0aea35c27868176a867b06a1a1eb3266efe84f72f01db6ce71c36073afc192500385743b5eb3d1f35519729b51d0326cebb1e3a04b24281"
          },
          "fedora/shim.efi": {
            "size": 949424,
            "sha512": "sha512:cc23d8c3cb2dcf749075268b77eb796fb430182cbbc04171ded14d43e32b4a5cdeeb1a08666ee0e288bd37d63f657a9af5e7f2012dd70694d11212d705c60b42"
          },
          "fedora/shimia32.efi": {
            "size": 747681,
            "sha512": "sha512:6d4396f289400516b883733f0fd3621e7ec4d70afd02e988651f37db81298775da69c04b998d87a4760b2fa4b96130c70eb0875fad1cf290c52ea606ae40d12e"
          },
          "fedora/shimx64.efi": {
            "size": 949424,
            "sha512": "sha512:cc23d8c3cb2dcf749075268b77eb796fb430182cbbc04171ded14d43e32b4a5cdeeb1a08666ee0e288bd37d63f657a9af5e7f2012dd70694d11212d705c60b42"
          }
        }
      },
      "adopted-from": null
    }
  },
  "pending": null,
  "static-configs": {
    "timestamp": "2024-07-20T08:17:30Z",
    "version": "bootupd-0.2.20-2.fc41.x86_64"
  }
}
@travier
Copy link
Member

travier commented Oct 1, 2024

Can you try the workaround from #738 to get a backtrace?

@TheGreatDeadOne
Copy link
Author

Here the backtrace:

Running as unit: bootupd.service
thread 'main' panicked at src/bios.rs:116:62:
JSON was not well-formatted: Error("invalid type: null, expected a string", line: 5, column: 23)
stack backtrace:
   0:     0x55f766b385a5 - <unknown>
   1:     0x55f766b602db - <unknown>
   2:     0x55f766b354af - <unknown>
   3:     0x55f766b39921 - <unknown>
   4:     0x55f766b395fc - <unknown>
   5:     0x55f766b39f81 - <unknown>
   6:     0x55f766b39de7 - <unknown>
   7:     0x55f766b38a69 - <unknown>
   8:     0x55f766b39a74 - <unknown>
   9:     0x55f7669699c3 - <unknown>
  10:     0x55f766969e36 - <unknown>
  11:     0x55f7669a9b61 - <unknown>
  12:     0x55f7669ae31e - <unknown>
  13:     0x55f7669aff25 - <unknown>
  14:     0x55f7669c6f6a - <unknown>
  15:     0x55f766978a66 - <unknown>
  16:     0x55f766978a5c - <unknown>
  17:     0x55f766b2de20 - <unknown>
  18:     0x55f7669dbd17 - <unknown>
  19:     0x7ff7326121c8 - __libc_start_call_main
  20:     0x7ff73261228b - __libc_start_main@GLIBC_2.2.5
  21:     0x55f76696a135 - <unknown>
  22:                0x0 - <unknown>


@travier
Copy link
Member

travier commented Oct 2, 2024

With debuginfo installed:

Running as unit: bootupd.service
thread 'main' panicked at src/bios.rs:116:62:
JSON was not well-formatted: Error("invalid type: null, expected a string", line: 5, column: 23)
stack backtrace:
   0:     0x558387fb95a5 - std::backtrace_rs::backtrace::libunwind::trace::h5c85e557799ed486
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x558387fb95a5 - std::backtrace_rs::backtrace::trace_unsynchronized::ha97b107185df65bb
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x558387fb95a5 - std::sys::backtrace::_print_fmt::h490acf9e9b8c6eb2
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/sys/backtrace.rs:65:5
   3:     0x558387fb95a5 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h9c32407e5a23c650
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/sys/backtrace.rs:40:26
   4:     0x558387fe12db - core::fmt::rt::Argument::fmt::hae324c745842212e
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/fmt/rt.rs:173:76
   5:     0x558387fe12db - core::fmt::write::h8e3a6cb8df1f9a95
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/fmt/mod.rs:1182:21
   6:     0x558387fb64af - std::io::Write::write_fmt::h83bcab37323a9399
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/io/mod.rs:1827:15
   7:     0x558387fba921 - std::sys::backtrace::BacktraceLock::print::hd3c35caa6032e632
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/sys/backtrace.rs:43:9
   8:     0x558387fba921 - std::panicking::default_hook::{{closure}}::hd3c6083514eb2656
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:269:22
   9:     0x558387fba5fc - std::panicking::default_hook::h94d20e9291e6eb42
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:296:9
  10:     0x558387fbaf81 - std::panicking::rust_panic_with_hook::hfa25182080856bef
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:800:13
  11:     0x558387fbade7 - std::panicking::begin_panic_handler::{{closure}}::h2fc3fd5367175cd3
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:674:13
  12:     0x558387fb9a69 - std::sys::backtrace::__rust_end_short_backtrace::h877093daaa72bd28
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/sys/backtrace.rs:168:18
  13:     0x558387fbaa74 - rust_begin_unwind
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:665:5
  14:     0x558387dea9c3 - core::panicking::panic_fmt::hfc4c464a0d356173
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/panicking.rs:74:14
  15:     0x558387deae36 - core::result::unwrap_failed::hed0c5a840d13d6d8
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/result.rs:1679:5
  16:     0x558387e2ab61 - core::result::Result<T,E>::expect::h4a278a4ffd3b9b1e
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/result.rs:1059:23
  17:     0x558387e2ab61 - bootupd::bios::Bios::get_bios_boot_partition::hf80eb676ef158f7d
                               at /usr/src/debug/rust-bootupd-0.2.23-1.fc42.x86_64/src/bios.rs:116:32
  18:     0x558387e2ab61 - <bootupd::bios::Bios as bootupd::component::Component>::query_adopt::hbd7f47bf2d2f2ae6
                               at /usr/src/debug/rust-bootupd-0.2.23-1.fc42.x86_64/src/bios.rs:168:44
  19:     0x558387e2f31e - bootupd::bootupd::status::h783212648de06519
                               at /usr/src/debug/rust-bootupd-0.2.23-1.fc42.x86_64/src/bootupd.rs:311:34
  20:     0x558387e30f25 - bootupd::cli::bootupctl::CtlCommand::run_status::h47ffd5fa37e76902
                               at /usr/src/debug/rust-bootupd-0.2.23-1.fc42.x86_64/src/cli/bootupctl.rs:104:17
  21:     0x558387e30f25 - bootupd::cli::bootupctl::CtlCommand::run::haabf88ed246e99ee
                               at /usr/src/debug/rust-bootupd-0.2.23-1.fc42.x86_64/src/cli/bootupctl.rs:88:38
  22:     0x558387e47f6a - bootupd::cli::MultiCall::run::h3adeb0582e24cec0
                               at /usr/src/debug/rust-bootupd-0.2.23-1.fc42.x86_64/src/cli/mod.rs:36:40
  23:     0x558387e47f6a - bootupd::run_cli::h3ec10f62211d0c8e
                               at /usr/src/debug/rust-bootupd-0.2.23-1.fc42.x86_64/src/main.rs:68:11
  24:     0x558387e47f6a - bootupd::main::h830863b943d342cd
                               at /usr/src/debug/rust-bootupd-0.2.23-1.fc42.x86_64/src/main.rs:48:21
  25:     0x558387df9a66 - core::ops::function::FnOnce::call_once::h68b4f28c0539a3ac
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/ops/function.rs:250:5
  26:     0x558387df9a66 - std::sys::backtrace::__rust_begin_short_backtrace::hf41b97841f8e69eb
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/sys/backtrace.rs:152:18
  27:     0x558387df9a5c - std::rt::lang_start::{{closure}}::hf108393cddc23daf
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/rt.rs:162:18
  28:     0x558387faee20 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h90440e1dec31addc
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/ops/function.rs:284:13
  29:     0x558387faee20 - std::panicking::try::do_call::h864c0af700b810b6
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:557:40
  30:     0x558387faee20 - std::panicking::try::h81dc1c4c7a744be2
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:521:19
  31:     0x558387faee20 - std::panic::catch_unwind::hce4947710c9959a6
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panic.rs:350:14
  32:     0x558387faee20 - std::rt::lang_start_internal::{{closure}}::hb8ca788eb716154b
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/rt.rs:141:48
  33:     0x558387faee20 - std::panicking::try::do_call::hbe20672d94e23c41
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:557:40
  34:     0x558387faee20 - std::panicking::try::h08906107fe8c4aae
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panicking.rs:521:19
  35:     0x558387faee20 - std::panic::catch_unwind::h20cf014a4ed35f8b
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/panic.rs:350:14
  36:     0x558387faee20 - std::rt::lang_start_internal::he74de233149dbe8b
                               at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/rt.rs:141:20
  37:     0x558387e5cd17 - main
  38:     0x7f680a6121c8 - __libc_start_call_main
  39:     0x7f680a61228b - __libc_start_main@GLIBC_2.2.5
  40:     0x558387deb135 - _start
  41:                0x0 - <unknown>

@travier
Copy link
Member

travier commented Oct 2, 2024

Reproduced on Silverblue Rawhide.20240930.n.0, UEFI only (does not happen with in a BIOS only VM).

@travier
Copy link
Member

travier commented Oct 2, 2024

Looks like pttype can be null but we dont account for that case:

pttype: String,

lsblk --json --output PATH,PTTYPE,PARTTYPENAME
{
   "blockdevices": [
      {
         "path": "/dev/sr0",
         "pttype": null,
         "parttypename": null
      },{
         "path": "/dev/zram0",
         "pttype": null,
         "parttypename": null
      },{
         "path": "/dev/vda",
         "pttype": "gpt",
         "parttypename": null
      },{
         "path": "/dev/vda1",
         "pttype": "gpt",
         "parttypename": "EFI System"
      },{
         "path": "/dev/vda2",
         "pttype": "gpt",
         "parttypename": "Linux extended boot"
      },{
         "path": "/dev/vda3",
         "pttype": "gpt",
         "parttypename": "Linux filesystem"
      },{
         "path": "/dev/mapper/luks-df2d5f95-5725-44dd-83e1-81bc4cdc49b8",
         "pttype": null,
         "parttypename": null
      }
   ]
}

travier added a commit to travier/bootupd that referenced this issue Oct 2, 2024
zram, sr0 (CD/DVD) and LUKS devices generally don't use partitions, thus
don't have a partition table and don't have a partition type so this
field may be null.

Fixes: coreos#739
cgwalters pushed a commit to travier/bootupd that referenced this issue Oct 2, 2024
zram, sr0 (CD/DVD) and LUKS devices generally don't use partitions, thus
don't have a partition table and don't have a partition type so this
field may be null.

Fixes: coreos#739
Signed-off-by: Colin Walters <[email protected]>
travier added a commit to travier/bootupd that referenced this issue Oct 4, 2024
zram, sr0 (CD/DVD) and LUKS devices generally don't use partitions, thus
don't have a partition table and thus don't have a partition table type
so this field may be null.

Fixes: coreos#739
Signed-off-by: Colin Walters <[email protected]>
travier added a commit to travier/bootupd that referenced this issue Oct 4, 2024
zram, sr0 (CD/DVD) and LUKS devices generally don't use partitions, thus
don't have a partition table and thus don't have a partition table type
so this field may be null.

Fixes: coreos#739
Signed-off-by: Colin Walters <[email protected]>
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 a pull request may close this issue.

2 participants