Skip to content

for test only #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ tests/*.exp
tests/*.log
tests/*.sh
core.*
ftp-sync.json
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 25 additions & 2 deletions src/phpgo_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -236,17 +236,23 @@ 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;

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++)
Expand Down Expand Up @@ -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){
Expand Down Expand Up @@ -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:
Expand Down