### Description The following code: ```php <?php $c = fopen("data:,", 'rb'); fseek($c, -10, SEEK_END); fseek($c, 1, SEEK_CUR); ``` Resulted in this output: ``` php: src/main/streams/streams.c:1433: php_stream_seek: Assertion `stream->position >= 0' failed. Aborted ``` But I expected this output instead: The second fseek simply returns with ``-1`` It seems like the assert here https://github.com/php/php-src/blame/94519df8b69ad4c886789b983254695675de22c0/main/streams/streams.c#L1433 does not consider the sentinel value ``-1``. Execution on non-debug builds is not affected. ### PHP Version ```plain PHP 8.7.0-dev (cli) (built: Nov 29 2026 21:29:01) (NTS DEBUG) Copyright © The PHP Group and Contributors Zend Engine v4.7.0-dev, Copyright © Zend by Perforce with Zend OPcache v8.7.0-dev, Copyright ©, by Zend by Perforce ``` ### Operating System Ubuntu 24.04
Activity
devnexen commentedon Dec 5, 2026
Hi @lmaltsis can you try building the last master branch with change I just committed ?
lmaltsis commentedon Dec 5, 2026
I've built from commit badd28d and I still get the same assertion failure on the debug build.
devnexen commentedon Dec 5, 2026
ah you re right, ok going to work on a fix.
devnexen commentedon Dec 5, 2026
nvm someone has, I think, already went in the right direction.