« first day (1416 days earlier)      last day (3535 days later) » 

12:00 AM
@Ja͢ck Yeah...but maybe contact the guy that wrote the doc or the function?
 
Contact Rouven for what exactly, though?
 
Well the code says "proto bool hash_equals(string known_string, string user_string" - so maybe he thought it was required.
 
I distinctly remember an implementation that iterated over MIN(known, given).
And the known.length ^ given.length used as the starting value.
Later it was simplified .. but like I said, leaving the documentation as is (regarding parameter order) keeps the option to change implementation at a later stage without affecting current usage.
 
12:18 AM
@FlorianMargaine ugh, does your editor "fix" whitespace issues? :)
 
1:05 AM
@Ja͢ck You know much about this new zend_string?
 
@LeviMorrison Just wondering, do you have any recommendations on good software for writing documentation? (other than just doing it in XML). I've been trying out Pythons Sphinx and it's okay, but doesn't seem amazing.
 
I actually prefer XML.
I think XSLT and other XML transformation tools are wonderful.
 
Ok.....do you know of any tools that take xml+xslt and generate complete documentation from them, with things like indexes, search box etc?
 
Not the search part; that kind of thing takes a specific db and schema typically.
@Danack Oh! Just the other day Anthony linked to a spec for a subset of HTML5 for this kind of thing (I think).
Hmm... can't find it
 
Me neither, but it does ring a bell...
 
1:19 AM
Ah, it was for writing books (maybe sufficient?) github.com/oreillymedia/HTMLBook
 
that "HTMLBook" nonsense? Just use docbook
 
At least use some subset of docbook or rendering it will be a nightmare.
 
Thanks. I'll look at docbook....but guess I may as well just concentrate on writing the text first in Sphinx as it seems okay-ish, and then worry about making it look nice/be maintainable later.
 
What project are you documenting?
 
A couple of my crappy ones...I'll link to them, but the documentation isn't online yet and apparently I find it difficult to explain things in readme.md files. Templating with Dependency injection github.com/Danack/Jig, Proxy generator (aka pre-generated AOP) github.com/danack/weaver and an alternative to Satis that isn't as fucky.
But I'd also like to make an actual website for Auryn's documentation...the stuff in the readme isn't bad, but it's not awesome either.
 
1:30 AM
I'm sure Daniel would appreciate help on that front.
 
The Sphinx stuff is okay - and it renders to bootstrap so it looks adequate on mobile.
But it doesn't make me think this is awesome.....
But as I said, it's probably better to ignore the tech, write the actual text, and then worry about making it look nicer once that's done.
 
Yeah, I think that's a good decision.
 
2:05 AM
"I have been writing a text based File System." ...oh, this gonna be good
 
wow, shows how bad the SO moderation system truly is, when it takes 5yrs for a shit question to be closed. =o\
 
3:08 AM
@LeviMorrison I know some of it, is there anything you're battling with?
 
