Re: [patch v5 2/6] lib: Let Xapian manage the memory for FieldProcessors

2017-02-19 Thread David Bremner
David Bremner  writes:

> It turns out this is exactly what release() is for; Xapian will
> deallocate the objects when it's done with them.

pushed the first two of this series to master
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: read after free in notmuch new

2017-02-19 Thread David Bremner
David Bremner  writes:

> I haven't had a chance to really track this down, but it seems there is
> a memory error in notmuch new (or a maybe false positive from valgrind).
>
> Attached is the log from running "make memory-test OPTIONS=--medium" on
> current git master (0e037c34).
>
> It looks like we talloc the message_id string with the message object as
> parent, but it somehow outlives the message object.

Sorry, that had a few commits beyond master.

master (08343d3d) gives essentially the same log.



1.log
Description: Binary data
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


read after free in notmuch new

2017-02-19 Thread David Bremner

I haven't had a chance to really track this down, but it seems there is
a memory error in notmuch new (or a maybe false positive from valgrind).

Attached is the log from running "make memory-test OPTIONS=--medium" on
current git master (0e037c34).

It looks like we talloc the message_id string with the message object as
parent, but it somehow outlives the message object.



1.log
Description: Binary data
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[Tomi Ollila] Re: [PATCH 2/2] test: use gpgconf --create-socketdir if available

2017-02-19 Thread David Bremner

I'm pretty sure Tomi meant to complain publicly ;).

--- Begin Message ---
On Tue, Feb 14 2017, David Bremner  wrote:

> This enables the shortened socket pathes in /run or equivalent. The
> explicit call to gpgconf is needed for nonstandard GNUPGHOME settings.

2½ comments inline:

__> ---
>  test/test-lib.sh | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index 86e792a8..9aa6163b 100644
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -229,9 +229,18 @@ test_fixed=0
>  test_broken=0
>  test_success=0
>  
> +
> +_shutdown_gpg_agent () {
> +if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} == 1 ]; then

 '==' is bashishm (well, maybe works in zsh too), standard
with [ ... ] and (builtin) test(1) is just single '=' for equality.

> + gpgconf --kill gpg-agent
> + gpgconf --remove-socketdir
> +fi
> +}
> +
>  _exit_common () {
>   code=$?
>   trap - EXIT
> + _shutdown_gpg_agent

better put `set +ex` _before_ `_shutdown_gpg_agent` so that possible failure
there may not stop exit processing

>   set +ex
>   rm -rf "$TEST_TMPDIR"
>  }
> @@ -1276,6 +1285,11 @@ test_init_ () {
>  
>  . ./test-lib-common.sh || exit 1
>  
> +# we need the setting of GNUPGHOME in test-lib-common.sh
> +if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} == 1 ]; then

== -> = 

> +gpgconf --create-socketdir
> +fi
> +
>  emacs_generate_script
>  
>  
> -- 
> 2.11.0
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
--- End Message ---
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 2/2] test: use gpgconf --create-socketdir if available

2017-02-19 Thread Tomi Ollila
On Tue, Feb 14 2017, David Bremner  wrote:

> This enables the shortened socket pathes in /run or equivalent. The
> explicit call to gpgconf is needed for nonstandard GNUPGHOME settings.

2½ comments inline:

__> ---
>  test/test-lib.sh | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index 86e792a8..9aa6163b 100644
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -229,9 +229,18 @@ test_fixed=0
>  test_broken=0
>  test_success=0
>  
> +
> +_shutdown_gpg_agent () {
> +if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} == 1 ]; then

 '==' is bashishm (well, maybe works in zsh too), standard
with [ ... ] and (builtin) test(1) is just single '=' for equality.

> + gpgconf --kill gpg-agent
> + gpgconf --remove-socketdir
> +fi
> +}
> +
>  _exit_common () {
>   code=$?
>   trap - EXIT
> + _shutdown_gpg_agent

better put `set +ex` _before_ `_shutdown_gpg_agent` so that possible failure
there may not stop exit processing

>   set +ex
>   rm -rf "$TEST_TMPDIR"
>  }
> @@ -1276,6 +1285,11 @@ test_init_ () {
>  
>  . ./test-lib-common.sh || exit 1
>  
> +# we need the setting of GNUPGHOME in test-lib-common.sh
> +if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} == 1 ]; then

== -> = 

> +gpgconf --create-socketdir
> +fi
> +
>  emacs_generate_script
>  
>  
> -- 
> 2.11.0
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch