From owner-freebsd-ports@FreeBSD.ORG Tue Feb 25 18:28:14 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E242FAC; Tue, 25 Feb 2014 18:28:14 +0000 (UTC) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C449018EC; Tue, 25 Feb 2014 18:28:13 +0000 (UTC) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id 5FD7915992; Tue, 25 Feb 2014 19:27:29 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id 59A50DDAD; Tue, 25 Feb 2014 19:27:29 +0100 (CET) Date: Tue, 25 Feb 2014 19:27:29 +0100 From: Kristof Provost To: mat@FreeBSD.org, 6yearold@gmail.com Subject: net/owncloud-csync,deskutils/mirall owncloudcmd segfault Message-ID: <20140225182729.GL56837@vega.codepro.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-PGP-Fingerprint: E114 D9EA 909E D469 8F57 17A5 7D15 91C6 9EFA F286 X-Checked-By-NSA: Probably User-Agent: Mutt/1.5.22 (2013-10-16) Cc: freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 18:28:14 -0000 Hi, I see a segfault when trying to sync a directory using the owncloudcmd CLI client. The command line is pretty straightforward: owncloudcmd Documents ownclouds:///owncloud/remote.php/webdav/ The backtrace: #0 0x0000000809f79da4 in SSL_CTX_set_client_cert_cb () from /usr/lib/libssl.so.7 #1 0x000000080521eab8 in ne_ssl_context_create (mode=) at ne_openssl.c:575 #2 0x000000080520f85e in ne_session_create (scheme=0x7fffffffccc2 "https", hostname=0x80c470a60 "owncloud.codepro.be", port=) at ne_session.c:176 #3 0x0000000800b6cd92 in dav_connect ( base_url=0x80c46f480 "ownclouds://owncloud.codepro.be:443/owncloud/remote.php/webdav") at /var/ports/basejail/usr/ports/net/owncloud-csync/work/ocsync-0.91.4/src/csync_owncloud.c:509 #4 0x0000000800b6aa55 in owncloud_opendir ( uri=0x80c46f480 "ownclouds://owncloud.codepro.be:443/owncloud/remote.php/webdav") at /var/ports/basejail/usr/ports/net/owncloud-csync/work/ocsync-0.91.4/src/csync_owncloud.c:982 #5 0x0000000800b687c8 in csync_vio_opendir (ctx=0x80c478500, name=0x80c46f480 "ownclouds://owncloud.codepro.be:443/owncloud/remote.php/webdav") at /var/ports/basejail/usr/ports/net/owncloud-csync/work/ocsync-0.91.4/src/vio/csync_vio.c:370 #6 0x0000000800b5eb04 in csync_ftw (ctx=0x80c478500, uri=0x80c46f480 "ownclouds://owncloud.codepro.be:443/owncloud/remote.php/webdav", fn=0x800b5d980 , depth=50) at /var/ports/basejail/usr/ports/net/owncloud-csync/work/ocsync-0.91.4/src/csync_update.c:449 #7 0x0000000800b5702b in csync_update (ctx=0x80c478500) at /var/ports/basejail/usr/ports/net/owncloud-csync/work/ocsync-0.91.4/src/csync.c:431 #8 0x00000008008a1ec3 in Mirall::CSyncThread::startSync (this=0x7fffffffd4e0) at /var/ports/basejail/usr/ports/deskutils/mirall/work/mirall-1.5.0/src/mirall/csyncthread.cpp:505 #9 0x00000000004044f5 in main (argc=3, argv=0x7fffffffd768) at /var/ports/basejail/usr/ports/deskutils/mirall/work/mirall-1.5.0/src/owncloudcmd/owncloudcmd.cpp:140 Looking into this, the crash occurs inside neon, specifically inside ne_ssl_context_create(). It crashes because the call to SSL_CTX_new(SSLv23_client_method()); returns NULL. OpenSSL gives me the following error: error:140A90A1:lib(20):func(169):reason(161) This means that we haven't called SSL_library_init(). Neon does this in ne_ssl_init(), which itself is called by ne_sock_init(). The ne_sock_init() call isn't done by owncloud-csync. The code is present in the dav_connect() function (src/csync_owncloud.c) but it's surrounded by '#if 0'. Removing the '#if 0' fixes my crash. I've noticed that there's a new version of deskutils/mirall (1.5.1) with the following changelog entry: "Imported the ocsync library into miralls repository." So, now I'm not sure what the right fix is here. It's quite possible that version 1.5.1 fixes the problem and it's almost certain that the fix will be different. Regards, Kristof