Giter VIP home page Giter VIP logo

Comments (4)

MabezDev avatar MabezDev commented on June 19, 2024 1

Apologies, I discovered this hasn't actually been fixed but forgot to re-open this! Issue is being tracking in esp-rs/rust#136, sorry!

from esp-idf-hal.

MabezDev avatar MabezDev commented on June 19, 2024

Thanks for the small example! I've managed to reproduce it, with a panic message and full backtrace:

f32 literal is=16
Converting the number seems to work
thread 'main' panicked at 'assertion failed: buf[0] > b\'0\'', /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/num/flt2dec/mod.rs:189:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
abort() was called at PC 0x4201cf4a on core 0
0x4201cf4a - panic_abort::__rust_start_panic::abort
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/panic_abort/src/lib.rs:43
Backtrace:0x40375a92:0x3fcf45c00x40378a25:0x3fcf45e0 0x4037de02:0x3fcf4600 0x4201cf4a:0x3fcf4670 0x4201cf3e:0x3fcf4690 0x4200d9fd:0x3fcf46b0 0x4200d961:0x3fcf4730 0x42017717:0x3fcf47a0 0x42017545:0x3fcf47d0 0x4200d7a9:0x3fcf4800 0x42026644:0x3fcf4830 0x420265ab:0x3fcf4870 0x4202afc0:0x3fcf48b0 0x4202b0ac:0x3fcf48d0 0x420299af:0x3fcf4950 0x42029c8c:0x3fcf49d0 0x4202a0ac:0x3fcf49f0 0x42019664:0x3fcf4a40 0x42019488:0x3fcf4a90 0x420195df:0x3fcf4ad0 0x42002d55:0x3fcf4b50 0x4203fe5f:0x3fcf4ba0 0x42002d80:0x3fcf4bc0 0x420057d9:0x3fcf4be0 0x42002d71:0x3fcf4c00 0x42002e13:0x3fcf4c30 0x420410e0:0x3fcf4c50 
0x40375a92 - panic_abort
    at /home/mabez/development/c/esp-idf/components/esp_system/panic.c:402
0x40378a25 - esp_system_abort
    at /home/mabez/development/c/esp-idf/components/esp_system/esp_system.c:128
0x4037de02 - abort
    at /home/mabez/development/c/esp-idf/components/newlib/abort.c:46
0x4201cf4a - panic_abort::__rust_start_panic::abort
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/panic_abort/src/lib.rs:43
0x4201cf3e - __rust_start_panic
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/panic_abort/src/lib.rs:38
0x4200d9fd - rust_panic
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/panicking.rs:746
0x4200d961 - std::panicking::rust_panic_with_hook
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/panicking.rs:716
0x42017717 - std::panicking::begin_panic_handler::{{closure}}
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/panicking.rs:??
0x42017545 - std::sys_common::backtrace::__rust_end_short_backtrace
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:138
0x4200d7a9 - rust_begin_unwind
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/panicking.rs:584
0x42026644 - core::panicking::panic_fmt
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/panicking.rs:142
0x420265ab - core::panicking::panic
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/panicking.rs:48
0x4202afc0 - core::num::flt2dec::digits_to_dec_str
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/num/flt2dec/mod.rs:??
0x4202b0ac - core::num::flt2dec::to_shortest_str
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/num/flt2dec/mod.rs:398
0x420299af - core::fmt::float::float_to_decimal_common_shortest
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/fmt/float.rs:66
0x42029c8c - core::fmt::float::float_to_decimal_display
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/fmt/float.rs:??
0x4202a0ac - core::fmt::write
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/fmt/mod.rs:1196
0x42019664 - std::io::Write::write_fmt
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/io/mod.rs:1654
0x42019488 - <&std::io::stdio::Stdout as std::io::Write>::write_fmt
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/io/stdio.rs:712
0x420195df - <std::io::stdio::Stdout as std::io::Write>::write_fmt
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/io/stdio.rs:686
0x42002d55 - esp_float_crash::main
    at /home/mabez/development/rust/embedded/experiments/esp-float-crash/src/main.rs:13
0x4203fe5f - core::ops::function::FnOnce::call_once
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/ops/function.rs:248
0x42002d80 - std::rt::lang_start::{{closure}}
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/rt.rs:145
0x420057d9 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
    at /home/mabez/development/rust/xtensa/rust-xtensa-dev/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/core/src/ops/function.rs:280
0x42002d71 - main
    at ??:??
0x42002e13 - app_main
    at /home/mabez/.cargo/registry/src/github.com-1ecc6299db9ec823/esp-idf-sys-0.31.7/src/start.rs:46
0x420410e0 - main_task
    at /home/mabez/development/c/esp-idf/components/freertos/port/port_common.c:141

Seems the assert is failing here. I'll try and figure out what's going on.

from esp-idf-hal.

MabezDev avatar MabezDev commented on June 19, 2024

I found a few issues with the Rust Xtensa ABI implementation, which have been fixed in the new 1.63.0.1 release. I believe this fixes the issue here. You can find a prerelease here: https://github.com/esp-rs/rust-build/releases/tag/v1.63.0.1

Closing for now, please ping this thread again if it doesn't fix the issue for you :)

from esp-idf-hal.

usbalbin avatar usbalbin commented on June 19, 2024

Now I am getting this seemingly at random in another project:

thread '<unnamed>' panicked at 'assertion failed: buf[0] > b\'0\'', /home/albin/.rustup/toolchains/esp/lib/ru
stlib/src/rust/library/core/src/num/flt2dec/mod.rs:189:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
abort() was called at PC 0x42028f3e [_ZN11panic_abort18__rust_start_panic5abort17h177b9ee7c03cc387E:??:??] on
 core 0
