Skip to content

PowerPC64 support in safe_address function #734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

PowerPC64 support in safe_address function #734

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 23, 2014

Add a ppc64-specific implementation of the safe_address function with overflow
checking.

@laruence
Copy link
Member

Hmm, I don't have a PowerPC64, someone can review this? or should we just commit it?

"r"(offset));

if (overflow) {
printf("Possible integer overflow in memory allocation (%zu * %zu + %zu)\n", nmemb, size, offset);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use one of the zend_error_ functions here.

@remicollet
Copy link
Member

From a quick test build (5.6.0RC4 on RHEL-7 ppc64), those PR (734-737) increase number of failed tests (from 6 to 62)

diff of "FAILED TEST SUMMARY":

+Test + operator : 64bit long tests [tests/lang/operators/add_basiclong_64bit.phpt]
+Test & operator : 64bit long tests [tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt]
+Test ~N operator : 64bit long tests [tests/lang/operators/bitwiseNot_basiclong_64bit.phpt]
+Test | operator : 64bit long tests [tests/lang/operators/bitwiseOr_basiclong_64bit.phpt]
 Test << operator : 64bit long tests [tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt]
 Test << operator : various numbers as strings [tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt]
 Test >> operator : 64bit long tests [tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt]
+Test ^ operator : 64bit long tests [tests/lang/operators/bitwiseXor_basiclong_64bit.phpt]
+Test / operator : 64bit long tests [tests/lang/operators/divide_basiclong_64bit.phpt]
+Test % operator : 64bit long tests [tests/lang/operators/modulus_basiclong_64bit.phpt]
+Test * operator : 64bit long tests [tests/lang/operators/multiply_basiclong_64bit.phpt]
+Test -N operator : 64bit long tests [tests/lang/operators/negate_basiclong_64bit.phpt]
+Test == operator : max int 64bit range [tests/lang/operators/operator_equals_variation_64bit.phpt]
+Test == operator : max int 64bit range [tests/lang/operators/operator_notequals_variation_64bit.phpt]
+Test N-- operator : 64bit long tests [tests/lang/operators/postdec_basiclong_64bit.phpt]
+Test N++ operator : 64bit long tests [tests/lang/operators/postinc_basiclong_64bit.phpt]
+Test --N operator : 64bit long tests [tests/lang/operators/predec_basiclong_64bit.phpt]
+Test ++N operator : 64bit long tests [tests/lang/operators/preinc_basiclong_64bit.phpt]
+Test - operator : 64bit long tests [tests/lang/operators/subtract_basiclong_64bit.phpt]
 Bug #20382 [2] (strtotime ("Monday", $date) produces wrong result on DST changeover) [ext/date/tests/bug20382-2.phpt]
 Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts) [ext/date/tests/bug33415-2.phpt]
 Bug #33532 (Different output for strftime() and date()) [ext/date/tests/bug33532.phpt]
+Bug #67247 (spl_fixedarray_resize integer overflow) [ext/spl/tests/bug67247.phpt]
+Test abs function : 64bit long tests [ext/standard/tests/math/abs_basiclong_64bit.phpt]
+Test acos function : 64bit long tests [ext/standard/tests/math/acos_basiclong_64bit.phpt]
+Test acosh function : 64bit long tests [ext/standard/tests/math/acosh_basiclong_64bit.phpt]
+Test asin function : 64bit long tests [ext/standard/tests/math/asin_basiclong_64bit.phpt]
+Test asinh function : 64bit long tests [ext/standard/tests/math/asinh_basiclong_64bit.phpt]
+Test atan2 function : 64bit long tests [ext/standard/tests/math/atan2_basiclong_64bit.phpt]
+Test atan function : 64bit long tests [ext/standard/tests/math/atan_basiclong_64bit.phpt]
+Test atanh function : 64bit long tests [ext/standard/tests/math/atanh_basiclong_64bit.phpt]
+Test ceil function : 64bit long tests [ext/standard/tests/math/ceil_basiclong_64bit.phpt]
+Test cos function : 64bit long tests [ext/standard/tests/math/cos_basiclong_64bit.phpt]
+Test cosh function : 64bit long tests [ext/standard/tests/math/cosh_basiclong_64bit.phpt]
+Test decbin function : 64bit long tests [ext/standard/tests/math/decbin_basiclong_64bit.phpt]
+Test dechex function : 64bit long tests [ext/standard/tests/math/dechex_basiclong_64bit.phpt]
+Test decoct function : 64bit long tests [ext/standard/tests/math/decoct_basiclong_64bit.phpt]
+Test deg2rad function : 64bit long tests [ext/standard/tests/math/deg2rad_basiclong_64bit.phpt]
+Test exp function : 64bit long tests [ext/standard/tests/math/exp_basiclong_64bit.phpt]
+Test expm1 function : 64bit long tests [ext/standard/tests/math/expm1_basiclong_64bit.phpt]
+Test floor function : 64bit long tests [ext/standard/tests/math/floor_basiclong_64bit.phpt]
+Test fmod function : 64bit long tests [ext/standard/tests/math/fmod_basiclong_64bit.phpt]
+Test hypot function : 64bit long tests [ext/standard/tests/math/hypot_basiclong_64bit.phpt]
+Test is_finite function : 64bit long tests [ext/standard/tests/math/is_finite_basiclong_64bit.phpt]
+Test is_infinite function : 64bit long tests [ext/standard/tests/math/is_infinite_basiclong_64bit.phpt]
+Test is_nan function : 64bit long tests [ext/standard/tests/math/is_nan_basiclong_64bit.phpt]
+Test log10 function : 64bit long tests [ext/standard/tests/math/log10_basiclong_64bit.phpt]
+Test log1p function : 64bit long tests [ext/standard/tests/math/log1p_basiclong_64bit.phpt]
+Test log function : 64bit long tests [ext/standard/tests/math/log_basiclong_64bit.phpt]
+Various pow() tests [ext/standard/tests/math/pow.phpt]
+Test pow() - basic function test pow() [ext/standard/tests/math/pow_basic_64bit.phpt]
+Test pow function : 64bit long tests [ext/standard/tests/math/pow_basiclong_64bit.phpt]
+Test pow() function : usage variations - different data types as $base argument [ext/standard/tests/math/pow_variation1_64bit.phpt]
+Test rad2deg function : 64bit long tests [ext/standard/tests/math/rad2deg_basiclong_64bit.phpt]
+Test round function : 64bit long tests [ext/standard/tests/math/round_basiclong_64bit.phpt]
+Test sin function : 64bit long tests [ext/standard/tests/math/sin_basiclong_64bit.phpt]
+Test sinh function : 64bit long tests [ext/standard/tests/math/sinh_basiclong_64bit.phpt]
+Test sqrt function : 64bit long tests [ext/standard/tests/math/sqrt_basiclong_64bit.phpt]
+Test tan function : 64bit long tests [ext/standard/tests/math/tan_basiclong_64bit.phpt]
+Test tanh function : 64bit long tests [ext/standard/tests/math/tanh_basiclong_64bit.phpt]
+Test chunk_split() function : usage variations - different integer values for 'chunklen' argument(Bug#42796) [ext/standard/tests/strings/chunk_split_variation5.phpt]
+Test chunk_split() function : usage variations - different integer values for 'chunklen' with heredoc string as 'str'(Bug#42796) [ext/standard/tests/strings/chunk_split_variation8.phpt]

@laruence
Copy link
Member

@vitordelima could you please fix the problems?

@ghost
Copy link
Author

ghost commented Aug 19, 2014

Sure, I will take a look at it.

Add a ppc64-specific implementation of the safe_address function with overflow
checking.
@smalyshev
Copy link
Contributor

looks like this needs a rebase

@gustavotemple
Copy link

The PR #734 has been rebased in the PR #919

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants