Skip to content
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

new test cases for bug #55169 #1

Closed
wants to merge 1 commit into from
Closed

new test cases for bug #55169 #1

wants to merge 1 commit into from

Conversation

yaauie
Copy link

@yaauie yaauie commented Jul 14, 2011

cherry-pick to 5.4 and 5.3 branches as needed.

@yaauie
Copy link
Author

yaauie commented Jul 20, 2011

I was given karma to commit these directly in SVN, so I'm closing this pull request and will be committing via SVN for the foreseeable future.

@yaauie yaauie closed this Jul 20, 2011
@ghost
Copy link

ghost commented Aug 30, 2011

  • L#80:

if((inp->s_addr= inet_addr(cp)) == INADDR_NONE);
{
return 0;
}

nikic referenced this pull request in nikic/php-src Dec 28, 2012
weltling referenced this pull request in weltling/php-src Jul 10, 2013
@Tyrael Tyrael mentioned this pull request Feb 20, 2014
morrisonlevi pushed a commit to morrisonlevi/php-src that referenced this pull request Apr 17, 2014
@hopeseekr hopeseekr mentioned this pull request Aug 21, 2014
php-pulls pushed a commit that referenced this pull request Feb 8, 2015
Porting implementation of RFC json_preserve_fractional_part
lt pushed a commit to lt/php-src that referenced this pull request Feb 24, 2015
Changes from my fork of rand-bytes
@dstogov dstogov mentioned this pull request Mar 30, 2015
weltling referenced this pull request in weltling/php-src May 25, 2015
Missing symbols to get it worky on Windows
@Mhar14 Mhar14 mentioned this pull request Nov 21, 2015
@dstogov dstogov mentioned this pull request Apr 6, 2016
php-pulls pushed a commit that referenced this pull request Jan 6, 2017
@HeavenCore HeavenCore mentioned this pull request May 9, 2024
devnexen added a commit that referenced this pull request Oct 13, 2024
even without sanitizers, it is reproducible but with the following

```
<?php
$g = gmp_init(256);
var_dump(gmp_pow($g, PHP_INT_MAX));
```

we get this

```
AddressSanitizer:DEADLYSIGNAL
=================================================================
==286922==ERROR: AddressSanitizer: FPE on unknown address 0x03e8000460ca (pc 0x7faf6c69de5c bp 0x400000000000004 sp 0x7ffe9843c740 T0)
    #0 0x7faf6c69de5c in __pthread_kill_implementation nptl/pthread_kill.c:44
    #1 0x7faf6c649c81 in __GI_raise ../sysdeps/posix/raise.c:26
    #2 0x7faf6db9386c in __gmp_exception (/lib/x86_64-linux-gnu/libgmp.so.10+0xd86c) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #3 0x7faf6db938d3 in __gmp_overflow_in_mpz (/lib/x86_64-linux-gnu/libgmp.so.10+0xd8d3) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #4 0x7faf6dbac95c in __gmpz_realloc (/lib/x86_64-linux-gnu/libgmp.so.10+0x2695c) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #5 0x7faf6dba9038 in __gmpz_n_pow_ui (/lib/x86_64-linux-gnu/libgmp.so.10+0x23038) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #6 0x5565ae1ccd9f in zif_gmp_pow /home/dcarlier/Contribs/php-src/ext/gmp/gmp.c:1286
    #7 0x5565aee96ea9 in ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:1312
    #8 0x5565af144320 in execute_ex /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:56075
    #9 0x5565af160f07 in zend_execute /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:60439
    #10 0x5565aed6fafe in zend_execute_scripts /home/dcarlier/Contribs/php-src/Zend/zend.c:1842
    #11 0x5565aeae70a8 in php_execute_script /home/dcarlier/Contribs/php-src/main/main.c:2578
    #12 0x5565af532f4e in do_cli /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:964
    #13 0x5565af535877 in main /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:1334
    #14 0x7faf6c633d67 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #15 0x7faf6c633e24 in __libc_start_main_impl ../csu/libc-start.c:360
    #16 0x5565adc04040 in _start (/home/dcarlier/Contribs/php-src/sapi/cli/php+0x2604040) (BuildId: 949049955bdf8b7197390b1978a1dfc3ef6fdf38)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE nptl/pthread_kill.c:44 in __pthread_kill_implementation
==286922==ABORTING
```
@jruston jruston mentioned this pull request Oct 21, 2024
devnexen added a commit that referenced this pull request Oct 25, 2024
even without sanitizers, it is reproducible but with the following

```
<?php
$g = gmp_init(256);
var_dump(gmp_pow($g, PHP_INT_MAX));
```

we get this

```
AddressSanitizer:DEADLYSIGNAL
=================================================================
==286922==ERROR: AddressSanitizer: FPE on unknown address 0x03e8000460ca (pc 0x7faf6c69de5c bp 0x400000000000004 sp 0x7ffe9843c740 T0)
    #0 0x7faf6c69de5c in __pthread_kill_implementation nptl/pthread_kill.c:44
    #1 0x7faf6c649c81 in __GI_raise ../sysdeps/posix/raise.c:26
    #2 0x7faf6db9386c in __gmp_exception (/lib/x86_64-linux-gnu/libgmp.so.10+0xd86c) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #3 0x7faf6db938d3 in __gmp_overflow_in_mpz (/lib/x86_64-linux-gnu/libgmp.so.10+0xd8d3) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #4 0x7faf6dbac95c in __gmpz_realloc (/lib/x86_64-linux-gnu/libgmp.so.10+0x2695c) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #5 0x7faf6dba9038 in __gmpz_n_pow_ui (/lib/x86_64-linux-gnu/libgmp.so.10+0x23038) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #6 0x5565ae1ccd9f in zif_gmp_pow /home/dcarlier/Contribs/php-src/ext/gmp/gmp.c:1286
    #7 0x5565aee96ea9 in ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:1312
    #8 0x5565af144320 in execute_ex /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:56075
    #9 0x5565af160f07 in zend_execute /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:60439
    #10 0x5565aed6fafe in zend_execute_scripts /home/dcarlier/Contribs/php-src/Zend/zend.c:1842
    #11 0x5565aeae70a8 in php_execute_script /home/dcarlier/Contribs/php-src/main/main.c:2578
    #12 0x5565af532f4e in do_cli /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:964
    #13 0x5565af535877 in main /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:1334
    #14 0x7faf6c633d67 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #15 0x7faf6c633e24 in __libc_start_main_impl ../csu/libc-start.c:360
    #16 0x5565adc04040 in _start (/home/dcarlier/Contribs/php-src/sapi/cli/php+0x2604040) (BuildId: 949049955bdf8b7197390b1978a1dfc3ef6fdf38)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE nptl/pthread_kill.c:44 in __pthread_kill_implementation
==286922==ABORTING
```

close GH-16384
Ma27 added a commit to Ma27/php-src that referenced this pull request Nov 8, 2024
On NixOS we run `make` & `make check` inside `ext/soap` which broke the test
like this:

    001+ Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'ext/soap/tests/gh15711.wsdl' : failed to load "ext/soap/tests/gh15711.wsdl": No such file or directory
    002+  in /build/php-8.3.13/ext/soap/tests/gh15711.php:29
    003+ Stack trace:
    004+ #0 /build/php-8.3.13/ext/soap/tests/gh15711.php(29): SoapClient->__construct('ext/soap/tests/...', Array)
    005+ php#1 {main}
    006+   thrown in /build/php-8.3.13/ext/soap/tests/gh15711.php on line 29

Fix is to make the path dependant on `__DIR__` as it's the case in other
testcases including WSDLs.
nielsdos pushed a commit that referenced this pull request Nov 8, 2024
On NixOS we run `make` & `make check` inside `ext/soap` which broke the test
like this:

    001+ Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'ext/soap/tests/gh15711.wsdl' : failed to load "ext/soap/tests/gh15711.wsdl": No such file or directory
    002+  in /build/php-8.3.13/ext/soap/tests/gh15711.php:29
    003+ Stack trace:
    004+ #0 /build/php-8.3.13/ext/soap/tests/gh15711.php(29): SoapClient->__construct('ext/soap/tests/...', Array)
    005+ #1 {main}
    006+   thrown in /build/php-8.3.13/ext/soap/tests/gh15711.php on line 29

Fix is to make the path dependant on `__DIR__` as it's the case in other
testcases including WSDLs.

Closes GH-16733.
divinity76 added a commit to divinity76/php-src that referenced this pull request Nov 27, 2024
in strict mode it's kindof annoying to have to cast-to-string when you have a string|int variable you need to urlencode.
There is no ambiguity as to how to urlencode integers, so it shouldn't be a problem.
"TypeError: urlencode(): Argument php#1 ($string) must be of type string, int given"
Has happened to me enough times now that I bothered to make PR to allow it.

Fwiw the integer path could be micro-optimized to bypass php_raw_url_encode() entirely, at least when the integer is not negative,
but for brewity, I didn't bother micro-optimizing it.
ericnorris added a commit to ericnorris/php-src that referenced this pull request Dec 5, 2024
This commit adds an INI setting, 'error_backtrace_recording', which
users can set to an error mask to enable backtraces for those errors.

It defaults to E_FATAL_ERRORS, meaning that any non-recoverable error
will now have a backtrace associated with it. For example, a script
timeout will now look like:

  Fatal error: Maximum execution time of 1 second exceeded in example.php on line 23
  Stack trace:
  #0 example.php(23): usleep(10000)
  php#1 example.php(24): recurse()
  php#2 example.php(24): recurse()
  ...

It respects the `zend.exception_ignore_args` INI setting and the
SensitiveParameter attributes, so users can ensure that sensitive
arguments do not end up in the backtrace.
ericnorris added a commit to ericnorris/php-src that referenced this pull request Jan 7, 2025
can enable or disable to control whether or not PHP produces backtraces
for fatal errors.

It defaults to enabled, meaning that any non-recoverable error will now
have a backtrace associated with it. For example, a script timeout will
now look like:

  Fatal error: Maximum execution time of 1 second exceeded in example.php on line 23
  Stack trace:
  #0 example.php(23): usleep(10000)
  php#1 example.php(24): recurse()
  php#2 example.php(24): recurse()
  ...

It respects the `zend.exception_ignore_args` INI setting and the
SensitiveParameter attributes, so users can ensure that sensitive
arguments do not end up in the backtrace.
ericnorris added a commit to ericnorris/php-src that referenced this pull request Jan 7, 2025
This commit adds an INI setting, 'fatal_error_backtraces', which users
can enable or disable to control whether or not PHP produces backtraces
for fatal errors.

It defaults to enabled, meaning that any non-recoverable error will now
have a backtrace associated with it. For example, a script timeout will
now look like:

  Fatal error: Maximum execution time of 1 second exceeded in example.php on line 23
  Stack trace:
  #0 example.php(23): usleep(10000)
  php#1 example.php(24): recurse()
  php#2 example.php(24): recurse()
  ...

It respects the `zend.exception_ignore_args` INI setting and the
SensitiveParameter attributes, so users can ensure that sensitive
arguments do not end up in the backtrace.
ericnorris added a commit to ericnorris/php-src that referenced this pull request Jan 8, 2025
Without this, the ext/soap tests would trigger a double stack trace:

```
  Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '/Users/enorris/workspace/php-src/ex\
t/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998\
/namespace' in /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run:2
  #0 /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run(2): SoapClient->__construct('/Users/enorris/...')
  php#1 {main}
    thrown in /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run on line 2
  Stack trace:
  #0 /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run(2): SoapClient->__construct('/Users/enorris/...')
  php#1 {main}
```
ericnorris added a commit to ericnorris/php-src that referenced this pull request Jan 8, 2025
Without this, the ext/soap tests would trigger a double stack trace:

```
  Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '/Users/enorris/workspace/php-src/ex\
t/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998\
/namespace' in /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run:2
  #0 /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run(2): SoapClient->__construct('/Users/enorris/...')
  php#1 {main}
    thrown in /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run on line 2
  Stack trace:
  #0 /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run(2): SoapClient->__construct('/Users/enorris/...')
  php#1 {main}
```
ericnorris added a commit to ericnorris/php-src that referenced this pull request Jan 8, 2025
Without this, the ext/soap tests would trigger a double stack trace:

```
  Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '/Users/enorris/workspace/php-src/ex\
t/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998\
/namespace' in /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run:2
  #0 /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run(2): SoapClient->__construct('/Users/enorris/...')
  php#1 {main}
    thrown in /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run on line 2
  Stack trace:
  #0 /Users/enorris/workspace/php-src/ext/soap/tests/bugs/bug62900_run(2): SoapClient->__construct('/Users/enorris/...')
  php#1 {main}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant