Bug 186347 - www/newsbeuter segmentation fault with icu option of sqlite3
Summary: www/newsbeuter segmentation fault with icu option of sqlite3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Tilman Keskinoz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-01 16:10 UTC by Zsolt Udvari
Modified: 2014-02-03 15:50 UTC (History)
1 user (show)

See Also:


Attachments
newsbeuter.patch (2.62 KB, patch)
2014-02-02 15:23 UTC, Tijl Coosemans
no flags Details | Diff
newsbeuter.patch (2.72 KB, patch)
2014-02-03 14:54 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Udvari 2014-02-01 16:10:00 UTC
With ICU option of sqlite3, newsbeuter drops segmentation fault. The gdb output:

#0  0x0000000000000000 in ?? ()
#1  0x000000080263c952 in __dynamic_cast (src_ptr=0x802877760, src_type=0x80286deb0, dst_type=0x80286dbe0, src2dst=0)
    at ../../.././../gcc-4.6.4/libstdc++-v3/libsupc++/dyncast.cc:61
#2  0x000000080260fc20 in std::has_facet<std::ctype<char> > (__loc=@0x73b178) at locale_classes.tcc:234
#3  0x0000000802604b24 in std::basic_ios<char, std::char_traits<char> >::_M_cache_locale (this=0x73b0a8, __loc=@0x73b178) at basic_ios.tcc:160
#4  0x0000000802604bc8 in std::basic_ios<char, std::char_traits<char> >::init (this=0x73b0a8, __sb=0x802876ac0) at basic_ios.tcc:133
#5  0x00000008025ec54d in Init (this=<value optimized out>) at ostream:85
#6  0x000000000040928c in __static_initialization_and_destruction_0 (__initialize_p=Could not find the frame base for "__static_initialization_and_destruction_0".
) at newsbeuter.cpp:17
#7  0x00007fffffffd3d0 in ?? ()
#8  0x00007fffffffca70 in ?? ()
#9  0x0000000000736000 in ?? ()
#10 0x0000000800761ce0 in ?? ()
#11 0x0000000000000000 in ?? ()

With the same version of sqlite3 without ICU option works well.

How-To-Repeat: 1. Build sqlite3 with ICU
2. Build newsbeuter
3. Run newsbeuter
Comment 1 Edwin Groothuis freebsd_committer 2014-02-01 16:10:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->arved

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Tijl Coosemans freebsd_committer 2014-02-02 15:23:04 UTC
Hi,

Can you test the attached patch?  The crash is caused by the conflict
between libc++ and libstdc++.  This patch fixes newsbeuter so it builds
with clang/libc++.
Comment 3 Zsolt Udvari 2014-02-02 16:01:18 UTC
It seems it works well.
And now doesn't need gcc! Very great!

Thanks.

2014-02-02 Tijl Coosemans <tijl@freebsd.org>:
> Hi,
>
> Can you test the attached patch?  The crash is caused by the conflict
> between libc++ and libstdc++.  This patch fixes newsbeuter so it builds
> with clang/libc++.
Comment 4 Tilman Keskinoz freebsd_committer 2014-02-03 11:15:21 UTC
Hi Tijl,

c++ -O2 -pipe -fno-strict-aliasing -std=gnu++0x -ggdb -Iinclude -Istfl
-Ifilter -I. -Irss -Wall -Wextra -DLOCALEDIR=\"/usr/local/share/locale\"
-I/usr/local/include   -I/usr/local/include
-I/usr/local/include/libxml2 -I/usr/local/include   -I/usr/local/include
  -I/usr/local/include/json-c   -DHAVE_OPENSSL=1 -O2 -pipe
-fno-strict-aliasing -std=gnu++0x -ggdb -Iinclude -Istfl -Ifilter -I.
-Irss -Wall -Wextra -DLOCALEDIR=\"/usr/local/share/locale\" -o
src/configcontainer.o -c src/configcontainer.cpp
cc1plus: error: unrecognized command line option "-std=gnu++0x"
cc1plus: error: unrecognized command line option "-std=gnu++0x"

It does not build on my 9.2. Any ideas?

Or should i just wrap USE_CXXSTD into an if OSVERSION?

* Tijl Coosemans [Sun, 2 Feb 2014 15:30:01 GMT]:
> The following reply was made to PR ports/186347; it has been noted by GNATS.
> 
> From: Tijl Coosemans <tijl@FreeBSD.org>
> To: bug-followup@FreeBSD.org, udvzsolt@gmail.com
> Cc:  
> Subject: Re: ports/186347: www/newsbeuter segmentation fault with icu option
>  of sqlite3
> Date: Sun, 2 Feb 2014 16:23:04 +0100
> 
>  --MP_/Gkcki3yaG4QhYuLwo.+C19F
>  Content-Type: text/plain; charset=US-ASCII
>  Content-Transfer-Encoding: 7bit
>  Content-Disposition: inline
>  
>  Hi,
>  
>  Can you test the attached patch?  The crash is caused by the conflict
>  between libc++ and libstdc++.  This patch fixes newsbeuter so it builds
>  with clang/libc++.
>  --MP_/Gkcki3yaG4QhYuLwo.+C19F
>  Content-Type: text/x-patch
>  Content-Transfer-Encoding: 7bit
>  Content-Disposition: attachment; filename=newsbeuter.patch
>  
>  Index: www/newsbeuter/Makefile
>  ===================================================================
>  --- www/newsbeuter/Makefile	(revision 342111)
>  +++ www/newsbeuter/Makefile	(working copy)
>  @@ -3,7 +3,7 @@
>   
>   PORTNAME=	newsbeuter
>   PORTVERSION=	2.8
>  -PORTREVISION=	1
>  +PORTREVISION=	2
>   CATEGORIES=	www
>   MASTER_SITES=	http://newsbeuter.org/downloads/
>   
>  @@ -23,10 +23,10 @@ OPTIONS_SUB=	yes
>   PODCAST_DESC=	Podcast client (podbeuter)
>   
>   USES=		gettext gmake iconv:translit ncurses perl5 pkgconfig
>  +USE_CXXSTD=	gnu++0x
>   USE_PERL5=	build
>   USE_SQLITE=	yes
>   USE_GNOME=	libxml2
>  -USE_GCC=	any
>   
>   post-patch:
>   	${REINPLACE_CMD} -e "s,share/man,man,; \
>  Index: www/newsbeuter/files/patch-include-matcher.h
>  ===================================================================
>  --- www/newsbeuter/files/patch-include-matcher.h	(revision 0)
>  +++ www/newsbeuter/files/patch-include-matcher.h	(working copy)
>  @@ -0,0 +1,13 @@
>  +--- include/matcher.h.orig	2014-02-02 16:00:13.000000000 +0100
>  ++++ include/matcher.h	2014-02-02 16:00:19.000000000 +0100
>  +@@ -3,6 +3,10 @@
>  + 
>  + #include <FilterParser.h>
>  + 
>  ++#ifdef _LIBCPP_VERSION
>  ++namespace std { namespace tr1 = std; }
>  ++#endif
>  ++
>  + namespace newsbeuter {
>  + 
>  + 	class matchable {
>  
>  Property changes on: www/newsbeuter/files/patch-include-matcher.h
>  ___________________________________________________________________
>  Added: fbsd:nokeywords
>  ## -0,0 +1 ##
>  +yes
>  \ No newline at end of property
>  Added: svn:eol-style
>  ## -0,0 +1 ##
>  +native
>  \ No newline at end of property
>  Added: svn:mime-type
>  ## -0,0 +1 ##
>  +text/plain
>  \ No newline at end of property
>  Index: www/newsbeuter/files/patch-rss-rsspp_internatl.h
>  ===================================================================
>  --- www/newsbeuter/files/patch-rss-rsspp_internatl.h	(revision 0)
>  +++ www/newsbeuter/files/patch-rss-rsspp_internatl.h	(working copy)
>  @@ -0,0 +1,13 @@
>  +--- rss/rsspp_internal.h.orig	2014-02-02 15:53:54.000000000 +0100
>  ++++ rss/rsspp_internal.h	2014-02-02 15:52:36.000000000 +0100
>  +@@ -9,6 +9,10 @@
>  + #include <rsspp.h>
>  + #include <tr1/memory>
>  + 
>  ++#ifdef _LIBCPP_VERSION
>  ++namespace std { namespace tr1 = std; }
>  ++#endif
>  ++
>  + #define CONTENT_URI		"http://purl.org/rss/1.0/modules/content/"
>  + #define RDF_URI			"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>  + #define ITUNES_URI		"http://www.itunes.com/dtds/podcast-1.0.dtd"
>  
>  Property changes on: www/newsbeuter/files/patch-rss-rsspp_internatl.h
>  ___________________________________________________________________
>  Added: svn:mime-type
>  ## -0,0 +1 ##
>  +text/plain
>  \ No newline at end of property
>  Added: fbsd:nokeywords
>  ## -0,0 +1 ##
>  +yes
>  \ No newline at end of property
>  Added: svn:eol-style
>  ## -0,0 +1 ##
>  +native
>  \ No newline at end of property
>  
>  --MP_/Gkcki3yaG4QhYuLwo.+C19F--
>
Comment 5 Tijl Coosemans freebsd_committer 2014-02-03 14:54:24 UTC
On Mon, 03 Feb 2014 12:15:21 +0100 Tilman Keskinöz wrote:
> Hi Tijl,
> 
> c++ -O2 -pipe -fno-strict-aliasing -std=gnu++0x -ggdb -Iinclude -Istfl
> -Ifilter -I. -Irss -Wall -Wextra -DLOCALEDIR=\"/usr/local/share/locale\"
> -I/usr/local/include   -I/usr/local/include
> -I/usr/local/include/libxml2 -I/usr/local/include   -I/usr/local/include
>   -I/usr/local/include/json-c   -DHAVE_OPENSSL=1 -O2 -pipe
> -fno-strict-aliasing -std=gnu++0x -ggdb -Iinclude -Istfl -Ifilter -I.
> -Irss -Wall -Wextra -DLOCALEDIR=\"/usr/local/share/locale\" -o
> src/configcontainer.o -c src/configcontainer.cpp
> cc1plus: error: unrecognized command line option "-std=gnu++0x"
> cc1plus: error: unrecognized command line option "-std=gnu++0x"
> 
> It does not build on my 9.2. Any ideas?
> 
> Or should i just wrap USE_CXXSTD into an if OSVERSION?


Hmm, so the old gcc doesn't support that flag.  I've attached a new
patch which adds compiler:c++11-lang to USES.  This means the port
will use clang if it's available.  If it isn't the port will depend
on lang/clang33 (by default, users can set FAVORITE_COMPILER=gcc in
make.conf and then the port will use lang/gcc47).  I've tested this
patch: https://redports.org/buildarchive/20140203134901-18391/

An alternative would be to add "compiler" to USES and then do
something like this:

.include <bsd.port.pre.mk>

.if ${COMPILER_TYPE} == clang
USE_CXXSTD=	gnu++0x
.endif

.include <bsd.port.post.mk>

I haven't tested this.
Comment 6 dfilter service freebsd_committer 2014-02-03 15:47:36 UTC
Author: arved
Date: Mon Feb  3 15:47:22 2014
New Revision: 342458
URL: http://svnweb.freebsd.org/changeset/ports/342458
QAT: https://qat.redports.org/buildarchive/r342458/

Log:
  Remove USE_GCC, this fixes segfaults due to mixing c++ libraries.
  
  PR:             186347
  Submitted by:   til
  Reported by:    Zsolt Udvari <udvzsolt@gmail.com>

Added:
  head/www/newsbeuter/files/
  head/www/newsbeuter/files/patch-include-matcher.h   (contents, props changed)
  head/www/newsbeuter/files/patch-rss-rsspp_internatl.h   (contents, props changed)
Modified:
  head/www/newsbeuter/Makefile

Modified: head/www/newsbeuter/Makefile
==============================================================================
--- head/www/newsbeuter/Makefile	Mon Feb  3 15:45:08 2014	(r342457)
+++ head/www/newsbeuter/Makefile	Mon Feb  3 15:47:22 2014	(r342458)
@@ -3,7 +3,7 @@
 
 PORTNAME=	newsbeuter
 PORTVERSION=	2.8
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www
 MASTER_SITES=	http://newsbeuter.org/downloads/
 
@@ -22,11 +22,11 @@ OPTIONS_DEFAULT=PODCAST
 OPTIONS_SUB=	yes
 PODCAST_DESC=	Podcast client (podbeuter)
 
-USES=		gettext gmake iconv:translit ncurses perl5 pkgconfig
+USES=		compiler:c++11-lang gettext gmake iconv:translit ncurses perl5 pkgconfig
+USE_CXXSTD=	gnu++11
 USE_PERL5=	build
 USE_SQLITE=	yes
 USE_GNOME=	libxml2
-USE_GCC=	any
 
 post-patch:
 	${REINPLACE_CMD} -e "s,share/man,man,; \

Added: head/www/newsbeuter/files/patch-include-matcher.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/newsbeuter/files/patch-include-matcher.h	Mon Feb  3 15:47:22 2014	(r342458)
@@ -0,0 +1,13 @@
+--- include/matcher.h.orig	2014-02-02 16:00:13.000000000 +0100
++++ include/matcher.h	2014-02-02 16:00:19.000000000 +0100
+@@ -3,6 +3,10 @@
+ 
+ #include <FilterParser.h>
+ 
++#ifdef _LIBCPP_VERSION
++namespace std { namespace tr1 = std; }
++#endif
++
+ namespace newsbeuter {
+ 
+ 	class matchable {

Added: head/www/newsbeuter/files/patch-rss-rsspp_internatl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/newsbeuter/files/patch-rss-rsspp_internatl.h	Mon Feb  3 15:47:22 2014	(r342458)
@@ -0,0 +1,13 @@
+--- rss/rsspp_internal.h.orig	2014-02-02 15:53:54.000000000 +0100
++++ rss/rsspp_internal.h	2014-02-02 15:52:36.000000000 +0100
+@@ -9,6 +9,10 @@
+ #include <rsspp.h>
+ #include <tr1/memory>
+ 
++#ifdef _LIBCPP_VERSION
++namespace std { namespace tr1 = std; }
++#endif
++
+ #define CONTENT_URI		"http://purl.org/rss/1.0/modules/content/"
+ #define RDF_URI			"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ #define ITUNES_URI		"http://www.itunes.com/dtds/podcast-1.0.dtd"
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 7 Tilman Keskinoz freebsd_committer 2014-02-03 15:47:48 UTC
State Changed
From-To: open->closed

Committed, thanks