php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ivanov at nplusplus dot de
New email:
PHP Version: OS:

 

 [2012-03-14 20:32 UTC] ivanov at nplusplus dot de
Description:
------------
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 :-(


Patches

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

History

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] tony2001@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: tony2001
 [2012-03-25 11:37 UTC] tony2001@php.net
-Status: Assigned +Status: Feedback
 [2012-03-25 11:37 UTC] tony2001@php.net
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] tony2001@php.net
Automatic comment from SVN on behalf of tony2001
Revision: http://svn.php.net/viewvc/?view=revision&revision=324533
Log: fix bug #61392 (build failure with new version of libsphinxclient)
 [2012-03-25 20:14 UTC] tony2001@php.net
-Status: Feedback +Status: Closed
 [2012-03-25 20:14 UTC] tony2001@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 00:01:28 2024 UTC