Re: graphics/shotwell segfaults on amd64

2019-03-29 Thread Josh Grosse
On Wed, Mar 27, 2019 at 11:43:25AM +0100, Antoine Jacoutot wrote:
> On Wed, Mar 27, 2019 at 11:25:56AM +0100, Antoine Jacoutot wrote:
> > On Tue, Mar 26, 2019 at 08:25:40PM -0400, Josh Grosse wrote:
> > > I'm trying to figure out a root cause, but am struggling
> > > because my usual method of preventing stripped modules
> > > fails when I build shotwell.  Setting $INSTALL_STRIP 
> > > doesn't have an effect during make fake.
> > > 
> > > Size mismatch warnings between libstdc++ and libc++abi occur
> > > when the application is started, and after displaying thumbnails
> > > a segfault in libc++abi occurs when the user clicks on any
> > > thumbnail.
> > > 
> > > A console log, backtrace, and dmesg follow.  Any suggestions for capturing
> > > better data would be appreciated.
> > > 
> > > Thanks in advance.
> > 
> > The problem comes from libraw which hardcodes -lstdc++.
> > Libs: -L${libdir} -lraw -lstdc++
> 
> That should do it.
> While here, bring a patch from FreeBSD.
> 
> OK?

Thanks for the commits to libraw and shotwell.  Problem resolved. :)



Re: graphics/shotwell segfaults on amd64

2019-03-27 Thread Antoine Jacoutot
On Wed, Mar 27, 2019 at 11:25:56AM +0100, Antoine Jacoutot wrote:
> On Tue, Mar 26, 2019 at 08:25:40PM -0400, Josh Grosse wrote:
> > I'm trying to figure out a root cause, but am struggling
> > because my usual method of preventing stripped modules
> > fails when I build shotwell.  Setting $INSTALL_STRIP 
> > doesn't have an effect during make fake.
> > 
> > Size mismatch warnings between libstdc++ and libc++abi occur
> > when the application is started, and after displaying thumbnails
> > a segfault in libc++abi occurs when the user clicks on any
> > thumbnail.
> > 
> > A console log, backtrace, and dmesg follow.  Any suggestions for capturing
> > better data would be appreciated.
> > 
> > Thanks in advance.
> 
> The problem comes from libraw which hardcodes -lstdc++.
> Libs: -L${libdir} -lraw -lstdc++

That should do it.
While here, bring a patch from FreeBSD.

OK?

Index: Makefile
===
RCS file: /cvs/ports/graphics/libraw/Makefile,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile
--- Makefile24 Oct 2018 14:28:05 -  1.40
+++ Makefile27 Mar 2019 10:42:23 -
@@ -3,7 +3,7 @@
 COMMENT =  library for reading RAW files
 
 DISTNAME = LibRaw-0.18.13
-REVISION = 0
+REVISION = 1
 PKGNAME =  ${DISTNAME:L}
 CATEGORIES =   graphics
 
Index: patches/patch-internal_dcraw_common_cpp
===
RCS file: patches/patch-internal_dcraw_common_cpp
diff -N patches/patch-internal_dcraw_common_cpp
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-internal_dcraw_common_cpp 27 Mar 2019 10:42:23 -
@@ -0,0 +1,32 @@
+$OpenBSD$
+
+OpenBSD has its own strnlen and strcasestr.
+
+Index: internal/dcraw_common.cpp
+--- internal/dcraw_common.cpp.orig
 internal/dcraw_common.cpp
