broken --with_memcached option

Bug #1164440 reported by Remi Collet on 2013-04-04
24
This bug affects 6 people
Affects Status Importance Assigned to Milestone
libmemcached
Medium
Brian Aker

Bug Description

With version 1.0.17

--with-memcached works as expected
--with-memcached=/path/to/memcached doesn't work anymore

In mem_config.h, HAVE_MEMCACHED_BINARY and MEMCACHED_BINARY are not defined

Other related question.

If build --without-memcached, shoudn't this contant be defined ? (as the are used in libtest, so expected to be always defined, as 0 or 1)

Related branches

Remi Collet (remicollet) wrote :

Some failure ex:

  CXX libtest/libtest_libtest_la-socket.lo
libtest/server_container.cc: In member function 'libtest::Server* libtest::server_startup_st::create(const string&, in_port_t, bool)':
libtest/server_container.cc:241:9: error: 'HAVE_MEMCACHED_BINARY' was not declared in this scope
make[1]: *** [libtest/libtest_libtest_la-server_container.lo] Error 1

Is this also from fedora19?

Sent from my Ti85

On Apr 4, 2013, at 2:25, Remi Collet <email address hidden> wrote:

> Some failure ex:
>
> CXX libtest/libtest_libtest_la-socket.lo
> libtest/server_container.cc: In member function 'libtest::Server* libtest::server_startup_st::create(const string&, in_port_t, bool)':
> libtest/server_container.cc:241:9: error: 'HAVE_MEMCACHED_BINARY' was not declared in this scope
> make[1]: *** [libtest/libtest_libtest_la-server_container.lo] Error 1
>
> --
> You received this bug notification because you are subscribed to
> libmemcached.
> https://bugs.launchpad.net/bugs/1164440
>
> Title:
> broken --with_memcached option
>
> Status in libmemcached - A C and C++ client library for memcached:
> New
>
> Bug description:
> With version 1.0.17
>
> --with-memcached works as expected
> --with-memcached=/path/to/memcached doesn't work anymore
>
> In mem_config.h, HAVE_MEMCACHED_BINARY and MEMCACHED_BINARY are not
> defined
>
>
> Other related question.
>
> If build --without-memcached, shoudn't this contant be defined ? (as
> the are used in libtest, so expected to be always defined, as 0 or 1)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/libmemcached/+bug/1164440/+subscriptions

Remi Collet (remicollet) wrote :
Download full text (5.9 KiB)

You can be interested in a gcc 4.8 build output (whill not be online for a very long time)
http://kojipkgs.fedoraproject.org//work/tasks/2377/5212377/build.log

There is a lot of build warning detected byt new GCC

NOTE: the test suite fails because of global-buffer-overflow detected

=================================================================
==9370== ERROR: AddressSanitizer: global-buffer-overflow on address 0x0810c864 at pc 0x1d4ad2 bp 0xffe10c98 sp 0xffe10c8c
READ of size 4 at 0x0810c864 thread T0
    #0 0x1d4ad1 (/builddir/build/BUILD/libmemcached-1.0.17/libhashkit/.libs/libhashkit.so.2.0.0+0x1d4ad1)
    #1 0x1d25bb (/builddir/build/BUILD/libmemcached-1.0.17/libhashkit/.libs/libhashkit.so.2.0.0+0x1d25bb)
    #2 0x806042a (/builddir/build/BUILD/libmemcached-1.0.17/tests/.libs/lt-testhashkit+0x1842a)
    #3 0x807ee26 (/builddir/build/BUILD/libmemcached-1.0.17/tests/.libs/lt-testhashkit+0x36e26)
    #4 0x805de6b (/builddir/build/BUILD/libmemcached-1.0.17/tests/.libs/lt-testhashkit+0x15e6b)
    #5 0x80cc910 (/builddir/build/BUILD/libmemcached-1.0.17/tests/.libs/lt-testhashkit+0x84910)
    #6 0x806d9c4 (/builddir/build/BUILD/libmemcached-1.0.17/tests/.libs/lt-testhashkit+0x259c4)
    #7 0x8050428 (/builddir/build/BUILD/libmemcached-1.0.17/tests/.libs/lt-testhashkit+0x8428)
    #8 0x631962 (/usr/lib/libc-2.17.so+0x19962)
    #9 0x805f5b4 (/builddir/build/BUILD/libmemcached-1.0.17/tests/.libs/lt-testhashkit+0x175b4)
0x0810c864 is located 60 bytes to the left of global variable '*.LC54 (tests/hashkit_functions.cc)' (0x810c8a0) of size 5
  '*.LC54 (tests/hashkit_functions.cc)' is ascii string 'beat'
0x0810c866 is located 0 bytes to the right of global variable '*.LC53 (tests/hashkit_functions.cc)' (0x810c860) of size 6
  '*.LC53 (tests/hashkit_functions.cc)' is ascii string 'apple'
Shadow bytes around the buggy address:
  0x210218b0: f9 f9 f9 f9 00 07 f9 f9 f9 f9 f9 f9 00 00 05 f9
  0x210218c0: f9 f9 f9 f9 00 00 00 04 f9 f9 f9 f9 00 00 05 f9
  0x210218d0: f9 f9 f9 f9 00 00 00 00 02 f9 f9 f9 f9 f9 f9 f9
  0x210218e0: 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9 00 00 f9 f9
  0x210218f0: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 f9 f9
