-
Notifications
You must be signed in to change notification settings - Fork 7.9k
remove specialized printing from phpdbg #7156
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
Conversation
97faa12
to
f363689
Compare
@nikic can you take a quick glance at this please ... it turned out much more involved than I would have liked. When I enabled format checking everything blew up ... it works now, but is there anything that could be obviously better ? |
Damn it, no vasprintf on windows and 'p' looks broken in ap_php_* @cmb69 any ideas ? |
You're looking for a _phpdbg_asprintf replacement right? This looks the same as zend_spprintf to me (with the difference that spprintf uses per-request allocator). |
@nikic the problem seems to be that whatever api we call we end up in format_converter, which has a broken 'p' specifier (unused in php-src, I think, so uncaught). I wish I'd noticed this 8 hours ago when I started. My last commit makes the output correct, although some segv on windows doesn't necessarily look related ... so awaiting av run. |
@krakjoe I see. We stopped using |
Looks like the spprintf implementation actually handles this correctly: Lines 342 to 349 in 591dcdb
|
#7159 for a defensive approach to removing |
Rebased on #7159, thanks ... await CI ... should be good now, I think ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK. I think we'd usually use uint32_t for linenos, but it doesn't really matter either way.
static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */ | ||
{ | ||
if (!phpdbg_active_sigsafe_mem()) { | ||
fflush(PHPDBG_G(io)[PHPDBG_STDOUT].ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering why this is gone now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer write buffered (FILE*) streams anywhere, this looks like a left over relic rather than necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense.
This quickly turned into a nightmare ... phpdbg is using bad format specifiers everywhere, and we got no warnings about it because they were disabled because of special format specifiers that phpdbg implemented ....