Date: Tue, 25 Feb 2014 19:27:29 +0100 From: Kristof Provost <kristof@sigsegv.be> To: mat@FreeBSD.org, 6yearold@gmail.com Cc: freebsd-ports@freebsd.org Subject: net/owncloud-csync,deskutils/mirall owncloudcmd segfault Message-ID: <20140225182729.GL56837@vega.codepro.be>
next in thread | raw e-mail | index | archive | help
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://<URL>/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=<value optimized out>) at ne_openssl.c:575 #2 0x000000080520f85e in ne_session_create (scheme=0x7fffffffccc2 "https", hostname=0x80c470a60 "owncloud.codepro.be", port=<value optimized out>) 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 <csync_walker>, 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140225182729.GL56837>