« first day (3870 days earlier)      last day (1077 days later) » 
00:00 - 20:0020:00 - 00:00

12:11 AM
I forgot there's a subtle breaking bad reference in that song
This really is the best bad song ever.
 
 
1 hour later…
1:29 AM
lazy question that I'm not exactly sure how to google: I am working with an XML document uses a namespace wp... do I need to register a namespace to find a node value from a DOMNode? e.g. ... sec
foreach ($termNode->childNodes as $childNode) {
    if ($childNode->nodeValue === 'wp:term_taxonomy') {
        var_dump($childNode); // empty
I can var_dump $childNode outside of the if statement and it produces results
 
@Danack Wow, this terrible.
 
@Tiffany $termNode is formed from an XML Reader object via expand: $termNode = $reader->expand(); also $reader->name === 'wp:term' works :|
I'm guessing the namespace is the issue, and probably needs registering, but I'm not sure if that's it...
though typing that out has kinda given me something to google stackoverflow.com/questions/44785898/domdocument-with-namespace
 
1:54 AM
@Tiffany nodeValue, not nodeName?
 
__get() called accessing existing property which failed with TypeError before ・ Class/Object related ・ #81064
 
@Trowski I thought it was nodeValue, but maybe it is nodeName. I'll try it out in the morning. Thanks.
@Jeeves sigh, duplicate bugs.php.net/bug.php?id=79620 I think
@Jeeves or I should completely read the bug report before dismissing outright
 
3:05 AM
o/
 
@Crell how many people are you expecting at the picnic, like a rough estimate. I should note up front that while I can be entertaining online, I'm more like a brick wall in person (cc @Sara)
@JoeWatkins \o
 
moin tiffany
 
Are you sleeping better, Joe?
 
couple of five hour sleeps in the last couple of days, so, a little better ...
 
Hopefully it continues to improve, we all need enough sleep :)
And speaking of which, I need to get to sleep. May need another sleep aid because I fear this may be an insomnia night.
 
3:12 AM
I bid you good night, and wish you luck :)
 
Thanks, I hope you have a good morning :)
 
 
1 hour later…
4:43 AM
@NikiC this one might be interesting: bugs.php.net/bug.php?id=80564
zend_initialize_class_data(...) {
    	if (ce->type == ZEND_INTERNAL_CLASS) {
		ZEND_MAP_PTR_INIT(ce->static_members_table, NULL);
	} else {
		ZEND_MAP_PTR_INIT(ce->static_members_table, &ce->default_static_members_table);
		ce->info.user.doc_comment = NULL;
	}
}
that looks wrong on it's face, I can't determine what the plan was so not exactly sure how to go about fixing it ...
 
 
3 hours later…
7:41 AM
@JoeWatkins It's a well known problem
 
@NikiC oh ...
 
@JoeWatkins But, I'd say feel free to fix it
Probably by allocating a pointer to hold the table on the arena
I haven't looked closely into what it would take
 
I dug for about five minutes and got to that ^ I'll circle back around too it and take a proper look ...
 
