diff --git a/.gitignore b/.gitignore index fa48430..fe9d838 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ tests/*.exp tests/*.log tests/*.sh core.* +ftp-sync.json diff --git a/.travis.yml b/.travis.yml index b891189..6b4aa69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,13 @@ compiler: - gcc php: - - '5.4' - - '5.5' - - '5.6' - - '7.0' - - '7.1' - - '7.2' + #- '5.4' + #- '5.5' + #- '5.6' + - '7.0.17' + - '7.0.18' + - '7.1.7' + - '7.2.0' before_install: - php --ini diff --git a/src/phpgo_context.h b/src/phpgo_context.h index 18fa79f..c250079 100644 --- a/src/phpgo_context.h +++ b/src/phpgo_context.h @@ -212,12 +212,12 @@ do{ \ #endif struct PhpgoBaseContext{ + uint64_t guard__[64]; uint64_t task_id; bool http_globals_cleanup_required; #if PHP_MAJOR_VERSION < 7 /*go routine running environment*/ - struct _zend_execute_data* EG_current_execute_data; zend_vm_stack EG_argument_stack; zend_class_entry* EG_scope; zval* EG_This; @@ -236,7 +236,6 @@ struct PhpgoBaseContext{ TSRMLS_FIELD; /*ZTS: void ***tsrm_ls;*/ #else /* php7 */ - struct _zend_execute_data* EG_current_execute_data; zend_vm_stack EG_vm_stack; zval* EG_vm_stack_top; zval* EG_vm_stack_end; @@ -244,9 +243,16 @@ struct PhpgoBaseContext{ zval PG_http_globals[NUM_TRACK_VARS]; zval http_request_global; #endif + + struct _zend_execute_data* EG_current_execute_data; + JMP_BUF* EG_bailout; + + uint64_t __guard[64]; /**/ PhpgoBaseContext(){ bzero(this, sizeof(*this)); + memset(guard__, 0xcc, sizeof(guard__)); + memset(__guard, 0xcc, sizeof(__guard)); PHP7_AND_ABOVE( for(int i=0; i< NUM_TRACK_VARS; i++) @@ -286,6 +292,14 @@ struct PhpgoBaseContext{ this->EG_vm_stack_top = EG(vm_stack_top ); this->EG_vm_stack_end = EG(vm_stack_end ); #endif + for(int i=0; i<64; i++){ + if (guard__[i]!=0xcccccccccccccccc) { + printf("!!!: guard__ was overwritten! address: %p, value:%lx\n", &guard__[i], guard__[i]); + } + if (__guard[i]!=0xcccccccccccccccc) { + printf("!!!: __guard was overwritten! address: %p, value:%lx\n", &__guard[i], __guard[i]); + } + } } inline void SwapIn(bool include_http_globals){ @@ -318,6 +332,15 @@ struct PhpgoBaseContext{ REPLACE_PG_HTTP_GLOBALS_WITH(this->PG_http_globals); SET_HTTP_GLOBALS(this->PG_http_globals, this->http_request_global); } + + for(int i=0; i<64; i++){ + if (guard__[i]!=0xcccccccccccccccc) { + printf("!!!: guard__ was overwritten! address: %p, value:%lx\n", &guard__[i], guard__[i]); + } + if (__guard[i]!=0xcccccccccccccccc) { + printf("!!!: __guard was overwritten! address: %p, value:%lx\n", &__guard[i], __guard[i]); + } + } } public: