Friday, September 11, 2020

Re: ncmpcpp dumps core when fetching lyrics

[moving to ports@openbsd.org list]

On 2020-09-11, Ashlen <eurydice@riseup.net> wrote:
> Sorry Stuart, I think I accidentally replied to you directly the first
> time I sent this. I'm still getting used to neomutt.

No problem, for mailing lists you usually want 'group-reply'
(by default this is bound to 'g' in mutt/neomutt).

> On 20/09/11 09:09AM, Stuart Henderson wrote:
>> First thing to look for when there's a core dump is to see if you can
>> get a useful backtrace. How does the output look from this?
>>
>> pkg_add gdb
>> egdb ncmpcpp ncmpcpp.core
>> bt
>>
>> If the lines output from "bt" don't have function names in,
>> rebuild ncmpcpp with "make clean; DEBUG=-g make repackage reinstall"
>> and try again.
>
> Hey, thanks for the prompt reply and for explaining what I needed to
> do. Out of curiosity, why did you want me to install gdb as opposed to
> using the version included in the base system? I did so, yet am unaware
> of the difference between them.

The gdb version in the base system is pretty old and doesn't
work well with newer compilers, especially with C++ software.

> Here's the output from egdb after recompiling:
>
> GNU gdb (GDB) 7.12.1
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-unknown-openbsd6.8".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
><http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
><http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from ncmpcpp...done.
> [New process 190872]
> Core was generated by `ncmpcpp'.
> Program terminated with signal SIGBUS, Bus error.
> #0 _libc_pthread_mutex_unlock (mutexp=<optimized out>) at /usr/src/lib/libc/thread/rthread_mutex.c:246
> 246 /usr/src/lib/libc/thread/rthread_mutex.c: No such file or directory.
> (gdb) bt
> #0 _libc_pthread_mutex_unlock (mutexp=<optimized out>) at /usr/src/lib/libc/thread/rthread_mutex.c:246
> #1 0x000005595695fb27 in std::__1::__libcpp_mutex_unlock (__m=0x55a00cce818)
> at /usr/src/lib/libcxx/include/__threading_support:266
> #2 std::__1::mutex::unlock (this=0x55a00cce818) at /usr/src/lib/libcxx/src/mutex.cpp:45
> #3 0x000005572d3b623d in std::__1::unique_lock<std::__1::mutex>::~unique_lock (this=<optimized out>)
> at /usr/include/c++/v1/__mutex_base:153
> #4 Shared<NC::BasicBuffer<char> >::Resource::~Resource (this=<optimized out>) at ./utility/shared_resource.h:29
> #5 Lyrics::update (this=0x559775d4400) at screens/lyrics.cpp:236
> #6 0x000005572d4137d5 in std::__1::__function::__value_func<void (BaseScreen*)>::operator()(BaseScreen*&&) const (
> this=0x7f7ffffeef80, __args=<optimized out>) at /usr/include/c++/v1/functional:1799
> #7 std::__1::function<void (BaseScreen*)>::operator()(BaseScreen*) const (this=0x7f7ffffeef80, __arg=0x559775d4400)
> at /usr/include/c++/v1/functional:2347
> #8 applyToVisibleWindows(std::__1::function<void (BaseScreen*)>) (f=...) at screens/screen.cpp:135
> #9 0x000005572d4f9848 in Status::trace (update_timer=<optimized out>, update_window_timeout=<optimized out>)
> at status.cpp:233
> #10 0x000005572d46ae33 in Actions::UpdateEnvironment::run (this=0x7f7ffffef348, update_timer=24,
> refresh_window=<optimized out>, mpd_sync=<optimized out>) at actions.cpp:338
> #11 0x000005572d4cf110 in main (argc=<optimized out>, argv=<optimized out>) at ncmpcpp.cpp:217
>
> --
> https://amissing.link
>
>

Yep that's a usable backtrace.

This is likely a bug in ncmpcpp. Not sure if it's the same
thing but I found https://github.com/ncmpcpp/ncmpcpp/issues/394
which referenced https://github.com/ncmpcpp/ncmpcpp/issues/396
so I think the first step is to try a newer version.
Here's a ports diff to update it to git head, it builds OK but
I don't have any mpd setup so no idea how well/if it works.

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/ncmpcpp/Makefile,v
retrieving revision 1.72
diff -u -p -r1.72 Makefile
--- Makefile 12 Jul 2019 20:43:37 -0000 1.72
+++ Makefile 11 Sep 2020 21:07:31 -0000
@@ -5,10 +5,11 @@ BROKEN-hppa = bindings.h:85:4: error: t

COMMENT = ncurses mpd client inspired by ncmpc

-DISTNAME = ncmpcpp-0.8.2
-REVISION = 1
+GH_ACCOUNT = ncmpcpp
+GH_PROJECT = ncmpcpp
+GH_COMMIT = 7ee6de39a1540f87854335d5b226018276ce9ef9

-EXTRACT_SUFX = .tar.bz2
+DISTNAME = ncmpcpp-0.9pre20200803

CATEGORIES = audio

@@ -23,8 +24,6 @@ WANTLIB += boost_thread-mt c crypto curl
WANTLIB += curses nghttp2 pthread ssl ${LIBCXX} tag z
WANTLIB += ${COMPILER_LIBCXX}

-MASTER_SITES = ${HOMEPAGE}stable/
-
LIB_DEPENDS = audio/libmpdclient>=2.4 \
audio/taglib \
converters/libiconv \
@@ -36,7 +35,12 @@ COMPILER = base-clang ports-gcc

FAKE_FLAGS = docdir="${PREFIX}/share/examples/ncmpcpp/"

-CONFIGURE_STYLE = gnu
+CONFIGURE_STYLE = autoreconf
+AUTORECONF = AM_FORCE_VERSION=${AUTOMAKE_VERSION} \
+ AC_FORCE_VERSION=${AUTOCONF_VERSION} \
+ ${WRKSRC}/autogen.sh
+AUTOCONF_VERSION = 2.69
+AUTOMAKE_VERSION = 1.16

CONFIGURE_ARGS = --enable-clock \
--enable-outputs \
Index: distinfo
===================================================================
RCS file: /cvs/ports/audio/ncmpcpp/distinfo,v
retrieving revision 1.24
diff -u -p -r1.24 distinfo
--- distinfo 4 Jul 2018 09:03:41 -0000 1.24
+++ distinfo 11 Sep 2020 21:07:31 -0000
@@ -1,2 +1,2 @@
-SHA256 (ncmpcpp-0.8.2.tar.bz2) = ZQuj6AiWJLetnkzBm8GsYCjtt1I8wRH6FobqRMCSFVQ=
-SIZE (ncmpcpp-0.8.2.tar.bz2) = 465713
+SHA256 (ncmpcpp-0.9pre20200803-7ee6de39.tar.gz) = OSVOuomDKSPMBjJv8eVhkzh18pRHanw4h2K/HAOZUN0=
+SIZE (ncmpcpp-0.9pre20200803-7ee6de39.tar.gz) = 222696
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure 11 Feb 2018 10:37:51 -0000 1.11
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-configure,v 1.11 2018/02/11 10:37:51 dcoppa Exp $
-
-Index: configure
---- configure.orig
-+++ configure
-@@ -19500,7 +19500,7 @@ CPPFLAGS=$boost_thread_save_CPPFLAGS
-
-
-
--LDFLAGS+="$LDFLAGS $BOOST_THREAD_LDFLAGS"
-+LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
- LIBS="$LIBS $BOOST_THREAD_LIBS"
-
- # icu
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_ac 11 Sep 2020 21:07:31 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -95,7 +95,7 @@ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ BOOST_THREAD
+ AC_SUBST(BOOST_THREAD_LDFLAGS)
+ AC_SUBST(BOOST_THREAD_LIBS)
+-LDFLAGS+="$LDFLAGS $BOOST_THREAD_LDFLAGS"
++LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+
+ # icu

No comments:

Post a Comment