Issue 219 in memcached: make error "array subscript is above array bounds" for v>=1.4.5 on Opensuse; patch workaround included

20 views
Skip to first unread message

memc...@googlecode.com

unread,
Aug 21, 2011, 4:40:03 PM8/21/11
to memc...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 219 by b845...@klzlk.com: make error "array subscript is above
array bounds" for v>=1.4.5 on Opensuse; patch workaround included
http://code.google.com/p/memcached/issues/detail?id=219

lsb_release -rd
Description: openSUSE 11.4 (i586)
Release: 11.4
uname -sr
Linux 2.6.37.6-0.7-default
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-suse-linux/4.5/lto-wrapper
Target: i586-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.5
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib
--with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new
--disable-libstdcxx-pch --enable-version-specific-runtime-libs
--program-suffix=-4.5 --enable-linux-futex --without-system-libunwind
--enable-gold --with-plugin-ld=/usr/bin/gold --with-arch-32=i586
--with-tune=generic --build=i586-suse-linux
Thread model: posix
gcc version 4.5.3 20110428 [gcc-4_5-branch revision 173117] (SUSE Linux)


cd /usr/local/src
rm -rf memcached*
setenv MEMC_VER "1.4.7"
wget http://memcached.googlecode.com/files/memcached-${MEMC_VER}.tar.gz
tar zxvf memcached*gz

cd /usr/local/src/memcached*/
./configure
make
make all-recursive
make[1]: Entering directory `/usr/local/src/memcached-1.4.7'
Making all in doc
make[2]: Entering directory `/usr/local/src/memcached-1.4.7/doc'
make all-am
make[3]: Entering directory `/usr/local/src/memcached-1.4.7/doc'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/usr/local/src/memcached-1.4.7/doc'
make[2]: Leaving directory `/usr/local/src/memcached-1.4.7/doc'
make[2]: Entering directory `/usr/local/src/memcached-1.4.7'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -DNDEBUG -O2 -mtune=generic
-march=native -pthread -Wall -Werror -pedantic -Wmissing-prototypes
-Wmissing-declarations -Wredundant-decls -MT memcached-memcached.o -MD -MP
-MF .deps/memcached-memcached.Tpo -c -o memcached-memcached.o `test
-f 'memcached.c' || echo './'`memcached.c
cc1: warnings being treated as errors
memcached.c: In function ‘try_read_command’:
memcached.c:2359:9: error: array subscript is above array bounds
memcached.c:2359:9: error: array subscript is above array bounds
memcached.c:2363:14: error: array subscript is above array bounds
memcached.c:2363:14: error: array subscript is above array bounds
memcached.c:2363:14: error: array subscript is above array bounds
make[2]: *** [memcached-memcached.o] Error 1
make[2]: Leaving directory `/usr/local/src/memcached-1.4.7'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/memcached-1.4.7'
make: *** [all] Error 2

applying a found patch
(https://svn.erp5.org/repos/public/erp5/trunk/patches/memcached-1.4-fix-array-subscript-is-above-array-bounds.patch)
seems to remedy the problem,


cat fix-array-subscript-is-above-array-bounds.patch
# zypper si memcached
# cat /usr/src/packages/SOURCES/memcached-1.4.5.dif

--- memcached.c.orig 2011-07-12 00:37:00.000000000 -0700
+++ memcached.c 2011-07-17 20:14:53.000000000 -0700
@@ -2360,15 +2360,18 @@
inline static void process_stats_detail(conn *c, const char *command) {
assert(c != NULL);

- if (strcmp(command, "on") == 0) {
+ char on[] = "on";
+ char off[] = "off";
+ char dump[] = "dump";
+ if (strcmp(command, on) == 0) {
settings.detail_enabled = 1;
out_string(c, "OK");
}
- else if (strcmp(command, "off") == 0) {
+ else if (strcmp(command, off) == 0) {
settings.detail_enabled = 0;
out_string(c, "OK");
}
- else if (strcmp(command, "dump") == 0) {
+ else if (strcmp(command, dump) == 0) {
int len;
char *stats = stats_prefix_dump(&len);
write_and_free(c, stats, len);

cd /usr/local/src/memcached*/
make clean
patch -p0 < ../fix-array-subscript-is-above-array-bounds.patch
patching file memcached.c
Hunk #1 succeeded at 2356 (offset -4 lines).
./configure
make
...
make[2]: Leaving directory `/usr/local/src/memcached-1.4.7'
make[1]: Leaving directory `/usr/local/src/memcached-1.4.7'
>
make install
ls -al `which memcached`
-rwxr-xr-x 1 root root 93136 Aug 21 13:34 /usr/local/bin/memcached


memc...@googlecode.com

unread,
Sep 28, 2011, 12:58:02 AM9/28/11
to memc...@googlegroups.com

Comment #1 on issue 219 by dorma...@rydia.net: make error "array subscript
is above array bounds" for v>=1.4.5 on Opensuse; patch workaround included
http://code.google.com/p/memcached/issues/detail?id=219

This patch makes super little sense to me. Why would it fail on that
section, but not the ten other areas which have the same exact code? Don't
see this error on any other platforms as well.

I'd like to sit down with a suse instance and play with it. I don't have
one nor does my KVM setup work at the moment, so I'm going to punt for
1.4.9. If you or someone has a shell I can use to fiddle, I'd take a look.

memc...@googlecode.com

unread,
Sep 28, 2011, 4:59:26 AM9/28/11
to memc...@googlegroups.com

Comment #2 on issue 219 by dsalli...@gmail.com: make error "array subscript
is above array bounds" for v>=1.4.5 on Opensuse; patch workaround included
http://code.google.com/p/memcached/issues/detail?id=219

Issue 223 has been merged into this issue.

Reply all
Reply to author
Forward
0 new messages