8:12 AM
@Tiffany you probably want something like $childNode->localName === 'term_taxonomy' && $childNode->namespaceUri === SOME_CONST_YOUVE_DEFINED
you could use $childNode->prefix === 'wp' if it was throwaway code, but should never rely on prefixes staying the same for any length of time
a different program, or just a different version of the same program, is free to assign a completely different prefix to the same namespace - and the same prefix to a completely different namespace
 
 
2 hours later…
9:50 AM
[is_literal](https://wiki.php.net/rfc/is_literal) justification (part 4)... why everyday programming needs commands written as literals:

$sql = 'WHERE id = ' . $mysqli->escape_string($id);

Note this kinda works, but due to the missing quote marks, it's also insecure (escaping is error prone)... and yes, table/field names can't be provided in parameters, but they can (and should) be provided to the DBAL separately.
 
@Danack don't worry, i am sober
PHP is the drug
 
10:09 AM
@IMSoP the script I'm writing will be throwaway code for this step just cause the customer data is so awfully formatted, but the next one I write will have to be a more permanent fix. BUT this script I'm working on should hopefully allow using their broken WordPress API. Fingers crossed anyway.
I'm trying to avoid having to parse this XML cause it's bad and makes my workstation run slow whenever I open it.
 
10:40 AM
morns
 
mornin o/
 
Morning
 
Hi, does anyone how to do this. Let say I have a form which has dropdown selected button. Let say first button I have value A, B, C then my second dropdown selected button I have value depends on the value I store in A, B, C. so when user select A, then my second dropdown button option will have 1,2,3 option. when user select B, the value will be 4,5,6
 
Yep, it's common... but can I ask if a <select> is the best approach? they often cause usability issues, where (depending on what you're doing) it can sometimes be easier to have a list of links that simply take you to a second page and give you the dependent options from there.
If you want to keep with the <select> drop down, you will probably use JavaScript, so it's done in the browser... but keep in mind that JS can go wrong (e.g. a network failure or ad/content blocker, or you do something that not all browsers understand, etc).
 
10:56 AM
Because I am doing a form registration. let say the user click US, then second option only cities in US is showing
 
"The select component should only be used as a last resort in public-facing services because research shows that some users find selects very difficult to use."
Anyway... why not ask the user the country on page 1; you could make a really nice page, with flags and everything.
 
i see.. ok i will try first
 
(sorry if that last bit about the flags sounded sarcastic, but you could do things like groupings by region, a map, or just keep it simple with a nice long list of the ~195 countries, which is always a pain to use with a <select> field).
 
Display problems ・ Unknown/Other Function ・ #81065
 
@CraigFrancis ooh, I'm definitely bookmarking that site; I'm always impressed by the consistency and general user-friendliness of gov.uk
 
11:18 AM
Hi
Is there any way using which I can strictly set case sensitivity in PHP
I am facing an issue like $obj->type & $obj->Type both are giving me value without any error. But I feared that over Linux server it will fail..
 
lol, because the filesystems are c/s you think PHP becomes sensitive to it as well?
 
@Exception PHP variables / properties / function calls do not become case (in)sensitive depending on the OS. If you are bothered by it, static analysis tools such as CodeSniffer and IDE inspections can provide you with case checks
 
@IMSoP usability.yale.edu/web-accessibility/articles/links (linking the thing I specifically talked about in a Twitter thread, but this site is great for teaching accessibility/usability)
 
@Tiffany ooh, thanks, bookmarked :)
 
11:26 AM
There's also webaim webaim.org/techniques/hypertext but I think Yale's site is better
Yale's site is punchier
 
implicit binds will not be removed anyway, I think ... this is fix for jit enabled failure, this looks like root cause, and counting explicit BIND_STATIC as having side effects seems reasonable to me, for the same reason as RECV* ...
 
 
1 hour later…
12:35 PM
I made a little clearer in the last few seconds, I'm not sure this is the right way still ...
 
@JoeWatkins Not sure...
It seems pretty reasonable for opcache to optimize away unused binds...
But also not terribly important, so I think it's okay
Otherwise we can't store the information in the bind opcodes
 
okay, I ship it ... if anyone screams I rethink, but I prefer to keep the information for utility, utility just about wins, in the absence of any other opinions to the contrary ...
 
12:57 PM
@cmb Can you explain what you meant by "what is the behavior with libmysql-client. It seems to me
that would yield the expected behavior."
 
@Tiffany Past experience says 12-15 people actually show up. The whole guest list this year is low 20s, which is less than usual.
 
cmb
I can repro with mysqlnd, but I think libmysql-client builds would behave like expected; I cannot easily check, though
 
Same here. I haven't yet been able to compile with libmysql
 
cmb
SQLite3::bindParam() behaves like mysqlnd; have not yet checked PDO
 
1:37 PM
@Trowski What was the array_walk code you had that broke with just ? again?
 
@Trowski Do fibers not work for 32bit builds?
 
