« first day (3342 days earlier)      last day (1589 days later) » 

3:27 AM
\o
 
 
2 hours later…
5:30 AM
@NikiC ah, so I retract what I said yesterday ... I read as far as accel_finish_startup ...
I reserve the right to giggle a little when we find extensions that are incompatible, but it does a complete startup prefork ... it still might break expectations about process model because it's different now, but at least the extensions are started properly during execution of the preload script ...
 
 
3 hours later…
8:07 AM
@JoeWatkins So, it's really not so much a matter of "extensions definitely won't break preloading", but more a matter of "preloading is currently so broken that extensions aren't the first place I'd look" :P
 
8:20 AM
o/
 
@NikiC yeah :)
 
Hello.
I am getting an error in '[3, 5]' does not match expected type "array".
but when I am returning the data as array, the error is:
Array () does not match expected type "string".
 
8:39 AM
@AjayMishra What gives you this error?
 
 
2 hours later…
10:54 AM
@Derick You might want to wait a bit with tagging 7.4.1 today...
 
@JoeWatkins @ircmaxell @cmb Do you want to attend Russia next year? ) I want to kindly invite you to the PhpRussia2020 conference to deliver your hardcore talks about PHP internals or advanced stuff like compilers, FFI, etc.
 
@NikiC What's broken?
 
@NikiC How so?
 
@NikiC would you mind joining us at PhpRussia? )
 
cmb
11:02 AM
@lisachenko, thanks, but I'm certainly not up to give a talk at a conf yet (if ever) :)
@Derick, preloading has serious issues, and Nikita just submitted a PR.
@NikiC, would that fix the anon class issue as well?
 
@cmb ok, thanks )
 
@NikiC What's the timeframe for Dmitry reviewing this?
 
you can't reference internal classes on windows during preload ?
I'm missing a reason for that ?
 
cmb
@JoeWatkins, nope, due to ASLR randomizing heap
guess we would need more MAP_PTRs
too late for 7.4 (and maybe not desired at all)
 
so to write a portable preloader for your thing, you can't reference internal classes ...
that's a really stupid restriction
 
11:14 AM
@JoeWatkins Wrong conclusion: Preloading just isn't a thing on Windows
It would make more sense to just disable it completely though
@cmb nope, that's a separate problem
 
but I see it, hobbling along and emitting errors ... if our position is that preloading shouldn't be a thing on windows, then make it so, but by having it hobble along, it's continuing to be a thing on windows ..
 
@JoeWatkins ack
 
cmb
@NikiC, so this PR basically makes PHP fail if not everything can be resolved/linked?
 
I see, having thought about it for a couple of minutes, preloading doesn't make a lot of sense on windows whatever ...
 
@cmb yes, if require-based preloading is used
opcache_compile_file based preloading can recover gracefully
 
11:22 AM
there's no forking, the class tables are duplicated, I see what's going on ... disable the thing, it doesn't and can't make sense, and if you make it work it will win you nothing ...
 
@NikiC I do need a timing, as I'm not around tomorrow and thursday morning GMT
 
@Derick later today?
 
Is this only a problem for Windows?
 
no the pr addresses a general issue
(and applies to the fix necessary restrictions on windows)
preloading doesn't work the way I imagined it would, I imagined that at the point of fork (activate), the runtime would be in a preloaded state, but it's not, opcache generates the state prefork but stores it internally to opcache and restores it upon fork (activate) ... that seems awkward ...
it would be really helpful if someone would take down the broken badly built wall between zend and opcache, it's getting difficult to reason about how the thing works now, I'm tripping over bits of broken wall ...
it's not really preload, it's reload ...
 
cmb
AIUI, it's mostly about pre-linking/-resolving
 
11:41 AM
@JoeWatkins Another hack like FFI is?
 
well I'm sure dmitry thought about it for longer than I have ... but I'm becoming increasingly anxious about things going on in opcache that should be going on in zend, it feels like preloading ought to be a feature of the runtime, but it's hard to imagine how that would work with the broken wall in the way, which is why it's an awkward feature of the cache ... but the cache has to do real work to restore state and it looks like a less than optimal solution ...
on it's face, it doesn't make a lot of sense that you have to duplicate that which you preload, the point of preloading is surely to avoid duplication, or if not the point a very significant advantage ... lost to the complexities of the way the compiler and even parts of the executor are not accessible from one another in code and reside in different folders, the layers aren't just mixed in code but in the head of everyone actually ... including it's creator ...
still I won't say any of this to dmitry, he thinks he's keeping things simple by hiding the complexity outside of zend ..
 
11:58 AM
@JoeWatkins what is getting duplicated?
I think I don't understand your original point about how preloading works
 
