« first day (4022 days earlier)      last day (909 days later) » 

12:00 AM
This configure results in the unknown symbols when running make:
PKG_CONFIG_PATH="/Users/ramsey/Developer/build/icu/lib/pkgconfig:$PKG_CONFIG_PATH" ./configure --disable-all --disable-cgi --enable-debug --enable-zts --enable-intl
But this configure is fine and results in a clean build:
PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure --disable-all --disable-cgi --enable-debug --enable-zts --enable-intl
I know I don't need to pass PKG_CONFIG_PATH like that for the second example, but I was doing it anyway to rule out any problems passing it
 
@ramsey does your icu pkgconfig find a different lresolv?
 
oh... maybe
I didn't consider that it might be looking for lresolv, too
 
there's something weird going on with that lib on mac for while.
 
I prepended LIBS="$LIBS -lresolv" this time, and it built! But now, I'm getting this:
❯ ./sapi/cli/php -m
dyld: Library not loaded: libicuio.70.dylib
  Referenced from: /Users/ramsey/repos/php/php-src/./sapi/cli/php
  Reason: image not found
womp womp
 
sudo ldconfig /usr/local/lib
Find where libicuio.70.dylib is, and then run something similar to that command. Probably.
 
12:14 AM
I know where it is, but I don't want my system to know where it is :-)
 
I don't think that is a permanent setting.....and the libraries are versioned, so stuff compiled for ICU 69 won't suddenly switch to ICU 70.
 
gotcha
 
probably.
 
12:53 AM
I give up. macOS doesn't have ldconfig, but they do have a bunch of env vars you can set, like DYLD_LIBRARY_PATH, but setting that hasn't helped. I'll switch to using a Docker container for this.
 
1:18 AM
@ramsey What are you trying to do?
Just compile PHP on macOS?
Do you use brew at all?
 
2:12 AM
MySQL 5.5.3 corrected has a 4 byte encoding and a 3 byte encoding for UTF-8. Does anyone know when MySQL will correct which one utf-8 is referring to?
this is from 2019
ping me thanks
 
2:51 AM
@Trowski I don't have problems compiling PHP on macOS in general. I'm trying to link it against a different version of ICU to test something, and something about this is what's causing problems.
 
@ramsey I would expect env PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig ./configure ... to work. That's what I always have to do for icu.
 
@Trowski Same, but PHP couldn't find the ICU .so files after that.
Anyway, I was just able to do it in a Docker container, so all is well :-)
 
Yeah, probably the easier path.
 
this looks related to the issue I was having: bugs.php.net/bug.php?id=76403
 
 
2 hours later…
5:24 AM
@ramsey can you get me a shell on your machine ?
 
@JoeWatkins I was able to do what I needed to do in a Docker container. I wanted to play around with the newest ICU, but for some reason macOS is having difficulty linking things.
This is what I was working on: github.com/php/php-src/pull/7596
 
outside of a docker container, the linker will still link the system intl won't it ?
that's why you had to use a docker container ... it seems like a problem that needs fixing, internals tend not to be very confident when it comes to making changes to the build system for mac because historically we didn't test there and there weren't many devs using mac
 
I'd like to try to fix it, too, but I'm heading to bed. I'll see what I can do about opening up a shell to my machine (or some alternative), so we can look at it.
 
k, cool
 
 
2 hours later…
7:59 AM
@Derick Something for you: github.com/php/php-src/pull/7586
@ramsey @JoeWatkins Linking system libs on macos usually happens if you enable an extension that doesn't use pkg-config. That may explicitly add the system libdir and give it more precedence than desired
On linux we filter out the system dir, but on macos it is weird
 
8:33 AM
@NikiC Who are these people "Approving" PRs?
This "changelog" is as useful as phone app update changelogs: pecl.php.net/package-changelog.php?package=mysql_xdevapi (ie.: not at all)
 
Well "release" sounds more promising than just "bump" ^^
 
cmb
it's worse than having no changelog at all
 
8:55 AM
@Derick for this one (and some others), should read "no change" (Perhaps someday I will understand why a new release without any change...)
 
Unless it's a packaging error...
 
and they didn't apply my fix for broken build on modern distro....
 
9:16 AM
@Derick mostly people who want to take part, but don't have the time/skills, and who don't realise that noise is annoying.
 
@Danack It was a rhetorical question, really :-)
 
cmb
9:34 AM
@RemiCollet where is the repo? github.com/php/pecl-database-mysql_xdevapi has no 8.0.27 tag.
 
@cmb official repo is in some Oracle private area, sometime they push to github
 
cmb
great facepalm
@RemiCollet awesome ;)
 
9:53 AM
IMO, these packages without up to date public repo have no place on PECL.
 
10:25 AM
Morning
 
10:45 AM
Imagick has a function that has this signature when compiled against ImageMagick 6.x:
Imagick::posterizeImage(int $levels, bool $dither): bool  {}
When compiled against ImageMagick 7, there needs to be a slightly different function that has the signature:
enum DitherType {
  case DITHERMETHOD_NO = 1;
  case DITHERMETHOD_RIEMERSMA = 2;
  case DITHERMETHOD_FLOYDSTEINBERG = 3;
}

Imagick::posterizeXXXX(int $levels, DitherType $dither): bool  {}
What should XXXX be? Just nothing, 'withDither' or something else?
 
Just pick something and stop dithering...
 
D:
Could you do bool|DitherType on the single method and swap out true for a particular case?
 
Inconveniently, true = 1 and DitherType::DITHERMETHOD_NO = 1.
And they are currently ints as migrating the imagick constants from ints to enums will take time/effort.
Hence the separate methods.
 
I was thinking parse the param as zval and then if (Z_TYPE(dither) == IS_TRUE) { actual_dither = DitherType::DITHERMETHOD_WHATEVERYOURDEFAULTIS; }
 
11:04 AM
Far too many people (including myself) use 1 as true for options.
 
cmb
@Danack have you considered a third optional param, which is only effective if the second param is true?
 
12 mins ago, by Danack
user image
@cmb There's already enough of those: github.com/Imagick/imagick/issues/474
 
posterizeWithDither or posterizeEx would seem to make sense then
 
cmb
yeah, not a great idea, but that enum isn't a great idea either; DITHERMETHOD_NO should have been 0
 
Yeah.....but zero was used by DITHERMETHOD_UNDEFINED because being able to pass an undefined setting is useful? (I guess it's a preventative measure ....or some other reason that seemed sensible in 1987).
 
11:14 AM
dumb Q but can you just redefine them? as in expose different values to PHP vs what they are in their own headers
 
I could but then that would involve needing to migrate all users.....and you can't issue deprecation notices when constants are read.
 
In case people are for some reason using/serializing their raw values instead of the constants?
 
Eventually moving them to be enums provides more value - as that will catch dumb errors of using the wrong type. Just changing values sounds like work. And yeah...serializing or other hard-coding of constants.
 
@Derick I twittered about help with reviews on github
I'm surprised anyone came ... but don't shoo them away because they're not nikita
we do need help with this stuff, and lots of it ... and we can't expect anyone coming out of the wings to have the experience niki has ... this is how they get that experience, being involved ... even if they are wrong at first, even if you disagree with them, that's okay, there is no other way to learn ...
 
11:33 AM
morns
 
12:02 PM
@mega6382 o/
 
\o
 
12:37 PM
Just read through npopov.com/2021/10/20/Early-binding-in-PHP.html and the last paragraph is depressing.
 
12:57 PM
why is zend_weakref_register not ZEND_API? :-/
In my specific case, I'll access the object immediately after creation and create weakref to it, thus the trivial case is unproblematic for me here. But in general: why…?
Maybe ping @JoeWatkins as this was your code
 
why would that be public api?
 
@NikiC use case here is instrumentation - and we want to add metadata to some objects
 
Well you can't use this API for non-WeakReference/WeakMap objects
It doesn't support adding a weak reference to an arbitrary object that is not one of those two
 
@NikiC we can, because std is not accessed, only the first element of the struct
it's just not intended :-D but it works
 
Okay, not my problem then
 
1:09 PM
But I'd still like to be proper API if possible
comes essentially at zero-cost and avoids having to essentially copy the code
@NikiC so, why should it not be public api?
 
cmb
@Danack, are you still planning to pursue wiki.php.net/rfc/consistent_callables?
 
@cmb not really....think Nikic has done all the useful stuff from it, and if I did have any energy to work on something, it would be to allow something like type logger = callable(string $message): void;
 
cmb
fair enough; move to "withdrawn" then?
 
@bwoebi Because it interfaces with implementation details (e.g. tag encoding) and because using it requires abusing it (by relying on this wonderful fact you discovered, that it just so happens to null out the first 8 bytes of the pointer you pass it)
There may be room for a public API in there, but that function as-is clearly isn't it...
 
done.
 
1:23 PM
@NikiC yes, I agree on that the tag encoding is also best hidden away when providing an API. You wouldn't be opposed to a proper API though, right?
(If someone were to PR it)
 
@bwoebi yeah, generally okay with an API. I think you would have to use a new tag for it though, otherwise it will get looked up when uniquing WeakReference no?
I.e. if you create you internal weakref first and then call WeakReference::create() on the object it will return your internal weakref?
 
@NikiC that's right, or we restrict the API to weakmapping for now
technically a weakref is trivially implementable as weakmap entry with empty element
 
@bwoebi Ah, you're using only the weakmap side of it?
 
yes
 
Okay yeah, that doesn't have this problem.
 
cmb
1:38 PM
@Danack ta
 
@Danack In regards to that, does it start to make sense to deprecare call_user_func()? as one can just use the "sensible" way for "normal" callables, although that may be a bit early and just... for the sake of forcing people to use the 'new' proper way
 
1:53 PM
@NikiC for public API it's essentially ZEND_API void zend_weakrefs_add_hash(HashTable *ht, zend_object *obj); and ZEND_API void zend_weakrefs_del_hash(HashTable *ht, zend_object *obj); wich does nothing else than calling register and unregister with a MAP tagged pointer, right?
or do you prefer this also dong actual add/update/del on the ht? not sure what's preferable
 
@bwoebi sounds about right. I'd also change the implementation to work on HashTable* rather than zend_weakmap* for clarity
@bwoebi Hm, good question
 
@Derick None, blanked install with zend_extension=xdebug
 
@bwoebi Doesn't the del operation also drop from the HT though? In that case it would make sense for add to be symmetrical
 
@NikiC It did not in my thinking yet. But yep, symmetrical makes sense
@NikiC can we put that in 8.0 as well, or 8.1 only? adding ABI does not break it, right
 
@kelunik Can't reproduce it then :-/
Oh, I can now
 
2:36 PM
@Derick We were seeing accesses to GracefulExit::$code, etc.
 
Yes - I have an API question for you @Trowski and @kelunik
Given a fibre_context, how can I find out in which file that fiber was defined (or created) ?
 
I'm trying to make a one-page website that is a simple form. It gathers some fundamental info (CR, RR, CLTV, CAC and etc) from your current status and history of your business, and then depicts your business in short/long future plus giving you some estimated targets (about your business growth) for next 3 and 6 months. Something like a regression chart, but in details of marketing/business-development concepts.
Do you know any online similar product?
 
@Trowski @kelunik However, I think the main issue is is that GracefulExit, an exception, does not have the $code property at all?
#17 0x00007ffff4490024 in xdebug_throw_exception_hook (exception=0x7ffff42787d0) at /home/derick/dev/php/derickr-xdebug/src/base/base.c:1339
#18 0x0000555555ce9e78 in zend_throw_exception_internal (exception=0x7ffff42787d0) at /home/derick/dev/php/php-src.git/Zend/zend_exceptions.c:203
#19 0x0000555555d255ac in zend_fiber_delegate_transfer_result (transfer=0x7ffff3c0b940, execute_data=0x7ffff427f0e0, return_value=0x7ffff3c0ba30) at /home/derick/dev/php/php-src.git/Zend/zend_fibers.c:512
Xdebug simply tries to read the "exception"'s properties, including "code" - which doesn't exist, and then it crashes because I don't have a filename set for the fibre's main stack element (hence my question about that API)
 
2:52 PM
@Derick Right, it's a special exception like UnwindExit.
 
You're throwing an exception, but it is not an exception? That doesn't sound kosher.
And, how do I create such an UnwindExit special "exception" so that I can test with that as well?
 
exit() throws UnwindExit that isn't really an exception.
This is similar, but executes finally blocks.
Which is probably why this is coming up now, as UnwindExit never hit any of that code.
 
Since when does exit() do that?
Because if there is a zend_throw_exception_internal in there, it ought to cause the same problem...
IMO, with GracefulExit, you're abusing an API (the Exceptions API) and now this turns out to cause a problem because Xdebug expects that if there is an exception thrown, it is actually an Exception... and IMO, rightfully so.
How can I detect whether some "exception" is one of these fake special exceptions?
 
@Derick Since 8.0. Maybe before?
I'm surprised you didn't have to deal with this before TBH.
 
Right, but how would I know whether new things like this are going to be added in the future and it starts breaking again?
 
so there is a zend_is_unwind_exit... maybe there is one for graceful as well
@Trowski API question for Fibre: Given a fibre_context, how can I find out in which file that fiber was defined (or created) ?
 
3:21 PM
@Derick zend_fiber_from_context gets you the zend object
 
@Girgias meh.....that is used by so many pieces of code, unless there is a strong reason to remove it, just leave it as is......removing it could easily be >5,000 hours of work for downstream users to replace it.
 
(contains fci/fcc)
 
@Derick Yes, zend_is_graceful_exit.
 
@Trowski Already found zend_is_graceful_exit
@JoeWatkins Thanks, I'll have a look
 
@JoeWatkins That's where the callable was declared, no?
Not the fiber?
 
3:24 PM
@Trowski that is all we have though, right ?
it's either explain in whatever message you are constructing that you are referring to the function being executed, or we add some stuff, and some reflection ...
it's like, really really late for this kind of change
 
@cmb I don't understand. Do you want to have the same example on all three pages?
Each page should show how to use the given function
 
cmb
@Dharman @Derick suggested that: twitter.com/derickr/status/1450841505183191043
 
It isn't necessary to use password_needs_rehash(). As long as the parameters do not change the passwords doesn't need rehash
 
cmb
Well, the default algo may change, and I think it's important that users are aware of password_needs_rehash. But yeah, I don't think we need to show the full example everywhere.
 
I can't imagine someone creating an authentication system and not knowing about this function.
 
3:32 PM
You want people to do this all right. Showing the sample example on each of these pages shows the right workflow how to use these. You can't really safely use one of these functions stand-alone without understanding the context.
 
apart from novices doing this for learning purposes
 
I can. And have.
 
@Dharman Yeah, I didn't know about it either.
 
Is there any reason not to show the complete and proper way to use it on all the relevant pages?
 
or actually, use observer and reserved space to set the code location in your ext is probably nicest @Trowski @Derick
 
cmb
3:32 PM
@Derick, what is this. I cannot check out the repo on Windows because of the ? in the file name, and apparantly the PNG is corrupt anyway.
 
@Derick Have you developed an authentication system without it?
 
to be clear, init observer is executed when context is created, you can get location from zend at that point and put in reserved space
 
Then maybe we should have a new page that demonstrates how to implement an authentication system using all three of them.
 
@cmb No idea (it is from 2009), but I've removed it.
 
cmb
ta
 
3:35 PM
@Dharman I have used password_hash and password_verify without knowing about password_needs_rehash, yes.
 
cmb
me too
 
@Dharman You're expecting way too much from users
@Danack Thought so
 
I mean... shouldn't it be part of every tutorial? Besides, there are only 5 functions there.
 
Have you seen most tutorials?
 
I shouldn't need to read a tutorial if I am learning about what a function does.
It hurts nothing to put this in a snipper and reuse it. Verbosity is awesome in docs (though duplication is not)
 
3:40 PM
They are hot garbage, also the officials docs should show the correct usage
 
FTR I did write an authentication system without using it temporarily but I was fully aware of the repercussions and I knew I could do so. I added it later on though.
 
And what Derick said
I wrote some, without knowing it's existence, and never thought I'd need it
 
These pages do show proper usage.
you could argue that echo password_hash("rasmuslerdorf", PASSWORD_DEFAULT); is not a proper usage
this is showing what the arguments should be and what the output is
password_needs_rehash is a nice function to have, but it isn't going to break your code if you don't use it.
 
@JoeWatkins Which is when start() is called, but that should be fine I think.
 
If the consensus is that it helps to raise awareness of it if we include an example on every one of the 3 pages, then let's do so, but it isn't because the examples are broken right now.
 
3:44 PM
But why keep the function in isolation, except if you want to put a note saying that people should be aware of the rehash function and use it, why not have it in the example...
 
@Trowski yeah started in file on line sounds right to me
 
FWIW, that seems more useful than zend_fiber_from_context
 
4:07 PM
@Derick I would generally avoid that if possible, since it's possible a future fiber would not be a zend_fiber (say if we use fibers internally for I/O).
 
Yeah, I went with:
tmp->filename = zend_string_init(zend_get_executed_filename(), strlen(zend_get_executed_filename()), 0);
tmp->lineno = zend_get_executed_lineno();
 
As part of your existing handler on init?
 
I construct a pseudo "stack top" with (to->status == ZEND_FIBER_STATUS_INIT) in the switch observer.
So the Xdebug output for that issue that @kelunik filed is now:
Fatal error: Uncaught FiberError: Cannot switch fibers in current execution context in /home/derick/dev/php/derickr-xdebug/tests/base/bug02036.php on line 11

FiberError: Cannot switch fibers in current execution context in /home/derick/dev/php/derickr-xdebug/tests/base/bug02036.php on line 11

Call Stack:
    0.3624          0   1. {fiber:8E35280}() /home/derick/dev/php/derickr-xdebug/tests/base/bug02036.php:15
    0.3677          0   2. {closure:/home/derick/dev/php/derickr-xdebug/tests/base/bug02036.php:7-13}() /home/derick/dev/php/derickr-xdebug/tests/base/bug02036.php:15
Just need to solve my memory leak...
 
@Derick Seems right. $fiberB is destroyed, but $fiberA cannot be entered during a destruct call.
 
4:53 PM
I need to work on the observer API to include space on the VM stack. Thinking about requesting some number of "slots" where 1 slot is the size of a zval. If an observer tried to do this directly, there would be a catastrophic edge case where the current VM stack wasn't full for the call, but then the observer pushes it over the edge. This way observers can store info with a call on the stack, removing the most major advantage of the zend_execute_ex API.
 
5:08 PM
@Dharman If you realllly want to raise awareness, raise a dep notice when verifying passwords that need rehashing.
 
That would probably result in people locking the algo and options instead of them upgrading hashes :)
 