Hi, does anyone know How can I redirect into another details of user? Let say. I sort the user into a group of age in one page. let say "Group Page" contains only name of the user then next to them will have one button "view" if the button view of USER A is click then it will go to the page where all user is there BUT it will direct to the USER A details only not all the user
 
@Trowski oh, no... it seems that PHP itself doesn't build on 32bit right now due to some ASM errors
 
@kins do you mean render the whole page but scroll the browser to a specific position?
 
@Derick CI includes a 32bit build
 
1:43 PM
1 message moved to Trash
@JoeWatkins Maybe, but it doesn't build locally.
 
is there a metric on the % of people using 32bits builds? not saying to drop 32 in PHP, but i thinking about it for a library ..
 
something wrong with build on that system
checking for fiber switching context... x86_64_sysv_elf_gas
(should be i386)
 
yeah, i agree
 
@IMSoP yes
 
then what you want is an "anchor" - https://example.com/whatever.php#this-is-the-anchor
the anchor can then point at any HTML id attribute on the page
 
1:49 PM
@JoeWatkins I mean, my host CPU is a x86_64 one... it's a "Cross compile" as I pass "-m32"
 
<a id="this-is-the-anchor">I get linked to here with IMSoP's URL!</a>
 
@Trowski ^^ any idea?
 
@Derick you also have to set build
 
so you'd have something like <div id="user-details-42">User 42...</div> and end the URL with #user-details-42
 
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
 
1:50 PM
@JoeWatkins I don't know what that means
(or rathe,r how to do that)
 
krakjoe@Fiji:/opt/src/php-src$ grep build azure/i386/job.yml
        ./buildconf --force
            --build=i686-pc-linux-gnu \
(for configure, not buildconf)
 
@IMSoP i see alright I will try to look at it more
 
@JoeWatkins OK - is this new?
 
normal for cross
 
I'd never done it before.
 
1:54 PM
It's needed since fibers
 
no, we setup the i386 build before fibers
it was needed then, it's normal to have to set one of build/host/target for cross compilation, and -m32 is cross ... is my understanding of it ...
 
wokrs now, cheers
 
@JoeWatkins That --build flag on azure is very recent :)
It just happened not to be needed before, because opcache jit detected -m32 though compiler invocation. Nowadays it checks host system for cross-compilation support
And --build is the way to get it to use the right host triple without opting in to full cross-compile
 
oh maybe I misremember, I remember having a hard time setting up the build, and thought we did use one of host/target/build, but maybe had the wrong triplet, and that became important for fibers ... but I could totally be misremembering ...
oh yeah, you done it like 5 minutes ago ... my bad ...
 
2:14 PM
@NikiC headers_send(...) #TeamEllipsis
 
Is anyone aware of tools to help identify the leaks of the sort where they do actually get freed eventually, but they live much, much longer than anticipated? Some sort of malloc profiler that shows backtrace and timestamp it was allocated or something?
 
how would a profiler anticipate how long you wanted to keep the variable for ?
 
It doesn't. It keeps track of non-freed allocations and tracks when it was created, so you can do things like sort by longevity.
 
sorry, I skipped the words "help to identify" ...
 
It could be an erroneously growing realloc as well, I suppose, which wouldn't (probably) show up as long-lived, but in this case my leak is very small (about 1 MiB over 36 hours) so I don't think it's realloc.
 
2:20 PM
I don't know of anything for C, for java is quite common to include that information in realtime profilers ...
the interweb is surprisingly low on information ...
 
Only memory profiler I know/use is massif...
 
@Trowski Bingo, thanks. (Replying to Nicolas on list.)
 
ah I have vague memories of using gperftools
 
2:32 PM
Happy friday all o/
 
@Exception you can't force it, but there are code quality tools like phpstan, psalm, and many more that will tell you that you have a case mismatch in your code.
@LeviMorrison I know....boasting about keeping requests to 'under 100ms'........whoaaaaaaaa........slow down speed kings....
 
It's better than any music video I could produce but that bar is pretty low ^_^
 
