|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61392 make error
Submitted: 2012-03-14 20:32 UTC Modified: 2012-03-25 20:14 UTC
From: ivanov at nplusplus dot de Assigned: tony2001 (profile)
Status: Closed Package: sphinx (PECL)
PHP Version: 5.4.0 OS: Linux 64bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ivanov at nplusplus dot de
New email:
PHP Version: OS:


 [2012-03-14 20:32 UTC] ivanov at nplusplus dot de
PHP 5.4.0
sphinx 2.0.4

Test script:
niki@anthrax:~/Downloads/sphinx-1.1.0/trunk$ make
/bin/bash /home/niki/Downloads/sphinx-1.1.0/trunk/libtool --mode=compile cc  -I. -I/home/niki/Downloads/sphinx-1.1.0/trunk -DPHP_ATOM_INC -I/home/niki/Downloads/sphinx-1.1.0/trunk/include -I/home/niki/Downloads/sphinx-1.1.0/trunk/main -I/home/niki/Downloads/sphinx-1.1.0/trunk -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /home/niki/Downloads/sphinx-1.1.0/trunk/sphinx.c -o sphinx.lo 
mkdir .libs
 cc -I. -I/home/niki/Downloads/sphinx-1.1.0/trunk -DPHP_ATOM_INC -I/home/niki/Downloads/sphinx-1.1.0/trunk/include -I/home/niki/Downloads/sphinx-1.1.0/trunk/main -I/home/niki/Downloads/sphinx-1.1.0/trunk -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /home/niki/Downloads/sphinx-1.1.0/trunk/sphinx.c  -fPIC -DPIC -o .libs/sphinx.o
/home/niki/Downloads/sphinx-1.1.0/trunk/sphinx.c: In function ‘zim_SphinxClient_setRankingMode’:
/home/niki/Downloads/sphinx-1.1.0/trunk/sphinx.c:780:2: error: too few arguments to function ‘sphinx_set_ranking_mode’
/usr/local/include/sphinxclient.h:206:17: note: declared here
/home/niki/Downloads/sphinx-1.1.0/trunk/sphinx.c: In function ‘zim_SphinxClient_updateAttributes’:
/home/niki/Downloads/sphinx-1.1.0/trunk/sphinx.c:1048:6: warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:77:1: note: expected ‘int’ but argument is of type ‘void *’
make: *** [sphinx.lo] Error 1

Expected result:
It seems the sphinx_set_ranking_mode in the sphinxclient.h of 2.0.4 needs 2 parameters.
sphinx_bool sphinx_set_ranking_mode ( sphinx_client * client, int ranker, const char * rankexpr );

Fixing the memset issue with 0 instead of NULL and adding the missing third parameter sphinx_set_ranking_mode as 0 or NULL makes the compile successfull.

Nevertheless the result is in segmentation fault after that :-(


sphinx.c.diff (last revision 2012-03-24 18:31 UTC by pfalcone at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-24 18:35 UTC] pfalcone at gmail dot com
I've also hit this issue, and issued a patch (sphinx.c.diff). Works so far, but I 
haven't tested it extensively. The patch also changes the parameter list of 
setRankingMethod() and will probably break backward compatibility with older 
versions of libsphinxclient.
 [2012-03-25 11:36 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: tony2001
 [2012-03-25 11:37 UTC]
-Status: Assigned +Status: Feedback
 [2012-03-25 11:37 UTC]
Would be also nice to have a short reproduce script for that segfault.
 [2012-03-25 14:22 UTC] ivanov at nplusplus dot de
Thanks! Applying the patch to sphinx.c at r319648 in trunk  did it.
I could build without any problems and have no further problems.
 [2012-03-25 20:01 UTC]
Automatic comment from SVN on behalf of tony2001
Log: fix bug #61392 (build failure with new version of libsphinxclient)
 [2012-03-25 20:14 UTC]
-Status: Feedback +Status: Closed
 [2012-03-25 20:14 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Ok, I applied a little bit different version of your patch along with some more fixes for compile warnings and stuff.
Please test the latest SVN version, if possible.
 [2012-03-28 17:13 UTC] ivanov at nplusplus dot de
Just checked out trunk at r324608.
I don't notice any problems!
For me it is working.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jan 29 16:05:54 2023 UTC