opcache overrides class/function tables on compile, so that during preload the runtime isn't modified, it stores that state in the normal way (persistent script structures), right ?
then everything is loaded from those internal opcache structures on activate
that's reloading, isn't it ?
 
If I knew what active is...
Preload state is stored in opcache, so yes, it needs to be loaded from opcache (once)
 
yes, that's the duplication I referred too, call it whatever, but stuff is copied ... it's not actually pre-loaded, it's copied at the right time ...
in a perfect world, at the end of the execution of a preload script (which could call include/require), it would be executor globals that were effected, and they would just work (tm) on fork (and require special treatment for zts like everything does) ... and I stupidly imagined we were living in a perfect world ...
 
12:41 PM
/home/nikic/php-src-fast/Zend/zend.h:214:12: error: ‘__orig_bailout’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   JMP_BUF *__orig_bailout = EG(bailout);     \
you gotta be kidding me
how can a variable with an explicit initializer be uninitialized...
 
Does it attempt to infer that the EG(bailout) might be uninit? :-D
 
yes
maybe
I don't know
It's very persistent
 
1:02 PM
Afternoon all. Looks like you're all having a bit of a rough day.
Without wanting to overstep my knowledge, which is practically non-existent in this field, could the preloader be ran twice? At the end of the first one, dump everything that's been required or opcache_compile_file'd, and then run it again with that list and use that as the pre-fork data?
 
1:39 PM
@cmb @JoeWatkins github.com/php/php-src/pull/4999 thoughts?
 
+42
 
cmb
@NikiC, I find that quite hard. I mean, opcache_compile_file() based preloading basically seems to work on Windows, and at least parts of the code-base can be preloaded.
 
+1 would make it 5000
 
@cmb Work as in does not crash
But classes are going to be skipped, and the more type references you have, the more is going to get skipped
I'll posit that people who deploy to production on Windows do not need preloading. The only real value I see there is to allow people who work on Windows to more easily test preloading. But they will see a very different version of preloading from everyone else
 
agree, if you're deploying to windows in production speed is probably not your main concern ...
 
cmb
1:47 PM
Isn't the question how much of a given code-base can be preloaded on Windows, and how much difference that made performance wise? I think we're lacking any concrete numbers on that for now.
Is FastCGI with IIS that slow?
 
given the restrictions we know about, we don't need to see concrete numbers, we can infer that only an insignificant portion of any real world code base will be preloadable ...
there are only two reasonable courses of action, given we know we can't really support it, and that's disable it by force, or have opcache.preload behave differently on windows such that it emulates preload ... I prefer disabling it by force ...
 
cmb
hmm, just to clarify: classes can't be loaded if the extend or implement internal classes/interfaces, but not if the declare variables to be of such type?
 
@NikiC I am supposed to write a function which returns proper divisors of a given number.
My function is:
function divisors($integer) {
  $e = array();
  $count = 0;
  for($i = 2;$i <= $integer/2;$i+=1)
  {
    if ($integer%$i == 0)
      $e[] = $i;
      $count += 1;

  }
  if ($count === 0)
  {
    return $integer.' is prime';
  }
  return $e;
}
 
@cmb Extend or implement or use as property type, or, depending on circumstances, use as argument or return type
 
cmb
ugh, that's way worse than I thought
 
1:55 PM
"depending on the position of the moon" is not a thing you want to include in the manual for preloading ...
 
The "depending on circumstances" is a bit complicated and can be improved, some argument / return types will work fine
but yeah, it's not just extends/implements
 
What exactly is the problem with ASLR on windows? Is it not possible to remap chosen values (i.e. the internal class entries) to fixed addresses?
(as in: two different memory addresses pointing to the same memory)
 
I don't think anyone has tried too hard to make that work but ...
 
MapViewOfFileEx on itself
 
Windows already seems to have problems just getting the same mmap base address for all processes (which is why having a file cache fallback is required)
Maybe @cmb can say more
 
cmb
2:00 PM
Yes, mmap base address is an issue, but shouldn't fail bad as of 7.4. Have to think about work-arounds for heap ASLR.
 
@bwoebi I don't think that would work, as the memory of the class would still contain pointers into original memory, not remapped memory?
 
cmb
And indeed, that Win restriction went unnoticed until a week ago. :(
 
my only hesitation is people who write library code that requires preload are going to be a little annoyed maybe ... I mean, you shouldn't do that, but I heard at least one conversation along those lines in here already ...
 
@NikiC why would that be an issue? these addresses are available within the process
 
cmb
Preload only won't work on Windows, even if all classes could be preloaded, some processes may fall back to file cache.
 
2:02 PM
it's not like the internal addresses of the memory of the class are shared
 
@bwoebi oh sorry, brain fart
 
All what is needed is that the outer values (i.e. the class entry memory itself) are at a fixed address
 
cmb
@bwoebi, I don't think that could reliably work, since dwDesiredAccess is just ... desired.
And that is the problem. Heap is at random address.
 
I also strongly suspect that we kindof assume that classes have a unique address ;)
 