3:24 AM
@Ja͢ck Well... it's not a basic const char * with a length; when do I add a ref?
Basically, I am retrieving one from an AST.
And I need to store it on a func->common.return_type.class_name
5727 void  zend_validate_return_type(zend_function *func, zend_ast *ast TSRMLS_DC) /* {{{ */
5728 {
5729     if (ast->kind == ZEND_AST_TYPE) {
5730         func->common.return_type.type = ast->attr;
5731     } else {
5732         zend_string *class_name = zend_ast_get_str(ast);
5733
5734         if (zend_is_const_default_class_ref(ast)) {
5735             class_name = zend_resolve_class_name_ast(ast TSRMLS_CC);
5736         } else {
5737             zend_string_addref(class_name);
5738         }
I have no idea what the inner if is really doing, and why I only add a ref in the else block.
I copied that from somewhere else.
I copied the code from here.
 
@crypticツ That crap was okay then though... :/
 
@LeviMorrison Oh yeah, zend_string has its own reference counting to make more optimal use of allocated memory.
So zend_resolve_class_name_ast() creates a new zend_string so there's no need to add ref count
 
3:41 AM
Okay then. Next step: make a new opcode for verifying return types.
@Ja͢ck Have you ever made a new opcode? :D
 
@LeviMorrison Of course :)
ZEND_POW is mine ^^
 
Can you give me the basic steps?
I've never done ANYTHING with opcodes before.
 
3:56 AM
Hmm, you add a new opcode id inside Zend/zend_vm_opcodes.h
Then you add a handler in zend_vm_def.h
Afterwards you run php zend_vm_gen.php
 
No weird initializer list I need to put an entry into?
(Already spent a whole day on such a stupid issue :( )
 
Not that I'm aware of.
 
Hmm...
I just added the code to support this test: raw.githubusercontent.com/krakjoe/php-src/returntypehinting/…
And I get a bunch of these:
Fatal error: Declaration of RecursiveRegexIterator:: should be compatible with RecursiveIterator::getChildren(), return type mismatch in Unknown on line 0
I guess that means something somewhere doesn't properly initialize the return_type to IS_UNDEF.
 
Empty method name?
 
it's a broken character for me in the terminal
 
4:07 AM
Seems like a freed memory location then
Did you do the original implementation?
 
No, Joe did.
I'm working from scratch on master.
 
yikes ... i'd recommend running it through valgrind
if there was a memory location freed, it will tell you where it was originally allocated.
 
Hmm...
 
in this case it seems that the method name wasn't addref'ed
 
But everything is fine without my code.
I'm more inclined to think something isn't initialized properly.
 
4:11 AM
it usually is
haha
possible .. not sure what your code does :)
 
I add an entry to common
That is a zend_return_type
 
common being part of a function structure?
 
It has a zend_uchar and a zend_string *
@Ja͢ck Yeah, and in op_array.
 
right
 
I added these lines:
 96     op_array->return_type.class_name = NULL;
 97     op_array->return_type.type = IS_UNDEF;
To init_op_array; perhaps that isn't enough.
 
4:15 AM
do you have a more complete diff?
 
I can give you the code on github if you are interested.
 
yeah, a diff between your forked branch and php-src/master
 
It appears I'm 13 commits behind master locally.
 
wow, you had to expand the ast declaration type to support 4 children? heh
 
That's what NikiC suggested. I'm not arguing with him :D
 
4:21 AM
:)
@LeviMorrison Have you tried using IS_UNUSED instead?
 
@Ja͢ck ... I think I maybe meant to and accidentally did that.
yesterday, by NikiC
@LeviMorrison not in general, but in this case IS_UNDEF seems suitable
No, I meant to use IS_UNDEF.
 
oki
 
Unused is probably better.
 
Yeah, probably :)
 
Actually... no.
IS_UNUSED is for variables.
It's not a TYPE, as in zend_types.h
 
4:26 AM
Yeah, it's special
 
I'm not storing it on a variable; I'm storing a type in a zend_uchar.
 
Hmm, a live diff would be handier btw.
Can't really tell what goes on above your problematic code.
 
@Ja͢ck just reset HEAD by 13 commits.
 
which head?
 
master
Alternatively you can pull my repo off of github.
(although actually I can't seem to push right now; doesn't seem to be widespread)
 
4:28 AM
is your repo up-to-date on github?
as in, does it contain the code that we're discussing now?
 
No, but I can give you a small diff for that.
Wish I could just push.
It's hanging :/
 
you can't push to your own repo? =S
 
anyone here experienced with Wordpress and Gravity forms?
 
any remote git commands are hanging.
 
that's odd.
 
4:30 AM
Let me push over HTTPS instead of SSH.
Worked. Seems to be an SSH issue of some kind.
@Ja͢ck git clone -b return_types https://github.com/morrisonlevi/php-src.git should work for you now.
 
child->common.function_name->val <-- should be that
Because function_name is zend_string*
 
Okay, just a display issue. But I still think something isn't initialized properly or the code shouldn't even run.
 
It would help to know which branch it's taking.
 
Oh, I can give you that.
1459 } else if (child->common.return_type.type != parent->common.return_type.type) {
^ Evaluates to true.
 
Then the next step is to print both return types
If one of them is "out of bounds" you know something gets corrupted
 
4:36 AM
Almost certainly they are garbage.
 
wel, good .. then valgrind should be able to give some more info.
 
But can print.
 
type is just a number, right?
 
Yeah.
I can use gdb for this one
Just a second (have to do distclean and rebuild)
(gdb) p child->common.return_type
$1 = {class_name = 0xae3040, type = 152 '\230'}
(gdb) p parent->common.return_type
$2 = {class_name = 0xae1bd0, type = 192 '\300'}
Very much so looks like garbage to me.
 
yeah, that looks rather uninitialised.
 
4:40 AM
(gdb) p parent->common.return_type.class_name->val
$3 = "s"
(gdb) p child->common.return_type.class_name->val
$4 = "p"
^ actually, looks like something is out of bounds.
Maybe another stupid initializer somewhere.
 
Yeah, this can't be caused by something you do, rather something that you don't do.
Not likely to be caused by* rather
 
That string is "previous"
 
what's previous? what does that mean?
 
Dunno; that's just what the string is.
I wonder if this is bad: PHP_MINIT_FUNCTION
 
hmm
are you getting these issues only with internal classes?
 
4:48 AM
Well, I haven't gotten past internal classes :D
 
because the path from parser seems to be okay
but internal functions may be done differently.
actually .. quite certain that they are done differently.
 
I can try setting a hardware watchpoint on the memory and see where it changes.
I think I know how to do that, anyway
@Ja͢ck I am 100% positive it is an error somewhere.
I found where that "previous" string came from
It's the name of the last parameter of ErrorException::__construct
The return_type entry comes immediately after arg_info
 
do you get "previous" consistently?
 
Pretty sure; checking now.
I mean.
 
do check with USE_ZEND_ALLOC=0 as well ;-)
 
4:54 AM
ErrorException is the first internal class that triggers this.
And it is is consistently holding that value.
 
Just be careful not to chase red herring heh
 
Ah, it isn't stable. Yes it is, my bad
 
lol
well hmm, how about moving the return_type member?
not as a fix of course
but to get a different angle on what we hope to be the same issue
Because if arg_info leaks into the next member ... that would cause all kinds of stuff, without your code.
 
I have confirmed that my opcode initialization is not called before these checks are occurring.
So I need to initialize them somewhere else.
 
ahh
 
5:04 AM
  71 static const zend_internal_function zend_pass_function = {
  72     ZEND_INTERNAL_FUNCTION, /* type              */
  73     0,                      /* fn_flags          */
  74     NULL,                   /* name              */
  75     NULL,                   /* scope             */
  76     NULL,                   /* prototype         */
  77     0,                      /* num_args          */
  78     0,                      /* required_num_args */
  79     NULL,                   /* arg_info          */
I was hoping that was enough (that was the stupid initializer I referenced earlier that chewed up a whole day to find)
 
oh hmm
have you checked FENTRY?
it's a macro that initialises internal functions
 
Can you find it for me? I tried looking up another one but went through macro hell and never foudn what I wanted.
 
Yesh
 
5:11 AM
I'll be honest, I have no idea what this is doing.
 
How do people read that? It just turns into a mess of static for me.
 
We have special goggles.
@LeviMorrison Well, it's an initialiser for zend_function_entry.
 
... I think I fixed it.
 
=D
 
But... probably not how it should be fixed.
 
5:17 AM
Let's hear it anyway
 
It assumes all internal functions do not have return types :D
 
Where did you fix it?
 
In zend_register_functions
I added initializers to the code.
 
@LeviMorrison You may wish to think of adding a ZEND_FENTRY_EX for that
 
5:19 AM
I added a TODO for now.
 
So that internal functions may define return types in future.
 
Gotta get a First Working Draft.
 
Fair enough
So I was close with my hunch then yeah? ;-)
 
Indeed you were :D
 
\o/
well, time to head out for lunch
 
5:21 AM
...zzz
lol my test doesn't quite pass; here is the diff:
  1 001+ Fatal error: Declaration of qux::foo should be compatible with bar::foo(), return type mismatch  in /home/levijm/Projects/php-src/Zend/tests/return_type/009.php on line 7
  2 001- Fatal error: Declaration of qux::foo should be compatible with bar::foo() : foo, return type mismatch in %s on line %d
 
5:45 AM
hehehe
 
6:02 AM
moin
 
morning @JoeWatkins
 
@Ja͢ck yeah, emacs removes trailing whitespaces :P
 
curse you, Emacs!
Surely that's configurable heh
 
yeah it is
 
6:05 AM
What isn't in Emacs
 
blood test again today ...
 
again? why?
 
the other day when anthony was announcing recki I was at doctors, getting results of the last one ... without mincing my words, my liver isn't functioning properly, the word disease was mentioned ....
 
hmm =(
 
apparently, liver is quite amazing, it can regenerate itself in record time ...
 
6:08 AM
i think the only organ that does that :)
you can take supplements that make recovery even faster
 
yeah, so I'm not shitting myself ...
 
yeah, because that would be rather messy
 
lol
on my mind tho .... do hope life isn't catching up with me ...
they didn't say how bad it was ... the first blood test they said abnormal result, the second they said abnormal function ... I guess next will tell them what they need to know to tell me how bad it is ...
the internet says it can be as bad as a third of it's original size and function and still recover fully .... and says I'd be yellow if it were as bad as that ... so I must be okay, I think ...
might have to go organ hunting though ... dunno how good I'll be at that :D
 
well, liver transplant are relatively easier than kidneys.
 
I think a kidney goes for something like $15k on the black market - you should be able to snag a hunk of liver for quite a bit less
 
6:24 AM
yeah, ask them for the self help guide as well.
 
this explains my constant state of exhaustion somewhat too ... so that's a good thing ...
all I have to do is not take anything that will damage it further and I should recover ...
 
like, excessive amounts of beer and liquor?
 
amphetamines @Jack ... normal people cannot program for 20 hours a day ....
 
never taken those
i survive on power naps
 
I stopped when I moved ... I didn't move 120 miles away from home again for no reason .... I knew something was wrong I guess ...
 
6:29 AM
out of interest though, how well do they work?
besides the damaging side effects ...
 
posted on September 01, 2014 by nlecointre

/* by devweb2 */

 
it keeps you awake, but you have to work hard at concentration ...
 
i've got this feeling that would make me neurotic =/
 
I don't think it's uncommon among programmers ... Chris mentioned he dabbles ... sometimes all you need is another few hours in the day, you don't need to be a genius for those hours though ...
 
haha yeah
for the grinding work
 
6:33 AM
I'm not in the kind of working atmosphere that encourages me to do it now anyway, I'm a 9-5'er with no pressure .... it started when I was the whole team ... so I'm not doing that again for sure ...
 
Amphetamines are a great way to get a lot of things done wrong in one evening. And get your bathroom clean.
 
not entirely sure whether it's even a legal substance here ... though, with the highly stressful school system i wouldn't be surprised if there's a healthy market for it
 
it's not legal here ... I don't think it's legal anywhere ... cept maybe amsterdam ...
 
hah
 
they have it so easy :)
might retire there ...
this is below the guy who said there's a wordpress plugin for making games ...
fix it fix it fix it ...
 
6:42 AM
lolwut
 
inorite ... think the brilliance of recki-ct has been lost on most redditors ...
I just found something super interesting on felipe's github .... I think he might be useful to jitfu ...
he is so smart ...
 
noice
 
libjit has an elf writer ... but it just doesn't work ... and nobody has worked on it since 2006 ...
 
Silly thing, but I thought this is an interesting macro ;-)
 
compilation is lightning fast so nobody bothers with it ...
CASE macro is pretty common in C
 
6:48 AM
ELF is just the executable format for Linux, right?
Never paid much attention to it
 
actually it's portable format
 
yes, using Linux is like playing RPG, where you can run elf, face gnome .. and at the end, become a troll
 
haha
 
> $ troll
-bash: troll: command not found
 
Good morning
 
6:51 AM
Good morning
 
@Ja͢ck no, it's .. user who'll become a troll (: after couple of years using Linux :p
 
harsh ...
 
and dump cores behind the directory tree
 
so I've read a bit of it ...
no clue how that works ...
I see the layout but no clue how you'd read that from memory after compilation ...
do we have a clue ?
 
what's that now? are you talking about ELF still?
 
6:59 AM
yeah
 

« first day (1416 days earlier)      last day (3535 days later) »