Bug 1431238

Summary: swig use non existing zend_error_noreturn function.
Product: [Fedora] Fedora Reporter: Martin Cermak <mcermak>
Component: swigAssignee: Jitka Plesnikova <jplesnik>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: atkac, besser82, jplesnik, jskarvad, ovasik, pamadio, pkovar, pmuller, qe-baseos-tools-bugs, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 679713 Environment:
Last Closed: 2017-03-14 09:39:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Cermak 2017-03-10 17:00:31 UTC
+++ This bug was initially created as a clone of Bug #679713 +++

f25 x86_64 # rpm -q gcc swig
gcc-6.3.1-1.fc25.x86_64
swig-3.0.11-1.fc25.x86_64
f25 x86_64 #
f25 x86_64 #
f25 x86_64 # cat example.i 
/* example.i */
%module example
%{
/* Put header files here or function declarations like below */
extern double My_variable;
extern int fact(int n);
extern int my_mod(int x, int y);
extern char *get_time();
%}

extern double My_variable;
extern int fact(int n);
extern int my_mod(int x, int y);
extern char *get_time();
f25 x86_64 #
f25 x86_64 # 
f25 x86_64 # swig -php7 example.i
f25 x86_64 # 
f25 x86_64 # gcc `php-config --includes` -E example_wrap.c | grep  'zend_error_noreturn'
__attribute__ ((visibility("default"))) __attribute__((cold)) __attribute__((noreturn)) void zend_error_noreturn(int type, const char *format, ...);
  zend_error_noreturn((1<<0L), "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
  zend_error_noreturn((1<<0L), "Possible integer overflow in %s (%zu * %zu + %zu)", message, nmemb, size, offset);
f25 x86_64 #

Comment 1 Jitka Plesnikova 2017-03-13 17:39:28 UTC
The using of function 'zend_error_noreturn' is not generated by SWIG.
The changes, used for fixing of BZ#679713, was applied in SWIG 2.0.2

The found code was included from php-devel libraries
/usr/include/php/Zend/zend.h
/usr/include/php/Zend/zend_multiply.h

'zend_error_noreturn' function is defined in /usr/include/php/Zend/zend.(h|c)