Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Thread safe build failure #1

Closed
NewEraCracker opened this Issue January 20, 2012 · 3 comments

2 participants

NewEraCracker stefanesser
NewEraCracker

Attempt to build php with:
configure --disable-all --enable-cli --enable-session --enable-zlib --enable-object-out-dir="." --enable-one-shot --enable-suhosin="shared"

Error:
ext\suhosin\post_handler.c(171) : error C2065: 'tsrm_ls' : undeclared identifier
ext\suhosin\post_handler.c(174) : error C2065: 'tsrm_ls' : undeclared identifier

If I add TSRMLS_FETCH(); after zend_ini_entry *ini_entry; on line 168 build no longer fails.
I don't know if this change is appropriate or not but seems to fix the issue for me.

NewEraCracker

This is full report of warnings errors when trying to build suhosin with visual studio 2008 and php 5.3 sources:

ext\suhosin\execute.c(169) : warning C4018: '<=' : signed/unsigned mismatch
ext\suhosin\header.c(212) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\execute.c(169) : warning C4018: '>=' : signed/unsigned mismatch
ext\suhosin\execute.c(212) : warning C4018: '<=' : signed/unsigned mismatch
ext\suhosin\execute.c(212) : warning C4018: '>=' : signed/unsigned mismatch
ext\suhosin\execute.c(1090) : warning C4033: 'ih_function_exists' must return a value
ext\suhosin\execute.c(1321) : warning C4293: '>>' : shift count negative or too big, undefined behavior
ext\suhosin\execute.c(1322) : warning C4293: '>>' : shift count negative or too big, undefined behavior
ext\suhosin\execute.c(1323) : warning C4293: '>>' : shift count negative or too big, undefined behavior
ext\suhosin\execute.c(1334) : warning C4244: '=' : conversion from 'double' to 'php_uint32', possible loss of data
ext\suhosin\execute.c(1347) : warning C4133: 'function' : incompatible types - from 'php_uint32 ' to 'unsigned char *'
ext\suhosin\execute.c(1319) : warning C4101: 'fd' : unreferenced local variable
ext\suhosin\execute.c(1504) : warning C4033: 'ih_getrandmax' must return a value
ext\suhosin\execute.c(1139) : warning C4715: 'ih_function_exists' : not all control paths return a value
ext\suhosin\execute.c(1515) : warning C4715: 'ih_getrandmax' : not all control paths return a value
ext\suhosin\ifilter.c(417) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(425) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(433) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(441) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(459) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(465) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(473) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(479) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(487) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(493) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(501) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(507) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(526) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(534) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(542) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(550) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(564) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(572) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(580) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ifilter.c(588) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\log.c(242) : warning C4013: 'gettimeofday' undefined; assuming exter
ext\suhosin\log.c(89) : warning C4101: 's' : unreferenced local variable
ext\suhosin\log.c(89) : warning C4101: 'r' : unreferenced local variable
ext\suhosin\post_handler.c(170) : error C2065: 'tsrm_ls' : undeclared identifier
ext\suhosin\post_handler.c(173) : error C2065: 'tsrm_ls' : undeclared identifier
ext\suhosin\session.c(387) : warning C4244: '=' : conversion from 'long' to 'cha
ext\suhosin\session.c(547) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'char (
)[4]'
ext\suhosin\session.c(547) : warning C4024: 'suhosin_get_ipv4' : different types for formal and actual parameter 1
ext\suhosin\session.c(647) : warning C4018: '>' : signed/unsigned mismatch
ext\suhosin\session.c(691) : warning C4018: '>' : signed/unsigned mismatch
ext\suhosin\session.c(734) : warning C4018: '>' : signed/unsigned mismatch
ext\suhosin\session.c(864) : warning C4090: '=' : different 'const' qualifiers
ext\suhosin\session.c(799) : warning C4101: 'ps_globals_id_ptr' : unreferenced local variable
ext\suhosin\rfc1867.c(1103) : warning C4018: '>' : signed/unsigned mismatch
ext\suhosin\rfc1867.c(1108) : warning C4018: '>' : signed/unsigned mismatch
ext\suhosin\ufilter.c(106) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ufilter.c(112) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ufilter.c(118) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ufilter.c(124) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ufilter.c(141) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ufilter.c(147) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ufilter.c(159) : warning C4018: '<' : signed/unsigned mismatch
ext\suhosin\ufilter.c(165) : warning C4018: '<' : signed/unsigned mismatch

NewEraCracker

Hello,
I've also spotted that there is an unhook that isn't called ( suhosin_unhook_session )

I've done the following patch which, I believe, fixes the build issues, calls suhosin_unhook_session, and fixes a comment in session.c

http://pastebin.com/Vin6NGFW

stefanesser
Owner

ZTS build is fixed in GIT HEAD

Some compile warnings have been fixed

suhosin_unhook_session() is not called intentionally, because it caused problems depending on extension load order.

stefanesser stefanesser closed this February 12, 2012
Jesús jhg referenced this issue November 30, 2013
Closed

Merge 3 branchs #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.