@NikiC hm, yeah
 
2:05 PM
Things like instanceof checks would likely break
... but in very fun ways :P
 
:-D
 
hm ... maybe there was something to that bailout warning after all
 
JMP_BUF is a weird macro thingy I think
 
@bwoebi Is something wrong in github.com/php/php-src/blob/… or where the function is used?
 
nice, I found a vld segfault
 
2:19 PM
Because there was the warning and now I'm getting a longjmp segfault, so maybe there is a genuine issue that I just don't see
okay, this one is easy ... not allowed to return from zend_try
but I only added that to fix the warning :( argh
 
@Sjon surprise surprise ;-)
 
@Derick haha, well it was for me, pretty sure it's the first one I've ever spotted
 
I only accept bug reports if they come with a patch ;-)
 
thankfully github doesn't enforce that yet ;)
 
I do
 
2:29 PM
Anyone seen laruence lately?
 
3:00 PM
@Trowski github.com/amphp/websocket/commit/… what am I missing? receive() will never throw or have the promise fail?! It's only reading the Message object which might fail if I read that correctly - but mustn't part of this docblock?
I.e. yield $client->receive() will never throw on its own or where is that ClosedException supposed to come from?
 
@NikiC last failure on latest apcu version:
003+ #0 [internal function]: {closure}()
004+ #1 /home/ludoge/vendor/php-apcu/stretch/src-7.4-zts/tests/apc_entry_002.php(4): apcu_entry()
003- #0 [internal function]: {closure}('test')
004- #1 %s(4): apcu_entry('test', Object(Closure))%
(zts build, if it helps)
 
@FlorianMargaine i see
you have exception args disabled
this needs to be fixed in run-tests.php
 
thanks
do you need a more formal bug report somewhere?
 
Morning!
 
@NikiC had a report about this one, too, recently
 
3:15 PM
!!uptime
Jeeves not here
 
@FlorianMargaine @m6w6 github.com/php/php-src/commit/…
 
3:50 PM
@NikiC wait, is your avatar actually your version of the e8 lie group? :P
I just noticed it reeally looks like it
 
@NikiC on mobile and far from my computer but I'm not sure I understood your comment on the SPL PR.
 
@Girgias SplFileObject mirror f* APIs
I.e. SplFileObject::fgetcsv and fgetcsv
 
Aaaaa, okay gotcha
But SPL already throws some exceptions in cases where f* returns false
I think the empty directory for SplDirectory throws an InvalidArgument exception where I'm supposing its notmal function variation only returns false
But will have a look tomorrow or tonight
 
@Ekin Well, if it is, then it's only a part of it ;)
But really, it's just a 32-gon with all points connected
 
:D cool
 
4:04 PM
@beberlei @JoeWatkins For the PHP 8 tracing API, I have realized that delivering an exception or error separately from the .end endpoint would likely result in a significant increase in memory. In my experience, users are more tolerant of time increases than memory increases.
I think using some sort of flag to .end is prudent, and it's not just EG(exception); what if the user is calling exit() and we are ending the instrumentation? There won't be a retval, so the instrument needs to understand that somehow.
There may be other cases than exit. Let me know if you think of anything, as exit might use an exception in PHP 8 anyway /cc @NikiC
 
@NikiC thanks
you rock :)
 
4:34 PM
@NikiC Any news on the preloading thing?
Because if I'm tagging today, it is going to have to be now
 
@Derick landed, so should be good to tag
 
chance of it actually being fixed? :-)
 
@Derick Well ... it fixes something
There are still some known problems ;)
 
cmb
5:01 PM
@NikiC, how bad would it be if zend_string_release() is called twice on a string with refcount==1?
s/would/could
 
@cmb very bad?
 
cmb
sad panda
 
@cmb context?
 
I'm annoyed each time I see a private marked bug :-/
 
5:14 PM
^ I second that
 
cmb
Me as well. :)
 
cmb
Thanks a lot!
 
@cmb Won't this always release the string one time too many?
I mean, even if it's not lowercase
 
cmb
I don't think so, since lc != trim in this case.
 
5:26 PM
@cmb oh, right :)
 
Wes
5:42 PM
@FélixGagnon-Grenier woa fruits really make me go off. i ate a tangerine just for the vitamin c and went completely off keto
 
@Wes thanks for reminding me. 😛 I have a bag of mandarins next to me
 
Wes
ah you call them mandarins also
what's the difference?
 
The mandarin orange (Citrus reticulata), also known as the mandarin or mandarine, is a small citrus tree with fruit resembling other oranges, usually eaten plain or in fruit salads. The tangerine is a group of orange-colored citrus fruit consisting of hybrids of mandarin orange. Mandarins are smaller and oblate, rather than spherical, like the common oranges (which are a mandarin hybrid). The taste is considered less sour, as well as sweeter and stronger. A ripe mandarin is firm to slightly soft, heavy for its size, and pebbly-skinned. The peel is thin, with little white mesocarp, so they are usually...
I dunno, you tell me
 
 
3 hours later…
8:30 PM
@NikiC Do you see any reason for github.com/php/php-src/blob/… to exist? If I use FFI::cast('uint8_t*', $nameBuffer) instead of $nameBuffer directly, everything works fine.
 
@kelunik / @Trowski I think I would appreciate some more examples with cluster using the messaging. I only discovered that this existed at all by actually reading the library code.
It's quite obvious, but should be shown off I think
 
@bwoebi Feel free to PR ;-)
 
Also what I notice: I'm copying large chunks of logic from bin/cluster, just to adapt it very slightly
I.e. I want to use the $watcher messaging - but yeah, bin/cluster is sort of a walled off script and if I want to use $watcher I basically need to copy and extend that one
I basically need a setupClusterWatcher(League\CLIMate\Argument\Manager $arguments = null): $watcher function which does basically everything: args parsing, instantiating the watcher etc.; just not straight out running it
Not sure if that's just me … @kelunik ?
Small suggestion on bin/cluster: check if stdout is tty and conditionally use line or console formatters - when I use systemd I'm not specifying a file, but want to see stderr in syslog
Or is there any reason it's not done that way?
 
9:18 PM
@bwoebi Feel free to PR ;-)
@bwoebi I haven't felt the need to extend the base script, but it was totally intended to be copied in case you really need it. Suggestions welcome.
 
@Wes yeah, I think I've seen that too with some foods. Depending on how long before I get back in ketosis after however, I find that's a compromise I'm willing to make, we still need varied nutrients :)
 
Wes
10:20 PM
@FélixGagnon-Grenier i am not sure how responsive the test is
maybe it was some other thing that caused it
i tested like after 4 hours or something
 
that's plausible
iirc I noticed effects of carbs after some hours
but it's somewhat hard to isolate exactly what food does what... for a few weeks I'd write down literally everything I would eat to cross check what did what
 
Wes
could also be tomato, but that should be like 4g@100g
mandarins have a lot of carbs but i didn't think i would go way off
dunno
 
can't you guys eat like spinach for vitamin C? or kale
 
Wes
yes
dunno, the mandarin felt more safe :B will not do the same mistake again
 
might be "safer"
lol, you got mandarins after I suggested them?
 
Wes
10:33 PM
in fact i just didn't want to waste them, since i had bought them... still have a few
no, we sort of call the small oranges mandarins both
i have no idea what's the difference
 
ahh
@Ekin where did @PeeHaa run off to? and did he take @Jeeves with him?
 
Wes
we call them clementine (like the song) and mandarini
oh my darling oh my darling oh my darling mandarini
no that's not it
 
I try to buy a specific brand of mandarins. I'm picky.
 
@Wes 11g/100 is not that bad :) if you eat like, one it would probably be ok
 
you guys remind me how grateful I am that weight hasn't been an issue for me and for the most part can eat what I want
I just have a really small stomach, I fast most of the day
granted, I am out of shape and need to exercise more
 
10:49 PM
do we look in pain? ;)
 
Wes misses pasta
shrug, I don't like restricted diets
 
I understand you :) I think I've been lucky to feel this less like a restricted diet (over time), and more like paying attention to what I'm eating more / learning my food's composition
carbs are but a small part of any food's composition, and while other folks get there by themselves, starting to read what food actually contains has been a very interesting journey so far
I must say, that so far I still prefer composition over inheritance
 
My controllers are the bastard son of inheritance <3 You've not lived until you've done middleware using 10 layers of inheritance.
 
that sounds painful lol
 
@MarkR my Switch is currently in front of me, at first I thought you were talking about game controller, lol
 
11:03 PM
It actually works really well when your data is hierarchical, in my case:

Session Admin extends Session extends Library extends Client extends Admin.

Each layer adds its own properties, methods etc, and then it's all ran by chaining up using parent::.
I tried re-creating it using a classic middleware pattern, but having to go through an array for storage was killer
 
@MarkR what's a "library"?
 
Internal name for a folder-like structure belonging to a client.
 
@kelunik Feels weird to me to have an extra RequestCookie class from Request->getCookie ... which you anyway access by name - why does that not simply return the value?
 
11:59 PM
can anyone help in this post stackoverflow.com/questions/59276113/…
 

« first day (3342 days earlier)      last day (1589 days later) »