+@@ -51,6 +51,7 @@ int CLASS fcol (int row, int col)
+   if (filters == 9) return xtrans[(row+6) % 6][(col+6) % 6];
+   return FC(row,col);
+ }
++#if !defined(__OpenBSD__)
+ static size_t local_strnlen(const char *s, size_t n)
+ {
+   const char *p = (const char *)memchr(s, 0, n);
+@@ -58,6 +59,7 @@ static size_t local_strnlen(const char *s, size_t n)
+ }
+ /* add OS X version check here ?? */
+ #define strnlen(a,b) local_strnlen(a,b)
++#endif
+ 
+ #ifdef LIBRAW_LIBRARY_BUILD
+ static int stread(char *buf, size_t len, LibRaw_abstract_datastream *fp)
+@@ -74,7 +76,7 @@ static int stread(char *buf, size_t len, LibRaw_abstra
+ #define stmread(buf,maxlen,fp) stread(buf,MIN(maxlen,sizeof(buf)),fp)
+ #endif
+ 
+-#ifndef __GLIBC__
++#if !defined(__GLIBC__) && !defined(__OpenBSD__)
+ char *my_memmem (char *haystack, size_t haystacklen,
+ char *needle, size_t needlelen)
+ {
Index: patches/patch-internal_libraw_x3f_cpp
===
RCS file: /cvs/ports/graphics/libraw/patches/patch-internal_libraw_x3f_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-internal_libraw_x3f_cpp
--- patches/patch-internal_libraw_x3f_cpp   18 May 2018 06:04:33 -  
1.6
+++ patches/patch-internal_libraw_x3f_cpp   27 Mar 2019 10:42:23 -
@@ -2,6 +2,7 @@ $OpenBSD: patch-internal_libraw_x3f_cpp,
 
 fix non-constant-expression cannot be narrowed from type 'int' to 'int16_t'
 (aka 'short') with clang6
+
 Index: internal/libraw_x3f.cpp
 --- internal/libraw_x3f.cpp.orig
 +++ internal/libraw_x3f.cpp
Index: patches/patch-libraw_pc_in
===
RCS file: patches/patch-libraw_pc_in
diff -N patches/patch-libraw_pc_in
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-libraw_pc_in  27 Mar 2019 10:42:23 -
@@ -0,0 +1,12 @@
+$OpenBSD$
+
+Index: libraw.pc.in
+--- libraw.pc.in.orig
 libraw.pc.in
+@@ -7,5 +7,5 @@ Name: libraw
+ Description: Raw image decoder library (non-thread-safe)
+ Requires: @PACKAGE_REQUIRES@
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -lraw -lstdc++@PC_OPENMP@
++Libs: -L${libdir} -lraw @PC_OPENMP@
+ Cflags: -I${includedir}/libraw




Re: graphics/shotwell segfaults on amd64

2019-03-27 Thread Antoine Jacoutot
On Tue, Mar 26, 2019 at 08:25:40PM -0400, Josh Grosse wrote:
> I'm trying to figure out a root cause, but am struggling
> because my usual method of preventing stripped modules
> fails when I build shotwell.  Setting $INSTALL_STRIP 
> doesn't have an effect during make fake.
> 
> Size mismatch warnings between libstdc++ and libc++abi occur
> when the application is started, and after displaying thumbnails
> a segfault in libc++abi occurs when the user clicks on any
> thumbnail.
> 
> A console log, backtrace, and dmesg follow.  Any suggestions for capturing
> better data would be appreciated.
> 
> Thanks in advance.

The problem comes from libraw which hardcodes -lstdc++.
Libs: -L${libdir} -lraw -lstdc++


> --
> 
> x220$ shotwell
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv120__si_class_type_infoE) size mismatch, relink your 
> program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv120__function_type_infoE) size mismatch, relink your 
> program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVSt9type_info) size mismatch, relink your program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv117__class_type_infoE) size mismatch, relink your 
> program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv123__fundamental_type_infoE) size mismatch, relink 
> your program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv119__pointer_type_infoE) size mismatch, relink your 
> program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv129__pointer_to_member_type_infoE) size mismatch, 
> relink your program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv116__enum_type_infoE) size mismatch, relink your 
> program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv121__vmi_class_type_infoE) size mismatch, relink your 
> program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv117__pbase_type_infoE) size mismatch, relink your 
> program
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv117__array_type_infoE) size mismatch, relink your 
> program
> 
> (shotwell:79515): Gtk-1;33mWARNING0m **: 34m19:25:48.0880m: 
> gtk_window_present_with_time() should not be called with 0, or 
> GDK_CURRENT_TIME as a timestamp, the timestamp should instead be gathered at 
> the time the user initiated the request for the window to be shown
> Segmentation fault (core dumped)
> x220$ egdb /usr/local/bin/shotwell shotwell.core
> ?1034hGNU gdb (GDB) 7.12.1
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> 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.4".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> .
> Find the GDB manual and other documentation resources online at:
> .
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /usr/local/bin/shotwell...(no debugging symbols 
> found)...done.
> [New process 593704]
> [New process 464506]
> [New process 360647]
> [New process 124467]
> [New process 546624]
> [New process 228011]
> [New process 387002]
> [New process 565161]
> [New process 198636]
> [New process 184287]
> [New process 579951]
> [New process 268459]
> [New process 615539]
> Core was generated by `shotwell'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  is_equal (x=0x137ccba91e80 , 
> use_strcmp=false, y=)
> at /usr/src/lib/libcxxabi/src/private_typeinfo.cpp:64
> 64return x == y;
> [Current thread is 1 (process 593704)]
> (gdb) bt
> #0  is_equal (x=0x137ccba91e80 , 
> use_strcmp=false, y=)
> at /usr/src/lib/libcxxabi/src/private_typeinfo.cpp:64
> #1  __cxxabiv1::__si_class_type_info::has_unambiguous_public_base 
> (this=0x137ccba91e80 , info=0x0,
> adjustedPtr=0x6, path_below=-878109056) at 
> /usr/src/lib/libcxxabi/src/private_typeinfo.cpp:289
> #2  0x137d6a060c3f in __cxxabiv1::__dynamic_cast (src_ptr=0x137cee1e0cc0, 
> src_type=0x137ccba91e10 ,
> dst_type=0x137ccba91e80 , 
> src2dst=0)
> at 
> /usr/src/gnu/lib/libstdc++-v3/../../gcc/libstdc++-v3/libsupc++/tinfo.cc:731
> #3  0x137ccb9dea59 in 
> 

Re: graphics/shotwell segfaults on amd64

2019-03-27 Thread Stuart Henderson
On 2019/03/27 03:54, Josh Grosse wrote:
> On Wed, Mar 27, 2019 at 01:17:11AM +, Stuart Henderson wrote:
> > On 2019/03/26 20:25, Josh Grosse wrote:
> > > I'm trying to figure out a root cause, but am struggling
> > > because my usual method of preventing stripped modules
> > > fails when I build shotwell.  Setting $INSTALL_STRIP 
> > > doesn't have an effect during make fake.
> > > 
> > > Size mismatch warnings between libstdc++ and libc++abi occur
> > > when the application is started, and after displaying thumbnails
> > > a segfault in libc++abi occurs when the user clicks on any
> > > thumbnail.
> > > 
> > > A console log, backtrace, and dmesg follow.  Any suggestions for capturing
> > > better data would be appreciated.
> > 
> > > x220$ shotwell
> > > shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> > > symbol(_ZTVN10__cxxabiv120__si_class_type_infoE) size mismatch, relink 
> > > your program
> > 
> > Well that is very odd, why is it linking libstdc++?
> > I'm not at all surprised that it's crashing.
> 
> It appears to have been added to WANTLIB at r1.101 on Feb 7.
> 

It's added to WANTLIB because it is linked against it. The question is
why it's linking against it..



Re: graphics/shotwell segfaults on amd64

2019-03-27 Thread Josh Grosse
On Wed, Mar 27, 2019 at 01:17:11AM +, Stuart Henderson wrote:
> On 2019/03/26 20:25, Josh Grosse wrote:
> > I'm trying to figure out a root cause, but am struggling
> > because my usual method of preventing stripped modules
> > fails when I build shotwell.  Setting $INSTALL_STRIP 
> > doesn't have an effect during make fake.
> > 
> > Size mismatch warnings between libstdc++ and libc++abi occur
> > when the application is started, and after displaying thumbnails
> > a segfault in libc++abi occurs when the user clicks on any
> > thumbnail.
> > 
> > A console log, backtrace, and dmesg follow.  Any suggestions for capturing
> > better data would be appreciated.
> 
> > x220$ shotwell
> > shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> > symbol(_ZTVN10__cxxabiv120__si_class_type_infoE) size mismatch, relink your 
> > program
> 
> Well that is very odd, why is it linking libstdc++?
> I'm not at all surprised that it's crashing.

It appears to have been added to WANTLIB at r1.101 on Feb 7.



Re: graphics/shotwell segfaults on amd64

2019-03-26 Thread Stuart Henderson
On 2019/03/26 20:25, Josh Grosse wrote:
> I'm trying to figure out a root cause, but am struggling
> because my usual method of preventing stripped modules
> fails when I build shotwell.  Setting $INSTALL_STRIP 
> doesn't have an effect during make fake.
> 
> Size mismatch warnings between libstdc++ and libc++abi occur
> when the application is started, and after displaying thumbnails
> a segfault in libc++abi occurs when the user clicks on any
> thumbnail.
> 
> A console log, backtrace, and dmesg follow.  Any suggestions for capturing
> better data would be appreciated.

> x220$ shotwell
> shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
> symbol(_ZTVN10__cxxabiv120__si_class_type_infoE) size mismatch, relink your 
> program

Well that is very odd, why is it linking libstdc++?
I'm not at all surprised that it's crashing.



graphics/shotwell segfaults on amd64

2019-03-26 Thread Josh Grosse
I'm trying to figure out a root cause, but am struggling
because my usual method of preventing stripped modules
fails when I build shotwell.  Setting $INSTALL_STRIP 
doesn't have an effect during make fake.

Size mismatch warnings between libstdc++ and libc++abi occur
when the application is started, and after displaying thumbnails
a segfault in libc++abi occurs when the user clicks on any
thumbnail.

A console log, backtrace, and dmesg follow.  Any suggestions for capturing
better data would be appreciated.

Thanks in advance.

--

x220$ shotwell
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv120__si_class_type_infoE) size mismatch, relink your 
program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv120__function_type_infoE) size mismatch, relink your 
program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVSt9type_info) size mismatch, relink your program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv117__class_type_infoE) size mismatch, relink your program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv123__fundamental_type_infoE) size mismatch, relink your 
program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv119__pointer_type_infoE) size mismatch, relink your 
program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv129__pointer_to_member_type_infoE) size mismatch, relink 
your program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv116__enum_type_infoE) size mismatch, relink your program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv121__vmi_class_type_infoE) size mismatch, relink your 
program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv117__pbase_type_infoE) size mismatch, relink your program
shotwell:/usr/lib/libstdc++.so.57.0: /usr/lib/libc++abi.so.0.1 : WARNING: 
symbol(_ZTVN10__cxxabiv117__array_type_infoE) size mismatch, relink your program

(shotwell:79515): Gtk-1;33mWARNING0m **: 34m19:25:48.0880m: 
gtk_window_present_with_time() should not be called with 0, or GDK_CURRENT_TIME 
as a timestamp, the timestamp should instead be gathered at the time the user 
initiated the request for the window to be shown
Segmentation fault (core dumped)
x220$ egdb /usr/local/bin/shotwell shotwell.core
?1034hGNU gdb (GDB) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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.4".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/bin/shotwell...(no debugging symbols 
found)...done.
[New process 593704]
[New process 464506]
[New process 360647]
[New process 124467]
[New process 546624]
[New process 228011]
[New process 387002]
[New process 565161]
[New process 198636]
[New process 184287]
[New process 579951]
[New process 268459]
[New process 615539]
Core was generated by `shotwell'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  is_equal (x=0x137ccba91e80 , 
use_strcmp=false, y=)
at /usr/src/lib/libcxxabi/src/private_typeinfo.cpp:64
64  return x == y;
[Current thread is 1 (process 593704)]
(gdb) bt
#0  is_equal (x=0x137ccba91e80 , 
use_strcmp=false, y=)
at /usr/src/lib/libcxxabi/src/private_typeinfo.cpp:64
#1  __cxxabiv1::__si_class_type_info::has_unambiguous_public_base 
(this=0x137ccba91e80 , info=0x0,
adjustedPtr=0x6, path_below=-878109056) at 
/usr/src/lib/libcxxabi/src/private_typeinfo.cpp:289
#2  0x137d6a060c3f in __cxxabiv1::__dynamic_cast (src_ptr=0x137cee1e0cc0, 
src_type=0x137ccba91e10 ,
dst_type=0x137ccba91e80 , 
src2dst=0)
at 
/usr/src/gnu/lib/libstdc++-v3/../../gcc/libstdc++-v3/libsupc++/tinfo.cc:731
#3  0x137ccb9dea59 in 
Exiv2::Internal::TiffSubIfd::doAddChild(std::__1::auto_ptr)
 ()
   from /usr/local/lib/libexiv2.so.11.0
#4  0x137ccb9dd930 in 
Exiv2::Internal::TiffComponent::addChild(std::__1::auto_ptr)
 ()
   from /usr/local/lib/libexiv2.so.11.0
#5  0x137ccb9f721d in 
Exiv2::Internal::TiffReader::visitSubIfd(Exiv2::Internal::TiffSubIfd*) () from 
/usr/local/lib/libexiv2.so.11.0
#6  0x137ccb9df182 in