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

Uncaught error on unlink (temporary corpus file does not exist) #5

Closed
yanmii-is opened this issue May 4, 2020 · 3 comments
Closed

Comments

@yanmii-is
Copy link

yanmii-is commented May 4, 2020

NEW    run: 15248 (17734/s), ft: 1229 (1429/s), corp: 196 (972b), len:  9/11, t: 1s, mem: 11mb
NEW    run: 15452 (17690/s), ft: 1233 (1412/s), corp: 197 (982b), len: 10/11, t: 1s, mem: 11mb
PHP Fatal error:  Uncaught Error: [2] unlink(/tmp/corpus-368695453/bc38758e6172b0db93523ee51ee8551c.txt): No such file or directory in phar:///home/yanmii/GitHub/php-fuzzer.phar/vendor/nikic/include-interceptor/src/Stream.php on line 246 in phar:///home/yanmii/GitHub/php-fuzzer.phar/src/Fuzzer.php:433
Stack trace:
#0 [internal function]: _HumbugBox4cfab3638a0b\PhpFuzzer\Fuzzer->_HumbugBox4cfab3638a0b\PhpFuzzer\{closure}()
#1 phar:///home/yanmii/GitHub/php-fuzzer.phar/vendor/nikic/include-interceptor/src/Stream.php(246): unlink()
#2 phar:///home/yanmii/GitHub/php-fuzzer.phar/vendor/nikic/include-interceptor/src/Stream.php(44): _HumbugBox4cfab3638a0b\Nikic\IncludeInterceptor\Stream->_HumbugBox4cfab3638a0b\Nikic\IncludeInterceptor\{closure}()
#3 phar:///home/yanmii/GitHub/php-fuzzer.phar/vendor/nikic/include-interceptor/src/Stream.php(247): _HumbugBox4cfab3638a0b\Nikic\IncludeInterceptor\Stream->runUnwrapped()
#4 [internal function]: _HumbugBox4cfab3638a0b\Nikic\IncludeInterceptor\Stream->unlink()
#5 phar:///home/yanmii/Gi in phar:///home/yanmii/GitHub/php-fuzzer.phar/src/Fuzzer.php on line 433

I wasn't able to reproduce this again, maybe caused by some race condition. I verified that that file in /tmp doesn't exist after the crash.

Edit: Randomly happened again:

REDUCE run: 611548 (6376/s), ft: 3602 (38/s), corp: 893 (34kb), len:  24/243, t: 96s, mem: 19mb
PHP Fatal error:  Uncaught Error: [2] unlink(/tmp/corpus-1784235601/d286bf815c4f8f3edfa26afc05978079.txt)
@nikic
Copy link
Owner

nikic commented May 9, 2020

Looking through the code, I don't see any obvious way how this can happen. Maybe a previous file_put_contents() call silently fails...

@kelunik
Copy link
Contributor

kelunik commented May 27, 2020

I had the same issue a couple of times today.

@nikic
Copy link
Owner

nikic commented Sep 11, 2020

Okay, I think I know what is going on now: We end up with the same input in the corpus twice, and then try to unlink both, the second one failing. We can get that second identical input through a reduction of another input. Will have to make sure things are deduplicated.

@nikic nikic closed this as completed in efcdc05 Sep 12, 2020
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

No branches or pull requests

3 participants