Backtrace:0x40375c8a [panic_abort:/home/albin/ceph/rust/dcdc-converter/.embuild/espressif/esp-idf/release-v4.
4/components/esp_system/panic.c:402]:0x3fced5400x4037b659 [esp_system_abort:/home/albin/ceph/rust/dcdc-conver
ter/.embuild/espressif/esp-idf/release-v4.4/components/esp_system/esp_system.c:128]:0x3fced560 0x40381c2a [ab
ort:/home/albin/ceph/rust/dcdc-converter/.embuild/espressif/esp-idf/release-v4.4/components/newlib/abort.c:46
]:0x3fced580 0x42028f3e [_ZN11panic_abort18__rust_start_panic5abort17h177b9ee7c03cc387E:??:??]:0x3fced5f0 0x4
2028f32 [__rust_start_panic:??:??]:0x3fced610 0x4201b145 [rust_panic:??:??]:0x3fced630 0x4201b0a9 [_ZN3std9pa
nicking20rust_panic_with_hook17hb89405c732f83e50E:??:??]:0x3fced6b0 0x4202546b [_ZN3std9panicking19begin_pani
c_handler28_$u7b$$u7b$closure$u7d$$u7d$17h7f506a8d33fa63e4E:??:??]:0x3fced720 0x42025299 [_ZN3std10sys_common
9backtrace26__rust_end_short_backtrace17h3d53297afbaf5aa5E:??:??]:0x3fced750 0x4201aef1 [rust_begin_unwind:??
:??]:0x3fced780 0x4203353c [_ZN4core9panicking9panic_fmt17h276ede2116b4f4beE:??:??]:0x3fced7b0 0x420334a3 [_Z
N4core9panicking5panic17h63673a252d46609bE:??:??]:0x3fced7f0 0x42038668 [_ZN4core3num7flt2dec17digits_to_dec_
str17h879d9007659e2605E:??:??]:0x3fced830 0x42038754 [_ZN4core3num7flt2dec15to_shortest_str17hc23f6418c16e767
dE:??:??]:0x3fced850 0x42036f03 [_ZN4core3fmt5float32float_to_decimal_common_shortest17hf2ab7cb578e71bb9E.llv
m.13186556124017172358:??:??]:0x3fced8d0 0x420371e0 [_ZN4core3fmt5float52_$LT$impl$u20$core..fmt..Display$u20
$for$u20$f32$GT$3fmt17hda1d22a0d4d97892E:??:??]:0x3fced950 0x4203762c [_ZN4core3fmt5write17hda45f5da99590714E
:??:??]:0x3fced970 0x420273cc [_ZN3std2io5Write9write_fmt17h0289dd8e57306a1cE:??:??]:0x3fced9c0 0x420271f0 [_
ZN61_$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$9write_fmt17h6c080d2f8f694b56E:??:??]:0x3fce
da10 0x42027347 [_ZN3std2io5stdio6_print17haf1444b0d0539906E:??:??]:0x3fceda50 0x4200477f [_ZN12dc_converter7
handler17h784339f99a8760dbE:??:??]:0x3fcedad0 0x42004f73 [_ZN12dc_converter4main28_$u7b$$u7b$closure$u7d$$u7d
$17h85d68c4e989eeed5E.llvm.1139724781367824989:??:??]:0x3fcedc10 0x4200cfe2 [_ZN86_$LT$alloc..boxed..Box$LT$F
$C$A$GT$$u20$as$u20$core..ops..function..Fn$LT$Args$GT$$GT$4call17hae554cb11fd57bd3E:??:??]:0x3fcedc60 0x4200
cfe2 [_ZN86_$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..Fn$LT$Args$GT$$GT$4call17hae55
4cb11fd57bd3E:??:??]:0x3fcedca0 0x42009971 [_ZN11esp_idf_svc5httpd6Server6handle17h9990288062c7aa47E:??:??]:0
x3fcedce0 0x4205caea [httpd_uri:/home/albin/ceph/rust/dcdc-converter/.embuild/espressif/esp-idf/release-v4.4/
components/esp_http_server/src/httpd_uri.c:329]:0x3fcedf60 0x4205bc34 [httpd_parse_req:/home/albin/ceph/rust/
dcdc-converter/.embuild/espressif/esp-idf/release-v4.4/components/esp_http_server/src/httpd_parse.c:659]:0x3f
cedfa0 0x4205c1be [httpd_sess_process:/home/albin/ceph/rust/dcdc-converter/.embuild/espressif/esp-idf/release
-v4.4/components/esp_http_server/src/httpd_sess.c:412]:0x3fcee050 0x4205af18 [httpd_process_session:/home/alb
in/ceph/rust/dcdc-converter/.embuild/espressif/esp-idf/release-v4.4/components/esp_http_server/src/httpd_main
.c:178]:0x3fcee070 0x420a1fae [httpd_sess_enum:/home/albin/ceph/rust/dcdc-converter/.embuild/espressif/esp-id
f/release-v4.4/components/esp_http_server/src/httpd_sess.c:50]:0x3fcee090 0x4205b01f [httpd_server:/home/albi
n/ceph/rust/dcdc-converter/.embuild/espressif/esp-idf/release-v4.4/components/esp_http_server/src/httpd_main.
c:228]:0x3fcee0b0 
ELF file SHA256: 0000000000000000
Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403759b4 [esp_restart_noos:/home/albin/ceph/rust/dcdc-converter/.embuild/espressif/esp-idf/release
-v4.4/components/esp_system/port/soc/esp32s3/system_internal.c:143]

Have not managed to find out much yet...

from esp-idf-hal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.