2:48 PM
Hello All
can anybody help me with this error Call to undefined function oci_connect()
 
@muniya you almost certainly don't have the extension installed or loaded.
 
I am using windows 10 64bit , wamp server , downloaded oci8 dll
pasted into ext folder , changed into php.ini file
restarted wamp server
after phpinfo()
I found these
PHP Version - 7.4.0

Architecture - x64

Thread Safety - enabled
any idea what i need to do? do i need to install oracle instant client?
do i need to install php into windows 10?
 
3:09 PM
> changed into php.ini file
what exactly did you put into the php.ini file, and did you check that you edited the right file according to the one listed from phpinfo() ?
 
cmb
likely OCI.dll is missing from the PATH
 
@muniya if you can run phpinfo(), you have PHP itself working; it will tell you which php.ini files it read, and which "extensions" have been successfully enabled (additional modules, like the "oci" functions you're trying to set up)
first, check if "oci" is already mentioned in the phpinfo output; presumably it is not, or you would not still have the error
next, check if the php.ini file you edited is the one PHP is reading
 
cmb
likely OCI.dll is missing from the PATH :)
need instant client on the machine
 
also, try enabling display_startup_errors: php.net/manual/en/… - that should show an error if it tried to load the extension and failed
@Crell I'm not normally one to complain about traffic volume, but if you want to discuss Yet Another PFA Proposal, can you make a new thread or take it off-list? I think Nikita's First-Class Callable RFC deserves its own discussion rather than being swamped by that
 
Things I never thought I'd have to do: appending a column of password_hashed random_bytes to a CSV file.
 
3:23 PM
/me boggles
 
