Solène Rapenne <sol...@bsd.zplay.eu> writes:

> Hello,

Hi,

> I installed x11/wmpinboard on -current and when starting it I get
> a segfault.
> Running it with ktrace give me those last lines (after a long config
> file text which seems a config file)
>
>  26310 wmpinboard RET   read 7070/0x1b9e
>  26310 wmpinboard CALL  read(4,0x1d050a086000,0x4000)
>  26310 wmpinboard RET   read 0
>  26310 wmpinboard CALL  munmap(0x1d0512e58000,0x8a000)
>  26310 wmpinboard RET   munmap 0
>  26310 wmpinboard CALL  close(4)
>  26310 wmpinboard RET   close 0
>  26310 wmpinboard CALL  kbind(0x7f7fffff9178,0x18,0x9f98b8154dba4c3e)
>  26310 wmpinboard RET   kbind 0
>  26310 wmpinboard CALL  kbind(0x7f7fffff9008,0x18,0x9f98b8154dba4c3e)
>  26310 wmpinboard RET   kbind 0
>  26310 wmpinboard CALL  kbind(0x7f7fffff8fc8,0x18,0x9f98b8154dba4c3e)
>  26310 wmpinboard RET   kbind 0
>  26310 wmpinboard CALL  kbind(0x7f7fffff8fc8,0x18,0x9f98b8154dba4c3e)
>  26310 wmpinboard RET   kbind 0
>  26310 wmpinboard CALL  kbind(0x7f7fffff9178,0x18,0x9f98b8154dba4c3e)
>  26310 wmpinboard RET   kbind 0
>  26310 wmpinboard CALL  kbind(0x7f7fffff9178,0x18,0x9f98b8154dba4c3e)
>  26310 wmpinboard RET   kbind 0
>  26310 wmpinboard CALL  kbind(0x7f7fffff9178,0x18,0x9f98b8154dba4c3e)
>  26310 wmpinboard RET   kbind 0
>  26310 wmpinboard PSIG  SIGSEGV SIG_DFL code SEGV_MAPERR<1>
> addr=0x1d0500000000 trapno=6
>  26310 wmpinboard NAMI  "wmpinboard.core"
>
> Running it with gdb and typing bt display the following (i am not
> familiar with gdb)
>
> (gdb) bt
> #0  0x00001475af12a1a3 in _XIMCountVaList () from
> /usr/X11R6/lib/libX11.so.16.1
> #1  0x00001475af12a6f5 in XCreateIC () from
> /usr/X11R6/lib/libX11.so.16.1
> #2  0x0000147370d0fc40 in ?? () from /usr/local/bin/wmpinboard
> #3  0x0000147370d0e46f in ?? () from /usr/local/bin/wmpinboard
> #4  0x0000147370d04c51 in ?? () from /usr/local/bin/wmpinboard
> #5  0x0000000000000000 in ?? ()

Thanks for your report.  While it can be inferred from the data you show
above, please state the architecture you're using next time. ;)

Note that with most ports you can get a better backtrace by reinstalling
a package in the following way:

  make clean repackage reinstall DEBUG=-g

Here I can get:
(gdb) bt
#0  0x00000732dcfeb1a3 in _XIMCountVaList () from /usr/X11R6/lib/libX11.so.16.1
#1  0x00000732dcfeb6f5 in XCreateIC () from /usr/X11R6/lib/libX11.so.16.1
#2  0x0000073062e0fc40 in init_xlocale () at 
/usr/obj/pobj/wmpinboard-1.0/wmpinboard-1.0/src/xmisc.c:260
#3  0x0000073062e0e46f in main (argc=1, argv=0x7f7ffffe8288) at 
/usr/obj/pobj/wmpinboard-1.0/wmpinboard-1.0/src/wmpinboard.c:2124

The build log shows this:

cc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/X11R6/include    -O2 -pipe -g -Wall 
-ansi -pedantic -c xmisc.c
In file included from /usr/X11R6/include/X11/Xlib.h:47,
from xmisc.c:16:
/usr/X11R6/include/X11/Xfuncproto.h:159:24: warning: ISO C does not permit 
named variadic macros
xmisc.c: In function 'init_xlocale':
xmisc.c:207: warning: missing sentinel in function call
xmisc.c:261: warning: missing sentinel in function call
xmisc.c: In function 'cb_copy':
xmisc.c:301: warning: pointer targets in passing argument 1 of 'strncpy' differ 
in signedness

The following patch addresses those warnings.  wmpinboard starts
reliably here on -current/amd64.  Can you confirm that wmpinboard works
for you with that patch applied?

Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/wmpinboard/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile    16 Feb 2015 22:57:14 -0000      1.20
+++ Makefile    18 Mar 2016 12:32:54 -0000
@@ -3,7 +3,7 @@
 COMMENT=               wm-dockapp; resembling a miniature pin board
 
 DISTNAME=              wmpinboard-1.0
-REVISION=              0
+REVISION=              1
 CATEGORIES=            x11 x11/windowmaker
 
 # GPL
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/x11/wmpinboard/patches/patch-configure,v
retrieving revision 1.2
diff -u -p -r1.2 patch-configure
--- patches/patch-configure     25 Dec 2002 11:16:27 -0000      1.2
+++ patches/patch-configure     18 Mar 2016 12:32:54 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-configure,v 1.2 2002/12/25 11:16:27 wilfried Exp $
 --- configure.orig     Thu Apr 13 15:37:26 2000
-+++ configure  Wed Dec 25 12:04:12 2002
-@@ -1034,9 +1034,6 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAG
++++ configure  Fri Mar 18 13:17:58 2016
+@@ -1034,9 +1034,6 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac
  ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS 
conftest.$ac_ext $LIBS 1>&5'
  cross_compiling=$ac_cv_prog_cc_cross
  
Index: patches/patch-configure_in
===================================================================
RCS file: /cvs/ports/x11/wmpinboard/patches/patch-configure_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-configure_in
--- patches/patch-configure_in  25 Dec 2002 11:16:27 -0000      1.2
+++ patches/patch-configure_in  18 Mar 2016 12:32:54 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-configure_in,v 1.2 2002/12/25 11:16:27 wilfried Exp $
 --- configure.in.orig  Thu Apr 13 14:40:33 2000
-+++ configure.in       Wed Dec 25 12:03:38 2002
-@@ -10,9 +10,6 @@ CFLAGS=`echo "x $CFLAGS"|sed 's/^x //; s
++++ configure.in       Fri Mar 18 13:17:56 2016
+@@ -10,9 +10,6 @@ CFLAGS=`echo "x $CFLAGS"|sed 's/^x //; s/\(^\| \)-g\($
  AC_ISC_POSIX
  AC_LANG_C
  
Index: patches/patch-src_xmisc_c
===================================================================
RCS file: patches/patch-src_xmisc_c
diff -N patches/patch-src_xmisc_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_xmisc_c   18 Mar 2016 12:32:54 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+--- src/xmisc.c.orig   Sun Mar 19 12:40:26 2000
++++ src/xmisc.c        Fri Mar 18 13:31:29 2016
+@@ -204,7 +204,7 @@ init_xlocale(void)
+     return;
+   }
+ 
+-  if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, 0) || !xim_styles) {
++  if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, (void *)NULL) || 
!xim_styles) {
+     XCloseIM(xim);
+ #ifdef DEBUG_IC
+     fprintf(stderr, "Input method doesn't support any style.\n");
+@@ -258,7 +258,7 @@ init_xlocale(void)
+   }
+ 
+   InputContext = XCreateIC(xim, XNInputStyle, input_style,
+-    XNClientWindow, win, XNFocusWindow, win, 0);
++     XNClientWindow, win, XNFocusWindow, win, (void *)NULL);
+ 
+   if (!InputContext) {
+     XCloseIM(xim);


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to