=>0x21021900: f9 f9 f9 f9 06 f9 f9 f9 f9 f9 f9 f9[06]f9 f9 f9
  0x21021910: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9
  0x21021920: f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9 00 01 f9 f9
  0x21021930: f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9 06 f9 f9 f9
  0x21021940: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x21021950: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 05 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable: 00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone: fa
  Heap righ redzone: fb
  Freed Heap region: fd
  Stack left redzone: f1
  Stack mid redzone: f2
  Stack right redzone: f3
  Stack partial redzone: f4
  Stack after return: f5
  Stack use after scope: f8
  Global redzone: f9
  Global init order: f6
  Poisoned by user: f7
  ASan internal: fe
==9370== ABORTING
FAIL: tests/testhashkit
hash_plus.basic.exists 0:000005977 [ ok ]
hash_plus.basic.new 0:000014250 [ ok ]
hash_plus.basic.copy ...

Read more...

Remi Collet (remicollet) wrote :

Comment #1 is from fedora 15 (trying to build --with-memcached=false)

Comment #2 is from rawhide (but same compiler than f19)

Brian Aker (brianaker) wrote :

This is hitting bugs in how AX_WITH_PROG is designed, i.e. the autotools macro that does the heavy lifting.

"false" is an actual application, so you are specifying that it should be used in place of the memcached binary.

Remi Collet (remicollet) wrote :

Yes "false" is an actual application used to avoid search for "memcached" when not installed (and not nbeeded because of test not run)

In all case, "--with-memcached=/usr/bin/memcached" should work.

Agreed, I am reworking the logic right now.

My usage of the macro relied on a bit of the internals which have changed.

On Apr 10, 2013, at 10:51 PM, Remi Collet <email address hidden> wrote:

> Yes "false" is an actual application used to avoid search for
> "memcached" when not installed (and not nbeeded because of test not
> run)
>
> In all case, "--with-memcached=/usr/bin/memcached" should work.
>
> --
> You received this bug notification because you are subscribed to
> libmemcached.
> https://bugs.launchpad.net/bugs/1164440
>
> Title:
> broken --with_memcached option
>
> Status in libmemcached - A C and C++ client library for memcached:
> New
>
> Bug description:
> With version 1.0.17
>
> --with-memcached works as expected
> --with-memcached=/path/to/memcached doesn't work anymore
>
> In mem_config.h, HAVE_MEMCACHED_BINARY and MEMCACHED_BINARY are not
> defined
>
>
> Other related question.
>
> If build --without-memcached, shoudn't this contant be defined ? (as
> the are used in libtest, so expected to be always defined, as 0 or 1)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/libmemcached/+bug/1164440/+subscriptions

Brian Aker (brianaker) on 2013-04-11
Changed in libmemcached:
assignee: nobody → Brian Aker (brianaker)
importance: Undecided → Medium
status: New → In Progress
Brian Aker (brianaker) on 2013-04-19
Changed in libmemcached:
status: In Progress → Fix Committed
milestone: none → 1.0.18
jinjianmin (jianminjin) wrote :

hi, Brian Aker

are you sure 1.0.17 could compile after merge the diff below?i have tried but with no luck.

libtest/memcached.cc: In constructor 'libtest::Memcached::Memcached(const string&, in_port_t, bool, const string&, const string&)':
libtest/memcached.cc:75:21: error: 'MEMCACHED_BINARY' was not declared in this scope
libtest/memcached.cc: In constructor 'libtest::Memcached::Memcached(const string&, in_port_t, bool)':
libtest/memcached.cc:82:21: error: 'MEMCACHED_BINARY' was not declared in this scope
libtest/memcached.cc: In member function 'const char* libtest::Memcached::executable()':
libtest/memcached.cc:134:12: error: 'MEMCACHED_BINARY' was not declared in this scope
make[1]: *** [libtest/libtest_libtest_la-memcached.lo] Error 1
make[1]: *** Waiting for unfinished jobs....

any suggestion?

=== modified file 'm4/ax_memcached.m4'
2 --- m4/ax_memcached.m4 2013-07-18 10:28:37 +0000
3 +++ m4/ax_memcached.m4 2013-10-11 11:46:36 +0000
4 @@ -44,15 +44,26 @@
5 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
6 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7
8 -#serial 3
9 +#serial 4
10
11 AC_DEFUN([AX_PROG_MEMCACHED],
12 - [AX_WITH_PROG([MEMCACHED_BINARY],[memcached])
13 - AS_IF([test -f "$ac_cv_path_MEMCACHED_BINARY"],
14 - [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available])
15 - AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$ac_cv_path_MEMCACHED_BINARY",[Name of the memcached binary used in make test])
16 - ax_memcached_version=`$MEMCACHED_BINARY -h | sed 1q | awk '{print \$ 2 }' | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'`
17 - AC_MSG_RESULT([memcached version "$ax_memcached_version"])
18 - AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])
19 - ])
20 - ])
21 + [AX_WITH_PROG([MEMCACHED_BINARY],[memcached],[unknown])
22 + ax_memcached_success=
23 + AS_IF([test x"$MEMCACHED_BINARY" != xunknown],
24 + [AS_IF([test -x "$MEMCACHED_BINARY"],
25 + [ax_memcached_version=`$MEMCACHED_BINARY -h | sed 1q | awk '{print \$ 2 }' | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'`
26 + AS_IF([test -n "$ax_memcached_version"],
27 + [ax_memcached_success='ok'
28 + AC_MSG_RESULT([memcached version "$ax_memcached_version"])
29 + AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])])
30 + ])
31 + ])
32 +
33 + AS_IF([test -n "$ax_memcached_success"],
34 + [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available])
35 + AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$MEMCACHED_BINARY",[Name of the memcached binary used in make test])
36 + ],
37 + [AC_DEFINE([HAVE_MEMCACHED_BINARY], [0], [If Memcached binary is available])
38 + MEMCACHED_BINARY=
39 + ])
40 + ])

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers