Hey:

  a fix could be:
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index eb35a51..f738e34 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -33,11 +33,11 @@ static inline void *zend_ast_realloc(void *old,
size_t old_size, size_t new_size
  return new;
 }

-size_t zend_ast_size(zend_uint children) {
+size_t zend_ast_size(int children) {
  return sizeof(zend_ast) + sizeof(zend_ast *) * (children - 1);
 }

-size_t zend_ast_list_size(zend_uint children) {
+size_t zend_ast_list_size(int children) {
  return sizeof(zend_ast_list) + sizeof(zend_ast *) * (children - 1);
 }


  my compiler must take (children -1) as a unsigned

thanks

On Tue, Aug 19, 2014 at 5:21 PM, Laruence <larue...@php.net> wrote:
> Hey:
>
>    the problem came from zend_ast_size for 0 children node..
>
>    backtrace:
>
> Program terminated with signal 6, Aborted.
> #0  0x00000034dc030285 in raise () from /lib64/libc.so.6
> (gdb) bt
> #0  0x00000034dc030285 in raise () from /lib64/libc.so.6
> #1  0x00000034dc031d30 in abort () from /lib64/libc.so.6
> #2  0x00000000009d271c in _zend_mm_alloc_int (heap=0x82fff40, 
> size=34359738400,
>     __zend_filename=0xfc5c78
> "/home/huixinchen/opensource/github/php-src/Zend/zend_arena.h",
> __zend_lineno=69,
>     __zend_orig_filename=0x0, __zend_orig_lineno=0)
>     at /home/huixinchen/opensource/github/php-src/Zend/zend_alloc.c:2003
> #3  0x00000000009d4354 in _emalloc (size=34359738400,
>     __zend_filename=0xfc5c78
> "/home/huixinchen/opensource/github/php-src/Zend/zend_arena.h",
> __zend_lineno=69,
>     __zend_orig_filename=0x0, __zend_orig_lineno=0)
>     at /home/huixinchen/opensource/github/php-src/Zend/zend_alloc.c:2442
> #4  0x0000000000a42c05 in zend_arena_alloc (arena_ptr=0x135e698,
> size=34359738376)
>     at /home/huixinchen/opensource/github/php-src/Zend/zend_arena.h:69
> #5  0x0000000000a42b0e in zend_ast_alloc (size=34359738376)
>     at /home/huixinchen/opensource/github/php-src/Zend/zend_ast.c:27
> #6  0x0000000000a42dcb in zend_ast_create_from_va_list (kind=1,
> attr=7, va=0x7fff2be64550)
>     at /home/huixinchen/opensource/github/php-src/Zend/zend_ast.c:89
> #7  0x0000000000a4303e in zend_ast_create_ex (kind=1, attr=7)
>     at /home/huixinchen/opensource/github/php-src/Zend/zend_ast.c:116
> #8  0x00000000009aa0a3 in zendparse () at
> /home/huixinchen/opensource/github/php-src/Zend/zend_language_parser.y:551
> #9  0x00000000009aed81 in compile_file (file_handle=0x7fff2be68850,
> type=8) at Zend/zend_language_scanner.l:586
> #10 0x0000000000784de6 in phar_compile_file (file_handle=0x7fff2be68850, 
> type=8)
>     at /home/huixinchen/opensource/github/php-src/ext/phar/phar.c:3358
> #11 0x0000000000a0bab2 in zend_execute_scripts (type=8, retval=0x0,
> file_count=3)
>     at /home/huixinchen/opensource/github/php-src/Zend/zend.c:1301
> #12 0x000000000097529b in php_execute_script (primary_file=0x7fff2be68850)
>     at /home/huixinchen/opensource/github/php-src/main/main.c:2564
> #13 0x0000000000ac44b1 in do_cli (argc=31, argv=0x82ff680)
>     at /home/huixinchen/opensource/github/php-src/sapi/cli/php_cli.c:980
> #14 0x0000000000ac55de in main (argc=31, argv=0x82ff680)
>     at /home/huixinchen/opensource/github/php-src/sapi/cli/php_cli.c:1358
> (gdb) f 6
> #6  0x0000000000a42dcb in zend_ast_create_from_va_list (kind=1,
> attr=7, va=0x7fff2be64550)
>     at /home/huixinchen/opensource/github/php-src/Zend/zend_ast.c:89
> 89 zend_ast *ast = zend_ast_alloc(zend_ast_size(children) TSRMLS_CC);
> (gdb) p children
> $1 = 0
>
> thanks
>
> On Tue, Aug 19, 2014 at 5:12 PM, Laruence <larue...@php.net> wrote:
>> Hey:
>>
>>     I find a problem while I was trying play with the patch
>>
>> Generating phar.php
>> Generating phar.phar
>>
>> Fatal error: Out of memory (allocated 786432) at
>> /home/huixinchen/opensource/github/php-src/Zend/zend_arena.h:69 (tried
>> to allocate 34359738400 bytes) in
>> /home/huixinchen/opensource/github/php-src/ext/phar/phar.php on line
>> 163
>> make: *** [ext/phar/phar.phar] Error 255
>> make: *** Waiting for unfinished jobs....
>>
>>    is this a knew issue?
>>
>> thanks
>>
>> On Tue, Aug 19, 2014 at 2:36 PM, Dmitry Stogov <dmi...@zend.com> wrote:
>>> Hi Andi,
>>>
>>> We already discussed most of semantic changes introduced in AST patch.
>>> Most of them came from another approved RFC
>>> https://wiki.php.net/rfc/uniform_variable_syntax
>>>
>>> Thanks. Dmitry.
>>>
>>>
>>> On Tue, Aug 19, 2014 at 6:32 AM, Andi Gutmans <a...@zend.com> wrote:
>>>
>>>> Hi Nikita,
>>>>
>>>> I reviewed the AST RFC on my way to vote but there was something that
>>>> wasn’t clear to me.
>>>> This patch introduces some semantic/behavioral changes in addition to the
>>>> AST.
>>>> Are these as a side-effect of how AST was implemented? Or are they
>>>> unrelated to the AST patch?
>>>> I think some of them make sense but I’m having a bit of a hard time
>>>> separating out the benefits of the AST (which I really like) and making
>>>> other changes to semantics w/o really understanding if they are
>>>> side-effects and we have no choice vs. we’re trying to solve for two
>>>> separate items in one RFC.
>>>> Any BC breaks here we think could bite us?
>>>>
>>>> Any insight would be much appreciated.
>>>> Thanks!
>>>> Andi
>>>>
>>>> On Aug 18, 2014, at 9:41 AM, Nikita Popov <nikita....@gmail.com> wrote:
>>>>
>>>> > Hi internals!
>>>> >
>>>> > I've opened the vote on the Abstract Syntax Tree RFC:
>>>> >
>>>> >    https://wiki.php.net/rfc/abstract_syntax_tree#vote
>>>> >
>>>> > Thanks,
>>>> > Nikita
>>>>
>>>>
>>>> --
>>>> PHP Internals - PHP Runtime Development Mailing List
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>
>>
>>
>> --
>> Laruence  Xinchen Hui
>> http://www.laruence.com/
>
>
>
> --
> Laruence  Xinchen Hui
> http://www.laruence.com/



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to