(and yes, I know, random_bytes can produce null bytes... it won't matter cause the passwords will never be used)
 
so you just need something that looks like a password hash?
 
yup
 
brilliant
 
yup!
 
3:25 PM
client 1 week later: what are the passwords?
 
I can only imagine what will happen if it's ever decided in the future that this accounts will be used...
the email addresses are fake, passwords are "fake"... it's all for presentation
 
I'm now picturing a sci-fi horror where all these fake customers come to life and start logging into the system, and everyone but you insists that they've always been real people
 
the twist everyone saw coming from the beginning is: it turns out that you aren't real either
 
hah!you are the output of a call to random_bytes()
 
a tron/sixth sense crossover episode
the sixtphp sense
 
3:38 PM
Well... PHP doesn't seem to work with tcmalloc:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so php -S 0.0.0.0:80 -t .
Starting tracking the heap
Dumping heap profile to /tmp/mybin.hprof.0001.heap (1621611474 sec since the last dump)
free(): invalid pointer
Aborted
(my extension is not loaded)
 
@LeviMorrison that's a shame… doesn't make a difference when you turn zend allocator off guess?
 
Oh, didn't think of that. Will try.
I'm guessing it doesn't matter -- invalid free is likely to remain.
 
(that one was creepy to watch, and I omit it when I rewatch)
 
ooh, sounds it
 
3:56 PM
Documentation conflicts about default PDO error mode ・ Documentation problem ・ #81066
 
4:13 PM
fpassthru no false ・ phpdbg ・ #81067
 
4:25 PM
@cmb I'm afraid you're going to have to explain it to me like I'm 5. I have no idea what your reply meant.
Why does array_diff() return referenced variables, or why it doesn't when I use pass-by-reference in userland function
I feel like the behaviour should be identical either way
not to mention that leaking the reference through array_diff() is not a nice behaviour
 
cmb
4:47 PM
@Dharman I don't explain anything to 5 year old kids; tried that once, and after the 20th "why?" I gave up. ;)
 
The only difference I see is refcount
 
Refcount is important for references
 
I thought refcount was the number of variables pointing to the value
 
References with refcount=1 are supposed to be treated like non-references
 
ohh
I don't understand why, but that would explain the different behaviour
Ok, when I add $a2 = &$foo[1]; before calling a() the refcount is 2 and now I get the same behaviour
Is array_diff() supposed to refcount too? Why doesn't it create a true copy of the data?
 
4:54 PM
Double free in realpath_cache_clean() ・ Apache2 related ・ #81068
 
So to mimic the same behaviour in userland, I have to create a reference of the referenced parameter. WOW
 
@Dharman I didn't see the beginning of this conversation, so I may be telling you things that you already know, but some things I always try to bear in mind with references:
- you don't have a reference _to_ something, you have a _set of references_ to a zval
- to remind me of that, I prefer the notation $a2 =& $foo[1] rather than $a2 = &$foo[1]; you're not "making a reference to $foo[1]" you're "adding $a2 to the same reference set as $foo[1]"
- array members act pretty much like variables - they can be members of reference sets in their own right
 
@IMSoP Thanks, that much I already knew. My confusion came from what Nikita said. Referenced zvals with refcount=1 are not really referenced
In other words, what bind_param does is like this:
class A
{
private $b;

public function set(&$a)
{
$this->b = &$a;
}

public function get()
{
return $this->b;
}
}
 
@Dharman right, because every variable can be thought of as "in a reference set", just a reference set with itself as the only member
 
Why are there so many "Conditional jump or move depends on uninitialised value(s)" issues in PHP on startup as reported by valgrind? Is there some pattern it doesn't understand that PHP uses?
 
5:02 PM
In my example above, this is what I get for $a at the end of the method. "a: (refcount=4, is_ref=1)=1"
 
@Dharman can you link me to where "above"; like I say, I didn't see where this discussion started
 
@Dharman I am talking about this class
See, the double &?
 
for the record, I'm 'waiting' on composer releasing their next version, to be able to publish that site.
 
You have to increase refcount up to 4 to make it work
 
5:04 PM
to make what work?
 
aka I'm procrastinating on working on it, and able to blame composer now.
 
storing a reference to a variable passed it as a reference to the method
The main question was why does passing by reference work differently in userland than it works in build-in functions
The answer is that in userland, you have to create double reference
 
no, there is no such thing as a double reference
 
@Danack Thanks. I would still like to know why it its believed to be a false positive. In our CI we use a bunch of suppressions, but I feel like at some point it's worthwhile to instead make the tooling clean.
 
apparently, there is
This is what Nikita said
 
5:05 PM
you never take a reference to something
think of "=&" as its own operator
 
yeah, I know. It makes sense, but not at first.
 
function set(&$a) { $this->b = $a; } // assign value of $a to property b
function set(&$a) { $this->b =& $a; } // add property b to the same reference set as $a
 
It's useless to have to recompile PHP to get a "clean" report for tooling, because the issue may not reproduce on the new build (it's happened to me more than once). Even if it does reproduce, it's a big drop in productivity.
 
yeah, but without that, the variable does not behave as a reference
so, it will not leak through array_diff()
 
@LeviMorrison if there was one place in the PHP code that really could use some comments about wtf it's doing, then zend_string_equal_val would be it.
 
5:08 PM
as soon as you run "$this->b = $a;" it's not a reference
 
Yeah, that's not my point
we went offtrack
 
again, I missed the start of the conversation
 
I only used $this->b =& $a; to retain refcount at higher value
 
so what is your actual example?
because "retaining refcount" doesn't make much sense to me right now
 
see here 3v4l.org/YAFtS
There is no "hi" in the output
 
5:11 PM
@Danack Ugh, I hate it when people use assembly. I actually know it a bit, not very well. But it's so brittle and non-portable, and it's actually pretty rare that it's "worth" the maintenance cost. For instance, with SIMD instructions on parallel data you can often beat the compiler by small amounts because as a human can understand things at a higher level and cut out branches and other things that don't need to be accounted for.
But at the same time, those things can be invalidated and now you have fast, but bad asm...
 
And this is what xdebug says: foo: (refcount=1, is_ref=0)=array (0 => (refcount=1, is_ref=1)=3, 1 => (refcount=1, is_ref=1)='hi', 2 => (refcount=1, is_ref=1)=3)
 
