« first day (3782 days earlier)      last day (1163 days later) » 

12:58 AM
Error handler that throws ErrorException infinite loop ・ Reproducible crash ・ #80781
 
 
2 hours later…
3:20 AM
$ sort < /tmp/profiler.log  | uniq -c | sort # log data for 5 minutes
      7 microtime [#0]
    238 loop_for [/usr/local/src/loop2.php#9]
   2972 loop_for [/usr/local/src/loop2.php#10]
   2972 usleep [#0]
   3210  [/usr/local/src/loop2.php#14]
 151101  [#0]
$ cat -n loop2.php
     1	<?php
     2
     3	function abs_minus(float $a, float $b) {
     4	  return $a > $b ? $a - $b : $b - $a;
     5	}
     6
     7	function loop_for(float $duration) {
     8	  $started_at = \microtime(true);
     9	  while (abs_minus(\microtime(true), $started_at) < $duration) {
Format:
$function [$file#$line]
Without the patch, microtime and usleep will never show. More realistically, that would be like pdo::exec.
That's the motivation for changing it /cc @NikiC
 
3:37 AM
Gist for the Zend/zend_vm_def.h changes. If I call the regular interrupt check macros I get sigsegvs when interrupts trigger.
 
4:22 AM
Is there any way, I could use php to create a cool real-time multiplaqyer game, like with streams or sockets?
 
 
3 hours later…
7:52 AM
@LeviMorrison So you're using interrupts for a sampling profiler?
@LeviMorrison Need to also drop the interrupt checks at the end of the opcode (don't use SET_OPCODE)
 
8:11 AM
moin phomies
 
8:23 AM
DASM_S_RANGE_VREG on PHP_INT_MIN-1 ・ JIT ・ #80782
 
8:53 AM
morns
yo @Joe
 
@JoeWatkins hi :)
 
 
1 hour later…
10:12 AM
PDO ODBC truncates BLOB records at every 256th byte ・ PDO ODBC ・ #80783
 
 
3 hours later…
12:52 PM
@JoeWatkins \o
 
1:40 PM
Support for xpath 2.0 ・ SimpleXML related ・ #80784
 
Morning o/
 
2:42 PM
Am experiencing a weird issue with my server ssl
At times it returns the proper certificate but at times it gives me a localhost certificate
running the following command echo | openssl s_client -connect mydomain.com:443 -servername mydomain.com 2>/dev/null | awk '/Certificate chain/,/---/'
results in
Certificate chain
 0 s:/C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost/emailAddress=root@localhost
   i:/C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost/emailAddress=root@localhost
at times it resolves as below
Certificate chain
 0 s:/CN=mydomain.com
   i:/C=US/O=Let's Encrypt/CN=R3
 1 s:/C=US/O=Let's Encrypt/CN=R3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
Anyone faced this with apache2 server
 
@NikiC Experimenting, yeah. There is an existing open source profiler called Excimer which does this already.
Not having internal functions in the sample is a big deal.
So for older versions I'll probably have to install a zend_execute_internal or something too.
(Or just do it unsafely from the other thread like I initially did)
 
3:05 PM
@NikiC Yeah, figured. If someone (like Excimer) runs PHP code in an interrupt handler, is there anything else I should do for the interrupt handler in the middle?
 
@LeviMorrison How are they running the code?
 
I'll find the relevant regions. Been a while since I looked.
Here's the timer which sets the VM interrupt flag. Here's the Zend VM interrupt handler. Here's the callback that calls PHP code.
The exact function name looks like it gets passed into ExcimerTimer::start.
/cc @NikiC
 
@LeviMorrison Okay, that looks unproblematic
 
Alright, time to figure out what objections Dmitry has :)
 
3:28 PM
@NikiC They may change the global exception.
Any idea how to handle that?
 
as usual?
as in, HANDLE_EXCEPTION ^^
 
Sorry, I'm not sure what usual is. In ddtrace we do weird things.
We're trying hard to get as much into upstream so we can stop doing weird things ^_^
@NikiC Do I need to do that after cleaning up the internal function call frame calling the interrupt check? Or will that get handled just fine?
 
Ignore the issue I posted it was some external misconfiguration issue
 
@LeviMorrison Actually, I don't think you need to do anything. Just test if it works (pcntl can be used) ^^
 
@NikiC I was going to email the whole internals list, but maybe I should just email Dmitry?
What do you think?
 
3:42 PM
@LeviMorrison Just mailing dmitry makes more sense
 
 
4 hours later…
7:27 PM
@NikiC Is PHP roughly interrupt safe? I know we use a timer + interrupt to set the execution timeout, and that code generally doesn't horribly crash if you time out again, so maybe yes? Asking because I realized my profiler would be much nicer on ZTS builds if I could safely interrupt the executing threads to set that thread's interrupt handler. I've been doing it in another thread.
It would be nicer on NTS builds too, but on ZTS it's more extreme.
But, I'd be interrupting like 100s of times per second throughout the whole request; much different than once per 30 seconds, and at the end of the request.
 
8:21 PM
@LeviMorrison no
 
@NikiC Can you expand that at all?
 
Interrupts will interrupt certain syscalls (even with sa_restart)
It's pretty likely that you will encounter observable behavior differences
 
Yes, I'm aware. They aren't designed to handle interrupts?
 
Not really
 
We should send random interrupts in debug builds or something to fix it :)
 
8:30 PM
❤️
 
@NikiC IIRC that's what go did; at least I think it was go. Heard it through an anecdote. Sent signals randomly to force the library ecosystem to handle them.
 
9:22 PM
Am I just not figuring it out or do we not have a function where you can take a template string, pass it an array of values it should replace it with, and return you an array? I though str_replace() would do the trick but that wouldn't work >_>
 
cmb
strtr() ?
 
@LeviMorrison fuzz testing is really fun (I recognize this isn't precisely that, but still
 
Just need to reframe it: it's interrupt handler fuzzing :)
 
@cmb Not really :-/
Trying to replace this:
foreach ($paths as $path) {
$xmlPaths[] = '<file role="test" name="' . $path . '" />';
}
with a function call as I would have imagined PHP had something backed in
 
$xmlPaths = array_map(fn($path) => '<file role="test" name="' . $path . '" />', $paths); ?
 
9:36 PM
I'm still writing a callback, but I suppose nothing better really
 
Eugh, feels so clunky compared to paths.map(p => '<file role="test" name="' . $path . '" />')
 
str_replace($placeholder, $values, $template); would have been my logical go to
But you can't have $values as an array when placeholder is not >_>
 
could use array_fill to create the list, although im not sure what it would achieve
 
bleh that's just obfuscating it more x)
 
Well yar, I'd have just used your original foreach loop :P
 
10:12 PM
@Girgias This is for package.xml, isn't it?
 
10:39 PM
Complex inheritance depends on interface order ・ *General Issues ・ #80785
 
11:18 PM
when it comes to covid I am about as conservative as it gets, but man I wanna go dance around like a dick a nightclub :-/
 
11:52 PM
Wouldn't say no myself, but as soon as nightclubs re-open it's going to be spike-orama
I guess it depends if people are going to be offered the vaccine pre-freshers.
 

« first day (3782 days earlier)      last day (1163 days later) »