返回

操作系统

搜索 导航

suse11.4 安装memcache 报错array subscript is above array bounds 解决

发布于: 2011-34-29   作者:黎明lm   来源:转载   浏览:

suse11.4 安装memcache 报错:

 

make error "array subscript is above array bounds" 

 

这是memcache 在suse11.4 上的一个bug.因此需要打一个补丁去解决

 

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
 

 


 

  • 0

    开心

  • 0

    板砖

  • 0

    感动

  • 0

    有用

  • 0

    疑问

  • 0

    难过

  • 0

    无聊

  • 0

    震惊

line
IT610手机版 Processed in 0.164 second(s)