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

thread 'main' panicked at 'cannot remove a char from the end of a string', /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b #1

Open
sydamr opened this issue Feb 12, 2022 · 7 comments

Comments

@sydamr
Copy link

sydamr commented Feb 12, 2022

Distro : Gentoo x86_64
Display server : Xorg
I'm using rust-bin
run it with command rinse

$ rinse
thread 'main' panicked at 'cannot remove a char from the end of a string', /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/alloc/src/string.rs:1263:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Then tried to run it with RUST_BACKTRACE=1

$ RUST_BACKTRACE=1 rinse
thread 'main' panicked at 'cannot remove a char from the end of a string', /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/alloc/src/string.rs:1263:21
stack backtrace:
   0: rust_begin_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
   2: core::panicking::panic
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:48:5
   3: rinse::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Then with RUST_BACKTRACE=full

$ RUST_BACKTRACE=full rinse
thread 'main' panicked at 'cannot remove a char from the end of a string', /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/alloc/src/string.rs:1263:21
stack backtrace:
   0:     0x55675bf5701c - std::backtrace_rs::backtrace::libunwind::trace::h09f7e4e089375279
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55675bf5701c - std::backtrace_rs::backtrace::trace_unsynchronized::h1ec96f1c7087094e
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55675bf5701c - std::sys_common::backtrace::_print_fmt::h317b71fc9a5cf964
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x55675bf5701c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he3555b48e7dfe7f0
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x55675bf7d96c - core::fmt::write::h513b07ca38f4fb1b
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/fmt/mod.rs:1149:17
   5:     0x55675bf51c45 - std::io::Write::write_fmt::haf8c932b52111354
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/io/mod.rs:1697:15
   6:     0x55675bf58c40 - std::sys_common::backtrace::_print::h195c38364780a303
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x55675bf58c40 - std::sys_common::backtrace::print::hc09dfdea923b6730
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x55675bf58c40 - std::panicking::default_hook::{{closure}}::hb2e38ec0d91046a3
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:211:50
   9:     0x55675bf587f5 - std::panicking::default_hook::h60284635b0ad54a8
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:228:9
  10:     0x55675bf592f4 - std::panicking::rust_panic_with_hook::ha677a669fb275654
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:606:17
  11:     0x55675bf58da2 - std::panicking::begin_panic_handler::{{closure}}::h976246fb95d93c31
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:500:13
  12:     0x55675bf574c4 - std::sys_common::backtrace::__rust_end_short_backtrace::h38077ee5b7b9f99a
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:139:18
  13:     0x55675bf58d39 - rust_begin_unwind
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
  14:     0x55675bc540a1 - core::panicking::panic_fmt::h35f3a62252ba0fd2
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
  15:     0x55675bc53fed - core::panicking::panic::h86fc01e270142a61
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:48:5
  16:     0x55675bc6a105 - rinse::main::ha8ab3ebca52aceb1
  17:     0x55675bc6ada3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd69929a874fab548
  18:     0x55675bc75299 - std::rt::lang_start::{{closure}}::hf44fe1e471dd6c55
  19:     0x55675bf56cab - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h7e688d7cdfeb7e00
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/ops/function.rs:259:13
  20:     0x55675bf56cab - std::panicking::try::do_call::h4be824d2350b44c9
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:406:40
  21:     0x55675bf56cab - std::panicking::try::h0a6fc7affbe5088d
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:370:19
  22:     0x55675bf56cab - std::panic::catch_unwind::h22c320f732ec805e
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panic.rs:133:14
  23:     0x55675bf56cab - std::rt::lang_start_internal::{{closure}}::hd38309c108fe679d
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/rt.rs:128:48
  24:     0x55675bf56cab - std::panicking::try::do_call::h8fcaf501f097a28e
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:406:40
  25:     0x55675bf56cab - std::panicking::try::h20e906825f98acc1
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:370:19
  26:     0x55675bf56cab - std::panic::catch_unwind::h8c5234dc632124ef
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panic.rs:133:14
  27:     0x55675bf56cab - std::rt::lang_start_internal::hc4dd8cd3ec4518c2
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/rt.rs:128:20
  28:     0x55675bc6a8a2 - main
  29:     0x7fd342acc7ed - __libc_start_main
  30:     0x55675bc5484a - _start
  31:                0x0 - <unknown>
@PureArtistry
Copy link
Owner

PureArtistry commented Feb 12, 2022

I think I know what part of my code it's failing on (not sure about why though)