That sounds like it would be more work than adding the rehash check.
 
Why would that be more work?
One is hard coded the algo and the other is adding the check, rehashing and storing in db
 
They'd have to try and understand the extra arguments =)
 
:P
 
5:26 PM
@MarkR That would only be justified if one of the algorithms becomes deprecated or is found to have a serious flaw
 
6:02 PM
Yo!
 
Yo Dan o/
 
\o
Long time no visit, how's everything?
I’ve taken on job that has a legacy PHP monolith, so I’ll probably be floating around here again.
Random question; is there a commonly accepted format for denoting line/column text ranges? (1:10) for the location line 1 column 10, but … (1:10,5:30) to denote a range from line 1 column 10 to line 5 column 30?
 
Not that I am aware of. Welcome back. May you be paid greatly for your legacy PHP monolith work.
 
6:34 PM
@DanLugg o/
 
@LeviMorrison We can only hope ;-)
@Tiffany \o
I know a lot of IDEs can auto-link <filename>(<line>:<col>) in console output, hence the question; wasn't sure if line-ranges or similar was something common enough.
 
I haven't seen anything like it
 
6:54 PM
@DanLugg not range, but /foo/bar/Injector.php:475:20 goes to the exact position.
 
@LeviMorrison do you intend to reserve that slot for all frames? i.e. each frame would be e.g. a zval bigger if one requests one slot.
I cannot imagine how a per-frame solution would even work with more than one observer making use of the feature.
 
7:07 PM
@DanLugg Congratudolences!
 
7:37 PM
@Danack Ah, that's the format I meant; colon-delimited 👍
I know IntelliJ (and all derivatives) uses that format (and I think they might need to be encapsulated in parens too, (file:line:col))
@StatikStasis Thank... you ;-)
 
7:56 PM
o/
 
8:34 PM
@bwoebi What part would make that difficult in your head?
 
8:55 PM
@LeviMorrison which observer gets the nth slot?
 
It's the sum of previous observers number of slots, or something close to that.
Although we may want to store which slot is is for the .end case so it doesn't have to compute/walk it in the opposite direction -- not sure which is worse.
 
actually … I have an idea how we could do it
essentially, we just need to store the slot number of the previous frame in the current slots zval.u2
and keep track of the topmost slot number
… but we need to know which frames contain a slot
probably it wouldn't even be so bad to simply have the module number in zval.u2, and an observer can just search for that number in the extra slots of the frame
linearly, assuming that the number of allocated slots will always be low
@LeviMorrison in the case we could even just ensure there is enough space for all observers … so like put the vm_end 4 slots below the actual end if there are 4 observers
or something similar to that
then we don't need much extra magic or thoughts - we need to just ensure that all extensions provide a bounded number of slots they may use
 
If I get what you are saying, on every call ensure there is space for every slot needed by every observer, but don't actually allocate it; let them bump it?
 
@LeviMorrison yes, essentially, and we ensure that by just setting lowering EG(vm_stack_end) by the maximum number of slots the extensions wish to allocate (when allocating a stack page)
(as to not introduce extra overhead)
assuming that the sum of slots counts needed by every observer is low enough, this should generally not present a problem
 
9:38 PM
@StatikStasis If you'd care for something a bit more chill youtube.com/watch?v=oHKnz1GoeB8
 
Are there new people with write access to GitHub account?
 
9:51 PM
@Dharman what makes you ask?
 
I have seen some new people today approve and commit
For example the latest commit on php-en
 
From alfsb? They've been around for a loooong time, mostly the Portuguese docs translation.
The last time anyone was added to the GitHub org, or a team, was 2 weeks ago.
 
I don't know if github fixed/change this, but it was possible for randos to "approve" a PR, even though it did nothing... it's essentially nonsense that made people go "wat"
 
 
1 hour later…
11:23 PM
@Girgias sorry I missed this - because void is a declaration that the specific implementation doesn't return anything, it does not follow that an override can't return anything
 

« first day (4022 days earlier)      last day (909 days later) »