@Dharman yeh, because the element is not a reference. you passed it by reference, but the outer array still just contains a value
 
you'd think that if it says is_ref=1 is one then it will behave like a referenced zval., but no
 
after the call, it has a refcount of 1
 
@DaveRandom Yes, so to retain the outer variable as reference, you have to make another reference. e.g. $b =& $foo[1];
and only, then it will leak through array_diff()
 
@Dharman ignore the implementation with refcount and is_ref for a moment, and think about the logic applied: you pass a variable $foo[0] by reference; for the duration of the call to a() it has two names, $foo[0] and $a; then once the function ends, it only has one name again, $foo[0]
that's all "refcount=1" means: "this variable only has one name"
 
makes sense
 
in DaveRandom's version, the variable ends up with two names: $foo[0] and $r, and then when array_diff runs it sees that and ends up creating a third name, $diff[0]
which is weird, but it's a side-effect of PHP treating arrays like they contain variables
you can get the same effect just copying the array: 3v4l.org/Ecnm9
 
Yeah, definitely not nice, but this is how PHP works
These references in PHP are very confusing
 
yeah; best avoided wherever possible
 
5:19 PM
well, you can't avoid them
 
occasionally useful, when used very carefully
 
PHP uses them e.g. in bind_param
 
@Levi according to detailed records (old SO chat), I was last using gperftools a couple of years ago while developing pcov, it works, and you do have to disable zend mm
 
or in some array functions
 
@JoeWatkins Yeah I'm assuming it doesn't work with the LD_PRELOAD mechanism and I need to rebuild PHP with -ltcmalloc.
 
5:20 PM
yeah, bind_param is weird
 
> if you really want to have a go, I suggest using tcmalloc heap profiler with LD_PRELOAD, here's some help page to get you started gperftools.github.io/gperftools/heapprofile.html
it worked ...
but I didn't even remember it's name, so I don't remember any details at all ... but I happen to suggest LD_PRELOAD, that must have been what I was doing ...
 
@LeviMorrison Particularly since the non-assembly version uses memcmp, which I assume is highly optimized already.
 
@Trowski On mainstream platforms, yes, it is highly optimized and the libc ships optimized functions which get loaded at runtime linking.
 
jnz, jne - conditional jump or move depends on what looks like uninitialized memory because of struct hack in zend_string
 
Try to beat it some time on a specific struct -- it's difficult.
 
5:27 PM
Yeah, I'm sure there's something specific to zend_string going on there, but I wonder how many nanoseconds are being gained there…
 
cmb
@JoeWatkins blame MSVC
 
I just knew it was windows fault, I felt it in my bones ...
 
@JoeWatkins I cannot find any reports on valgrind not working with the struct hack.
 
cmb
@Dharman yes, and what happens there is that the passed reference is copied to internal storage (thus refcount==2)
 
yeah, now I see it
 
5:32 PM
either build with vg support, or suppress the false positive ...
 
I'm not convinced it is a false positive.
 
I believe it's the tiny differences between jne and jnz
 
You know how many times I've looked into these sorts of things and they weren't actually false? Many. In fact, I cannot remember any time where I had a report from valgrind or asan which was actually false. I am very suspicious.
 
apparently they're assembly because the asm takes into account alignment and padding of zend string struct ...
I also find it hard to believe that this could make a difference, but I defer to people smarter ... dmitry done it, and I guess he had good reason ...
 
@LeviMorrison maybe ask dmitry to put a comment on why it's not a problem?
 
5:42 PM
probably nikita has a good answer, I'm just really repeating ... I'm sure it was explained to me at some point, but I've just been copying the same suppression stuff to every ext build for ci for ... as long as I remember ...
@CraigFrancis I know you've probably got a lot you want to say, and I see why spreading it out, but this strategy is not likely to be well received ....
3v4l for parser generators ... then we ban talking about syntax unless you can prove it will work with code ... someone do it ... make our lives better ...
 
@NikiC Do you know why zend_string_equal_val has so many supposed false positives? Why doesn't valgrind understand these? Are we sure they are really false?
Joe thinks it might have to do with the struct hack in zend_string, but I can't find any references to bug reports or otherwise that says valgrind doesn't work with the struct hack.
 
6:37 PM
@LeviMorrison Because it's intentionally reading uninitialized data
 
Might be more a MySQL question, but any idea why a VARBINARY(16) would reject an inet_pton on a IPv6? It seems to be shooting out a 16 byte binary value but my DB started rejecting them after going to PHP 7.4
 
@Machavity what's the error message/code?
 
@NikiC uh, what?
 
> Unresolvable failure. #1406 Data too long for column 'ip_address' at row 1
 
@Machavity Did you sanity check that strlen($data) == 16 really holds?
 
6:44 PM
@LeviMorrison It accesses the data on a sizeof(void*) boundary
 
@LeviMorrison It does 8-byte reads and then masks off the tail if necessary
We have allocator guarantees that the size is aligned to an 8 byte boundary, but the tail bytes are not necessarily initialized
 
@LeviMorrison and that's safe to do as allocatons are always aligne
 
Though I gotta say, those assembly implementations for valgrind are completely unnecessary. Those could be just a memcmp
 
@NikiC I did, but now that you mention it, it might be our goofy ORM putting in something else
 
@Machavity It works for me
 
6:48 PM
Also, I'm wondering if we can't do that valgrind interception unconditionally
Without the HAVE_VALGRIND I mean
 
@Machavity I don't know, but guessing it's because it's a string so has a terminating byte ? I also have no idea why that would work before....
 
Depending on how stable the symbol prefix that valgrind uses is
 
Greetings! Anyone have a clear understanding in Drupal on how to join content types in the node table where ids match to return an array? I've been reading for days and fear that I am not understanding something extremely fundamental.
 
@Danack It's probably always been broken and going to PHP-FPM let the IP through correctly
 
@user3460707 you might have better luck asking in a place where more people use Drupal....I don't know where that place might be though.
 
6:54 PM
Thanks, yea, I figured as much but thought worth try.
 
@user3460707 There is a Drupal Stack Exchange
 
Thanks @mach
 
@LeviMorrison @JoeWatkins github.com/php/php-src/commit/…
 
@NikiC I would just initialize the trailing bytes?
For what it's worth, I do something similar, and initializing between 1-15 extra bytes depending on what padding length you choose is pretty cheap because of how the machines work. We initialize them all to 0 so we don't have to deal with this crap.
And you even regain the performance because you know you can safely access those bytes, and the tooling agrees with you.
Very weird decision to intentionally read uninitialized memory. If you guarantee it to be there, just zero it out...
 
@NikiC I like simpler
 
7:07 PM
@NikiC Removing the asm for the valgrind path definitely looks good to me. Dunno why we'd maintain asm in that case. Not sure about the soname thing -- if you think it's harmless I don't have any reason to disagree.
 
It's not harmless, it's awesome :P
 
@NikiC nice
 
That means that normal production builds without valgrind will no longer throw warnings
 
Right that part is awesome :) I just meant that you should be sure it won't cause other unintended problems.
 
yeah, that's cool
 
7:09 PM
@JoeWatkins Yeah, I know, I really want to keep it short, but Dan doesn’t want me talking about the RFC on internals yet, so I thought I could give some background, and while the core idea is really simple, there are lots of contexts it’s useful in (so hopefully I can explain why, rather than everyone jumping to conclusions).
 
I still think it would be better to initialize the extra bytes and drop the valgrind specific stuff...
 
@LeviMorrison It's not so simple because we don't control initialization
Only thing we could do is zero out the last block directly in zend_string_alloc
 
@NikiC Which would be super cheap, yes?
 
I'm pretty sure someone tried that, and found that it had a significant impact due to bad locality
 
It would have to be a large string, where the last block probably isn't used for quite a while because it's a dynamically growable string or something to have an impact.
Why doesn't ASAN complain about it, btw?
Because it's directly written in ASM or something?
I know there has been some development around inline asm blocks and asan but I'm not sure what is supported/unsupported.
 
7:15 PM
@CraigFrancis well, I just wouldn't send an email to internals every day leading up to announce ... people won't like it ...
 
(I already don't like it)
 
@LeviMorrison asan doesn't check initialization
 
Ah, right. It's one of the pieces unique to MemorySanitizer.
 
@JoeWatkins probably, but how do you give people time to think about the different parts? and not make a long email no one reads?
 
@LeviMorrison yeah, and msan is something of a pain
 
7:18 PM
Yeah, because you have to build all your deps with it too.
 
We do use it, but in a limited build
It's also missing libc interceptors once you get to more exotic stuff like networking functions
 
What if we add a macro for null-terminating a string that doesn't add a single null byte, but nulls all bytes from that point to the end of the allocated string?
 
@CraigFrancis I don't know how to make people think ... but people are no more likely to read 10000 words in 10 emails than in 1 ... they are just not going to read lots and lots of information ...
 
Also... how does this still work at all when the zend allocator is off and malloc is directly used? Wouldn't it be reading invalid memory?
 
@JoeWatkins I don’t know what else to do.
And I was trying to keep it short, with simple examples.
 
7:23 PM
Ugh, asan isn't detecting a trivial leak for some reason. I verified that I compiled with -fsanitize=address and everything, and I'm directly using malloc so it's not some zend allocator setting...
(trivial because it's a malloc, do something, free, but I commented out free)
 
you don't need to educate everyone about every little detail, assume they'll do the research they need to do before they use their vote ... even if people aren't doing that, you can't assume that ... make your proposal, and give out a few links, just say what you need to say ...
 
Not doing every detail, just trying to cover the parts people often jump to conclusions about.
 
@CraigFrancis just chill for a bit and lets meet for a refreshing beverage. I'm sorry for not having worked on it, but I've still been in chronic pain, but also have been thinking about it at the back of my mind.
24 hours ago, by Danack
@CraigFrancis I think people have been reasonably clear....the problem is that doesn't naturally lead to what to do about it. It's a pretty common frustration for people who have an idea for an RFC, to ask for feedback of "what changes are needed to make this pass?" but people who "aren't getting it", aren't going to be able to answer that.
 
yes, beverages, and chill ...
 
7:31 PM
where is Jeeves ?
 
within Usage, where is is_literal used? how would it be used?
that else-if chain :(
@JoeWatkins isn't doing RFCs correctly, not sure why, haven't troubleshot/debugged it, may do it at some point this year when I have more energy/time
 
@Tiffany thanks for reading, that db class example is really a simplified version of what any DBAL or HTML Templating Engine, etc, could use.
 
Minor parameter error in documentation ・ MySQLi related ・ #81069
 
7:47 PM
Ha, just noticed Calvin Buckley also complained about noisy valgrind configs on the ML today. Total coincidence...
 
@CraigFrancis I've asked some coworkers, I'll let you know what they say
 
@Tiffany thank you :-)
@Tiffany does it make sense? I’ve wanted to keep it simple/short, but also need to cover the different things that get brought up.
 
> how does it protect in this situation: $foo = '<p>Hi ' . $_GET['name'] . '</p>' and then echo $twig->createTemplate($foo)->render();
> When PHP tokenizes things, is the passed variable literally '<p>Hi ' . $_GET['name'] . '</p>'? Cause it seems like it would be the computed value at that point
 
@Tiffany If Twig wanted to protect against XSS, it would ensure the $foo variable it receives in createTemplate is a literal (ensure being a warning or exception)… as the template should not contain any user values (they should be provided separately).
@Tiffany yep, when the GET variable is concatenated, the end result is not marked as a literal, so can’t be trusted
 
> I could see function foo( ~string $bar ) { exec($bar); } where $bar is explicitly checked at PHP compile level for anything being passed other than a raw string
 
00:00 - 20:0020:00 - 00:00

« first day (3870 days earlier)      last day (1077 days later) »