Could you paste the line from your mpd.conf that sets your music directory please, that is the string that is being manipulated when it crashes (or just upload your entire mpd.conf, you'll probably have to change the extension to .txt)

thanks!

@sydamr
Copy link
Author

sydamr commented Feb 12, 2022

there's not many lines in my mpd.conf. Here

####### MPD CONFIG #######

# Required files
db_file            "~/.config/mpd/database"
log_file           "~/.config/mpd/log"

# Optional
music_directory    "~/music"
playlist_directory "~/.config/mpd/playlists"
pid_file           "~/.config/mpd/pid"
state_file         "~/.config/mpd/state"
sticker_file       "~/.config/mpd/sticker.sql"

audio_output {
        type            "pulse"
        name            "pulse audio"
}

audio_output {  
type               "fifo"  
name               "toggle_visualizer"
path               "/tmp/mpd.fifo"
format             "44100:16:2"
}

####### END MPD CONFIG #######

@PureArtistry
Copy link
Owner

could you test this latest version please and let me know if it solves the problem, pretty sure it should (fingers crossed)

Thanks!

@sydamr
Copy link
Author

sydamr commented Feb 13, 2022

Using it with keybinding work perfectly but it doesn't show song art cover.
Running it in terminal sometimes it work, but a lots of time it doesn't.

$ rinse
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
rinse: /var/tmp/portage/x11-libs/libX11-1.7.3/work/libX11-1.7.3/src/xcb_io.c:269: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
[1]    31848 IOT instruction  rinse

So the only way to run it is from keybinding.
Thanks for this awesome project, I'm looking foward to it!

@PureArtistry
Copy link
Owner

PureArtistry commented Feb 13, 2022

First off, massive thanks for doing this testing and giving me these reports, big help, I'll have to find a way to get you on the contributors list at some point.

the missing album art, currently it gets the art by searching for a file called cover.{jpg, jpeg, png} in the folder that contains the file you are playing/selecting - that is how I have my collection setup.
How do you store the album art? in a file with a different name? embedded into the song file itself?
making that work will be easy, just need to know what other setups I have to account for.

as for the other error, Im guessing there is a dependency for the ui lib I'm using that you might not have installed.
could you give me a list of all your installed xcb libs please (equery list "*xcb*" or however you do it on your setup)

@sydamr
Copy link
Author

sydamr commented Feb 13, 2022

I download music from youtube music using yt-dlp with thumbnail and metadata embed to it. So yeah I embedded the album art to the song itself with command

 yt-dlp -f 'ba' -x --audio-format mp3 $link --embed-thumbnail --embed-metadata  --ppa "EmbedThumbnail+ffmpeg_o:-c:v mjpeg -vf crop=\"'if(gt(ih,iw),iw,ih)':'if(gt(iw,ih),ih,iw)'\""
$ equery list "*xcb*"
 * Searching for *xcb* ...
[IP-] [  ] x11-base/xcb-proto-1.14.1:0
[IP-] [  ] x11-libs/libxcb-1.14:0/1.12
[IP-] [  ] x11-libs/xcb-util-0.4.0-r2:0
[IP-] [  ] x11-libs/xcb-util-cursor-0.1.3-r3:0
[IP-] [  ] x11-libs/xcb-util-image-0.4.0-r2:0
[IP-] [  ] x11-libs/xcb-util-keysyms-0.4.0-r2:0
[IP-] [  ] x11-libs/xcb-util-renderutil-0.3.9-r3:0
[IP-] [  ] x11-libs/xcb-util-wm-0.4.1-r3:0
[IP-] [  ] x11-libs/xcb-util-xrm-1.3-r1:0
[IP-] [  ] x11-misc/xcb-2.4-r1:0

There're not many USE flags for those but here

[ebuild   R    ] x11-misc/xcb-2.4-r1::gentoo  USE="-motif" 0 KiB
[ebuild   R    ] x11-base/xcb-proto-1.14.1::gentoo  ABI_X86="32 (64) (-x32)" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB
[ebuild   R    ] x11-libs/libxcb-1.14:0/1.12::gentoo  USE="xkb -doc (-selinux) -test" ABI_X86="32 (64) (-x32)" 0 KiB
[ebuild   R    ] x11-libs/xcb-util-renderutil-0.3.9-r3::gentoo  ABI_X86="(64) -32 (-x32)" 287 KiB
[ebuild   R    ] x11-libs/xcb-util-keysyms-0.4.0-r2::gentoo  ABI_X86="(64) -32 (-x32)" 284 KiB
[ebuild   R    ] x11-libs/xcb-util-wm-0.4.1-r3::gentoo  ABI_X86="(64) -32 (-x32)" 315 KiB
[ebuild   R    ] x11-libs/xcb-util-0.4.0-r2::gentoo  ABI_X86="(64) -32 (-x32)" 291 KiB
[ebuild   R    ] x11-libs/xcb-util-image-0.4.0-r2::gentoo  ABI_X86="(64) -32 (-x32)" 321 KiB
[ebuild   R    ] x11-libs/xcb-util-xrm-1.3-r1::gentoo  ABI_X86="(64) -32 (-x32)" 0 KiB
[ebuild   R    ] x11-libs/xcb-util-cursor-0.1.3-r3::gentoo  ABI_X86="(64) -32 (-x32)" 289 KiB

@PureArtistry
Copy link
Owner

Cheers, I'll look into it later on tonight

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

2 participants