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

BUG: expected a thumb tag at 0xacf9 but found another data tag #96

Open
geonnave opened this issue May 2, 2023 · 0 comments
Open

BUG: expected a thumb tag at 0xacf9 but found another data tag #96

geonnave opened this issue May 2, 2023 · 0 comments

Comments

@geonnave
Copy link

geonnave commented May 2, 2023

I am running call-stack towards a cortex-m4 target that uses a few cryptographic libraries (my repo is edhoc-rs).

When I run it, I get several warnings and then an error telling that it is a bug. Here are the relevant logs:

$ cd examples/edhoc-rs-no_std  # and then manually disable features I do not want enabled

$ cargo call-stack --target="thumbv7em-none-eabihf" --features="rust-psa, rtt" --bin edhoc-rs-no_std

  (... compilation logs ...)

[2023-05-02T09:57:33Z WARN  cargo_call_stack] no type information for `verify_header`
[2023-05-02T09:57:33Z WARN  cargo_call_stack] no type information for `verify_chain`

  (... truncated ...)

[2023-05-02T09:57:33Z WARN  cargo_call_stack] no type information for `mbedtls_sha512_update`
[2023-05-02T09:57:33Z WARN  cargo_call_stack] no type information for `mbedtls_sha512_finish`
[2023-05-02T09:57:33Z WARN  cargo_call_stack] no type information for `mbedtls_sha512`
[2023-05-02T09:57:33Z WARN  cargo_call_stack] assuming that asm!("bkpt #0xab") does *not* use the stack in `rust_begin_unwind`
[2023-05-02T09:57:33Z WARN  cargo_call_stack] assuming that asm!("push {r4, lr}\0Asub sp, sp, #16\0Aadd r4, sp, #8\0Astr r4, [sp]\0Abl __udivmoddi4\0Aldr r2, [sp, #8]\0Aldr r3, [sp, #12]\0Aadd sp, sp, #16\0Apop {r4, pc}") does *not* use the stack in `__aeabi_uldivmod`
[2023-05-02T09:57:33Z WARN  cargo_call_stack] assuming that asm!("bkpt #0xab") does *not* use the stack in `_ZN15edhoc_rs_no_std18__cortex_m_rt_main17h19cb218f62f79732E`
[2023-05-02T09:57:33Z WARN  cargo_call_stack] assuming that asm!("bkpt #0xab") does *not* use the stack in `_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_str17he7c9fdd55c30b43cE`
[2023-05-02T09:57:33Z WARN  cargo_call_stack] assuming that asm!("bkpt #0xab") does *not* use the stack in `_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h63faa3907ef7263bE`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `verify_chain`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `buffer_alloc_free`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] `buffer_alloc_free` performs an indirect function call and there's no type information about the operation
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `buffer_alloc_calloc`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] `buffer_alloc_calloc` performs an indirect function call and there's no type information about the operation
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `mbedtls_memory_buffer_alloc_init`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] `mbedtls_calloc` performs an indirect function call and there's no type information about the operation
[2023-05-02T09:57:34Z WARN  cargo_call_stack] `mbedtls_free` performs an indirect function call and there's no type information about the operation
[2023-05-02T09:57:34Z WARN  cargo_call_stack] `mbedtls_platform_zeroize` performs an indirect function call and there's no type information about the operation
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `psa_start_key_creation.constprop.0`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `psa_key_algorithm_permits`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `psa_get_and_lock_key_slot_with_policy.part.0`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `psa_cipher_setup`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `psa_verify_internal.part.0`
[2023-05-02T09:57:34Z WARN  cargo_call_stack] no stack usage information for `psa_validate_optional_attributes`
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `Data`,
 right: `Thumb`: BUG: expected a thumb tag at     0x71ed but found another data tag', /home/gfedrech/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-call-stack-0.1.15/src/thumb.rs:60:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

And also another set of logs when I compile it using a different crypto backend (cryptocell instead of psa)

$ cd examples/edhoc-rs-no_std  # and then manually disable features I do not want enabled

$ cargo call-stack --target="thumbv7em-none-eabihf" --features="rust-cryptocell310, rtt" --bin edhoc-rs-no_std

  (... compilation logs ...)

[2023-05-02T10:02:21Z WARN  cargo_call_stack] no type information for `hashUpdate`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] no type information for `CRYS_HASH_Init`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] no type information for `CRYS_HASH_Update`

  (... truncated ... )

[2023-05-02T10:02:21Z WARN  cargo_call_stack] no type information for `SaSi_HalMaskInterrupt`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] no type information for `SaSi_HalWaitInterrupt`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] no type information for `SaSi_PalPowerSaveModeSelect`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] assuming that asm!("bkpt #0xab") does *not* use the stack in `_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h63faa3907ef7263bE`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] assuming that asm!("bkpt #0xab") does *not* use the stack in `_ZN15edhoc_rs_no_std18__cortex_m_rt_main17h7519564f6efe4eb5E`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] assuming that asm!("bkpt #0xab") does *not* use the stack in `_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_str17he7c9fdd55c30b43cE`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] assuming that asm!("bkpt #0xab") does *not* use the stack in `rust_begin_unwind`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] no stack usage information for `hashUpdate`
[2023-05-02T10:02:21Z WARN  cargo_call_stack] `hashUpdate` performs an indirect function call and there's no type information about the operation
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `Data`,
 right: `Thumb`: BUG: expected a thumb tag at     0x5fad but found another data tag', /home/gfedrech/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-call-stack-0.1.15/src/thumb.rs:60:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Also, in both cases, I updated the workspace's Cargo.toml to have lto = 'fat' in the release profile.

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

No branches or pull requests

1 participant