[PHP-DEV] Is this a bug?
Are there instances you all can think of where doing a header('location: $url'); causes a loss of all session data? I have a case I can reproduce consistently where doing a header() refresh or echoing out an HTML page with a meta refresh both cause resulting page to lose session. My hunch is that I may not be accounting for some ingrained PHP handling and that this isn't a bug but I can't be sure. If required, I can submit the offending code but I'll hold off in case there is an obvious answer. -- Tony Bibbs I guess you have to remember that those who don't [EMAIL PROTECTED] hunt or fish often see those of us who do as harmlessly strange and sort of amusing. When you think about it, that might be a fair assessment. --Unknown -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Is this a bug?
--- Tony Bibbs [EMAIL PROTECTED] wrote: Are there instances you all can think of where doing a header('location: $url'); causes a loss of all session data? This is most likely not a bug. You can (hopefully) find more people to help with this type of question on [EMAIL PROTECTED] Good luck. Chris -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Fix for bug #22386
Er, wrong patch. Proper one is attached. J I wrote: The browscap extension is trying to load stuff into the object_store before it gets initialized, so this'll fix it. Entries from the browscap.ini file are now stored in straight hashes rather than objects, but the return value is still an object. snip J Index: browscap.c === RCS file: /repository/php4/ext/standard/browscap.c,v retrieving revision 1.68 diff -u -r1.68 browscap.c --- browscap.c 24 Jan 2003 16:29:40 - 1.68 +++ browscap.c 11 Mar 2003 17:52:14 - @@ -34,11 +34,11 @@ static void browscap_entry_dtor(zval *pvalue) { - if (Z_TYPE_P(pvalue) == IS_OBJECT) { + if (Z_TYPE_P(pvalue) == IS_ARRAY) { TSRMLS_FETCH(); - zend_hash_destroy(Z_OBJPROP_P(pvalue)); - free(Z_OBJPROP_P(pvalue)); + zend_hash_destroy(Z_ARRVAL_P(pvalue)); + free(Z_ARRVAL_P(pvalue)); } } @@ -61,8 +61,9 @@ } t = (char *) malloc(Z_STRLEN_P(pattern)*2 + 1); + t[0] = '^'; - for (i=0, j=0; iZ_STRLEN_P(pattern); i++, j++) { + for (i=0, j=1; iZ_STRLEN_P(pattern); i++, j++) { switch (Z_STRVAL_P(pattern)[i]) { case '?': t[j] = '.'; @@ -114,32 +115,41 @@ new_key = zend_strndup(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)); zend_str_tolower(new_key, Z_STRLEN_P(arg1)); -zend_hash_update(Z_OBJPROP_P(current_section), new_key, Z_STRLEN_P(arg1)+1, new_property, sizeof(zval *), NULL); +zend_hash_update(Z_ARRVAL_P(current_section), new_key, Z_STRLEN_P(arg1)+1, new_property, sizeof(zval *), NULL); free(new_key); } break; case ZEND_INI_PARSER_SECTION: { zval *processed; +zval *unprocessed; HashTable *section_properties; TSRMLS_FETCH(); /*printf('%s' (%d)\n,$1.value.str.val,$1.value.str.len+1);*/ current_section = (zval *) malloc(sizeof(zval)); INIT_PZVAL(current_section); +array_init(current_section); processed = (zval *) malloc(sizeof(zval)); INIT_PZVAL(processed); +unprocessed = (zval *) malloc(sizeof(zval)); +INIT_PZVAL(unprocessed); section_properties = (HashTable *) malloc(sizeof(HashTable)); -_object_and_properties_init(current_section, ZEND_STANDARD_CLASS_DEF_PTR, section_properties ZEND_FILE_LINE_CC TSRMLS_CC); - zend_hash_init(section_properties, 0, NULL, (dtor_func_t) browscap_entry_dtor, 1); -zend_hash_update(browser_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, (void *) current_section, sizeof(zval *), NULL); +current_section-value.ht = section_properties; +zend_hash_update(browser_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, (void *) current_section, sizeof(zval *), NULL); Z_STRVAL_P(processed) = Z_STRVAL_P(arg1); Z_STRLEN_P(processed) = Z_STRLEN_P(arg1); Z_TYPE_P(processed) = IS_STRING; +Z_STRVAL_P(unprocessed) = Z_STRVAL_P(arg1); +Z_STRLEN_P(unprocessed) = Z_STRLEN_P(arg1); +Z_TYPE_P(unprocessed) = IS_STRING; +Z_STRVAL_P(unprocessed) = zend_strndup(Z_STRVAL_P(unprocessed), Z_STRLEN_P(unprocessed)); + convert_browscap_pattern(processed); -zend_hash_update(section_properties, browser_name_pattern, sizeof(browser_name_pattern), (void *) processed, sizeof(zval *), NULL); +zend_hash_update(section_properties, browser_name_regex, sizeof(browser_name_regex), (void *) processed, sizeof(zval *), NULL); +zend_hash_update(section_properties, browser_name_pattern, sizeof(browser_name_pattern), (void *) unprocessed, sizeof(zval *), NULL); } break; } @@ -154,6 +164,7 @@ if (browscap) { zend_file_handle fh; + memset(fh, 0, sizeof(fh)); if (zend_hash_init(browser_hash, 0, NULL, (dtor_func_t) browscap_entry_dtor, 1)==FAILURE) { return FAILURE; @@ -197,7 +208,11 @@ if (*found_browser_entry) { /* already found */ return 0; } - if(zend_hash_find(Z_OBJPROP_PP(browser), browser_name_pattern, sizeof(browser_name_pattern), (void **) browser_name) == FAILURE) { + if (zend_hash_find(Z_ARRVAL_PP(browser), browser_name_regex, sizeof(browser_name_regex), (void **) browser_name) == FAILURE) { + return 0; + } + + if (Z_STRVAL_PP(browser_name)[0] != '^') { return 0; } if (regcomp(r, Z_STRVAL_PP(browser_name), REG_NOSUB)!=0) { @@ -215,35 +230,35 @@ Get information about the capabilities of a browser */ PHP_FUNCTION(get_browser) { - zval **agent_name, **agent; + zval **agent_name = NULL, **agent, **retarr; zval *found_browser_entry, *tmp_copy; char *lookup_browser_name; + zend_bool return_array = 0; if (!INI_STR(browscap)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, browscap ini directive not set.); RETURN_FALSE; } - - switch(ZEND_NUM_ARGS()) { - case 0: - if (!PG(http_globals)[TRACK_VARS_SERVER] -|| zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]-value.ht, HTTP_USER_AGENT, sizeof(HTTP_USER_AGENT), (void **) agent_name)==FAILURE) { -php_error_docref(NULL TSRMLS_CC, E_WARNING, HTTP_USER_AGENT variable is not set, cannot determine user
[PHP-DEV] Re: RE : TR : Bug #21549 [Opn-Fbk]: problem with INGRES II permanentconnexions
On Thu, 30 Jan 2003, pierre-marie mouliere wrote: Please attached find the patch We can not accept this patch as we can not allow: 1. having /* ARC INTERNATIONAL */ on every line you touched, 2. using the prefix _ai_ to functions you changed 3. indentation with spaces, and totally ignoring the Coding Standards Derick -- - Derick Rethans http://derickrethans.nl/ JDI Media Solutions http://www.jdimedia.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - 192,195c192,209 static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) { II_LINK *link = (II_LINK *) rsrc-ptr; IIAPI_AUTOPARM autoParm; --- /* Create this function so it can be called by the close function */ /* (calling parameter is link) */ /* May be not the best way to do it */ static void _ai_clean_ii_plink(II_LINK *link) /* ARC INTERNATIONAL */ { /* ARC INTERNATIONAL */ int ai_error = 0; /* ARC INTERNATIONAL */ IIAPI_DISCONNPARM disconnParm; /* ARC INTERNATIONAL */ IIAPI_AUTOPARM autoParm; /* ARC INTERNATIONAL */ /* if link as always been marked as broken do nothing */ /* This because we call this function directly from close function */ /* And it's called by ZEND garbage at end of script */ if (link-connHandle == NULL) { /* ARC INTERNATIONAL */ return; /* ARC INTERNATIONAL */ } /* ARC INTERNATIONAL */ if(link-stmtHandle _close_statement(link)) {/* ARC INTERNATIONAL */ php_error(E_WARNING, Ingres II: Unable to close statement !!); /* ARC INTERNATIONAL */ ai_error = 1; /* ARC INTERNATIONAL */ } /* ARC INTERNATIONAL */ 197c211 if (link-autocommit) { --- if(link-autocommit) { /* ARC INTERNATIONAL */ 199,201c213,216 if (link-stmtHandle _close_statement(link)) { php_error(E_WARNING, Ingres II: Unable to close statement !!); } --- autoParm.ac_genParm.gp_callback = NULL; /* ARC INTERNATIONAL */ autoParm.ac_genParm.gp_closure = NULL;/* ARC INTERNATIONAL */ autoParm.ac_connHandle = link-connHandle;/* ARC INTERNATIONAL */ autoParm.ac_tranHandle = link-tranHandle;/* ARC INTERNATIONAL */ 203,206c218,219 autoParm.ac_genParm.gp_callback = NULL; autoParm.ac_genParm.gp_closure = NULL; autoParm.ac_connHandle = link-connHandle; autoParm.ac_tranHandle = link-tranHandle; --- IIapi_autocommit(autoParm); /* ARC INTERNATIONAL */ ii_sync((autoParm.ac_genParm)); /* ARC INTERNATIONAL */ 208,209c221,223 IIapi_autocommit(autoParm); ii_sync((autoParm.ac_genParm)); --- if(ii_success((autoParm.ac_genParm))==II_FAIL) { /* ARC INTERNATIONAL */ php_error(E_WARNING, Ingres II: Unable to disable autocommit); /* ARC INTERNATIONAL */ } /* ARC INTERNATIONAL */ 211,213c225,227 if (ii_success((autoParm.ac_genParm)) == II_FAIL) { php_error(E_WARNING, Ingres II: Unable to disable autocommit); } --- link-autocommit = 0; /* ARC INTERNATIONAL */ link-tranHandle = NULL; /* ARC INTERNATIONAL */ } /* ARC INTERNATIONAL */ 215,217c229,242
[PHP-DEV] [PATCH] fix for bug #21600
Attached is a patch for bug #21600. This problem is caused by unnecessary zval destruction performed when trying to assign a value that is originated from the same zval. Moriyoshi Index: Zend/zend_execute.c === RCS file: /repository/Zend/zend_execute.c,v retrieving revision 1.316.2.3 diff -u -r1.316.2.3 zend_execute.c --- Zend/zend_execute.c 31 Dec 2002 16:22:59 - 1.316.2.3 +++ Zend/zend_execute.c 13 Jan 2003 00:34:32 - @@ -265,27 +265,37 @@ variable_ptr_ptr = EG(uninitialized_zval_ptr); /* } else if (variable_ptr==EG(uninitialized_zval) || variable_ptr!=value_ptr) { */ } else if (variable_ptr_ptr != value_ptr_ptr) { - variable_ptr-refcount--; - if (variable_ptr-refcount==0) { - zendi_zval_dtor(*variable_ptr); - FREE_ZVAL(variable_ptr); - } + if (variable_ptr != value_ptr) { + variable_ptr-refcount--; + if (variable_ptr-refcount==0) { + zendi_zval_dtor(*variable_ptr); + FREE_ZVAL(variable_ptr); + } - if (!PZVAL_IS_REF(value_ptr)) { - /* break it away */ - value_ptr-refcount--; - if (value_ptr-refcount0) { - ALLOC_ZVAL(*value_ptr_ptr); - **value_ptr_ptr = *value_ptr; - value_ptr = *value_ptr_ptr; - zendi_zval_copy_ctor(*value_ptr); + if (!PZVAL_IS_REF(value_ptr)) { + /* break it away */ + value_ptr-refcount--; + if (value_ptr-refcount0) { + ALLOC_ZVAL(*value_ptr_ptr); + **value_ptr_ptr = *value_ptr; + value_ptr = *value_ptr_ptr; + zendi_zval_copy_ctor(*value_ptr); + } + value_ptr-refcount = 1; + value_ptr-is_ref = 1; + } + *variable_ptr_ptr = value_ptr; + value_ptr-refcount++; + } else { + if (value_ptr == EG(uninitialized_zval_ptr)) { + ALLOC_ZVAL(value_ptr); + value_ptr-type = IS_NULL; + value_ptr-refcount = 1; + value_ptr-is_ref = 1; + *variable_ptr_ptr = *value_ptr_ptr = value_ptr; + value_ptr-refcount++; } - value_ptr-refcount = 1; - value_ptr-is_ref = 1; } - - *variable_ptr_ptr = value_ptr; - value_ptr-refcount++; } else { if (variable_ptr-refcount1) { /* we need to break away */ SEPARATE_ZVAL(variable_ptr_ptr); -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Proposed fix for bug #21149
The current implementation of php_register_variable_ex() improperly handles situations when the name of the variable passed via GET/POST/COOKIES contains a '[' or it's urlencoded equivalent. The result is a small memory leak (number of chars between '[' and '=' +1) and invalid data inside the GET/POST/COOKIES array. The proposed patch makes php_register_variable_ex aware that [ may not be terminated and adds handling for such conditions. The end result is that the code no longer leaks memory can support variable passed via GET/POST/COOKIES with '[' in their names. Ilia P.S. This patch is against HEAD and is not intended for 4.3.0 Index: php_variables.c === RCS file: /repository/php4/main/php_variables.c,v retrieving revision 1.46 diff -u -3 -p -r1.46 php_variables.c --- php_variables.c 7 Dec 2002 16:05:27 - 1.46 +++ php_variables.c 24 Dec 2002 00:44:59 - @@ -120,7 +120,27 @@ PHPAPI void php_register_variable_ex(cha while (1) { if (is_array) { - char *escaped_index; + char *escaped_index = NULL, *index_s; + int new_idx_len = 0; + + ip++; + index_s = ip; + if (isspace(*ip)) { + ip++; + } + if (*ip==']') { + index_s = NULL; + } else { + ip = strchr(ip, ']'); + if (!ip) { + *(index_s - 1) = '['; + index_len = var_len = strlen(var); + goto plain_var; + return; + } + *ip = 0; + new_idx_len = strlen(index_s); + } if (!index) { MAKE_STD_ZVAL(gpc_element); @@ -148,22 +168,9 @@ PHPAPI void php_register_variable_ex(cha } symtable1 = Z_ARRVAL_PP(gpc_element_p); /* ip pointed to the '[' character, now obtain the key */ - index = ++ip; - index_len = 0; - if (*ip=='\n' || *ip=='\r' || *ip=='\t' || *ip==' ') { - ip++; - } - if (*ip==']') { - index = NULL; - } else { - ip = strchr(ip, ']'); - if (!ip) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Missing ] in %s variable, var); - return; - } - *ip = 0; - index_len = strlen(index); - } + index = index_s; + index_len = new_idx_len; + ip++; if (*ip=='[') { is_array = 1; @@ -172,6 +179,7 @@ PHPAPI void php_register_variable_ex(cha is_array = 0; } } else { +plain_var: MAKE_STD_ZVAL(gpc_element); gpc_element-value = val-value; Z_TYPE_P(gpc_element) = Z_TYPE_P(val); -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Proposed fix for bug #21149
On Mon, 23 Dec 2002, Ilia A. wrote: IA The current implementation of php_register_variable_ex() improperly handles IA situations when the name of the variable passed via GET/POST/COOKIES contains IA a '[' or it's urlencoded equivalent. The result is a small memory leak IA (number of chars between '[' and '=' +1) and invalid data inside the IA GET/POST/COOKIES array. IA The proposed patch makes php_register_variable_ex aware that [ may not be IA terminated and adds handling for such conditions. The end result is that the IA code no longer leaks memory can support variable passed via IA GET/POST/COOKIES with '[' in their names. IA [02:21] ilia melvyn: +1 it :) [02:23] melvyn ilia: not sure that's gonna help with my karma factor :) [02:23] ilia melvyn: doesn't matter :) so -ehm +1? -- With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Patch for bug #20539
The attached patch fixes a crash in CLI when php.ini contains: session.auto_start=1 magic_quotes_gpc=1 Could you please review it? SID is neither persistent nor case-sensitive. We should resort to such a hack only, if there is no proper bug fix. - Sascha -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Fix for bug #19566
I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 09:32:48 - -722,9 +722,13 HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; + if (p == NULL) { + va_start(args, num_args); + va_end(args); + } while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; -733,8 +737,8 } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } marcus At 09:52 08.11.2002, Moriyoshi Koizumi wrote: Hi, The attached patch is a probable fix for bug #19566. I guess the bug is that va_list is not properly initialized before each callback function call. I've tested it in PPC linux, and it works fine. Regards, Moriyoshi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Fix for bug #19566
See http://www.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html This appears to imply that va_start() can be used more than twice. And I don't think va_start() always has to be invoked. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 09:32:48 - @@ -722,9 +722,13 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; + if (p == NULL) { + va_start(args, num_args); + va_end(args); + } while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +737,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } marcus At 09:52 08.11.2002, Moriyoshi Koizumi wrote: Hi, The attached patch is a probable fix for bug #19566. I guess the bug is that va_list is not properly initialized before each callback function call. I've tested it in PPC linux, and it works fine. Regards, Moriyoshi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Fix for bug #19566
Some comments on ISO9899 standard 7.15.1.3-2 Read between the lines: without va_end the behaviour is undefined. What ever that means i guess you have to call va_end and that requires va_start. 7.15.1.4-3 Says do not call va_start twice without va_end. marcus ISO/IEC 9899:1999 (E) ©ISO/IEC 7.15.1.3 The va_end macro Synopsis 1 #include stdarg.h void va_end(va_list ap); Description 2 The va_end macro facilitates a normal return from the function whose variable argument list was referred to by the expansion of va_start, or the function containing the expansion of va_copy, that initialized the va_list ap. The va_end macro may modify ap so that it is no longer usable (without an intervening invocation of va_start or va_copy). If there is no corresponding invocation of the va_start or va_copy macro, or if the va_end macro is not invoked before the return, the behavior is undefined. Returns 3 The va_end macro returns no value. 7.15.1.4 The va_start macro Synopsis 1 #include stdarg.h void va_start(va_list ap, parmN); Description 2 The va_start macro shall be invoked before any access to the unnamed arguments. 3 The va_start macro initializes ap for subsequent use by va_arg and va_end. va_start (or va_copy) shall not be invoked again for the same ap without an intervening invocation of va_end for the same ap. (...) At 10:47 08.11.2002, Moriyoshi Koizumi wrote: See http://www.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html This appears to imply that va_start() can be used more than twice. And I don't think va_start() always has to be invoked. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 09:32:48 - @@ -722,9 +722,13 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; + if (p == NULL) { + va_start(args, num_args); + va_end(args); + } while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +737,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } marcus At 09:52 08.11.2002, Moriyoshi Koizumi wrote: Hi, The attached patch is a probable fix for bug #19566. I guess the bug is that va_list is not properly initialized before each callback function call. I've tested it in PPC linux, and it works fine. Regards, Moriyoshi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Fix for bug #19566
Yep, the spec goes right. a corresponding va_end() dtor should be applied to ap once ap has been initialized by a va_start(). IMO no va_end() is needed without a preceding va_start(), and it doesn't matter if ap is used between va_start() and va_end(). BTW, could anyone commit this patch if there seems no problem? Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: Some comments on ISO9899 standard 7.15.1.3-2 Read between the lines: without va_end the behaviour is undefined. What ever that means i guess you have to call va_end and that requires va_start. 7.15.1.4-3 Says do not call va_start twice without va_end. marcus ISO/IEC 9899:1999 (E) ©ISO/IEC 7.15.1.3 The va_end macro Synopsis 1 #include stdarg.h void va_end(va_list ap); Description 2 The va_end macro facilitates a normal return from the function whose variable argument list was referred to by the expansion of va_start, or the function containing the expansion of va_copy, that initialized the va_list ap. The va_end macro may modify ap so that it is no longer usable (without an intervening invocation of va_start or va_copy). If there is no corresponding invocation of the va_start or va_copy macro, or if the va_end macro is not invoked before the return, the behavior is undefined. Returns 3 The va_end macro returns no value. 7.15.1.4 The va_start macro Synopsis 1 #include stdarg.h void va_start(va_list ap, parmN); Description 2 The va_start macro shall be invoked before any access to the unnamed arguments. 3 The va_start macro initializes ap for subsequent use by va_arg and va_end. va_start (or va_copy) shall not be invoked again for the same ap without an intervening invocation of va_end for the same ap. (...) At 10:47 08.11.2002, Moriyoshi Koizumi wrote: See http://www.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html This appears to imply that va_start() can be used more than twice. And I don't think va_start() always has to be invoked. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 09:32:48 - @@ -722,9 +722,13 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; + if (p == NULL) { + va_start(args, num_args); + va_end(args); + } while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +737,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } marcus At 09:52 08.11.2002, Moriyoshi Koizumi wrote: Hi, The attached patch is a probable fix for bug #19566. I guess the bug is that va_list is not properly initialized before each callback function call. I've tested it in PPC linux, and it works fine. Regards, Moriyoshi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Fix for bug #19566
Moriyoshi could you make a *.phpt file from the bug? Attached is a new diff tested already. It also fixes a compiler warning. Since i do not have Zend karma someone with karma should commit it or give me karma. marcus cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend\) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 17:25:59 - @@ -722,9 +722,9 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +733,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } @@ -1163,7 +1163,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) { - Bucket *p1, *p2; + Bucket *p1, *p2 = NULL /* fixes warning */; int result; void *pData2; At 16:45 08.11.2002, Moriyoshi Koizumi wrote: Yep, the spec goes right. a corresponding va_end() dtor should be applied to ap once ap has been initialized by a va_start(). IMO no va_end() is needed without a preceding va_start(), and it doesn't matter if ap is used between va_start() and va_end(). BTW, could anyone commit this patch if there seems no problem? Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: Some comments on ISO9899 standard 7.15.1.3-2 Read between the lines: without va_end the behaviour is undefined. What ever that means i guess you have to call va_end and that requires va_start. 7.15.1.4-3 Says do not call va_start twice without va_end. marcus ISO/IEC 9899:1999 (E) ©ISO/IEC 7.15.1.3 The va_end macro Synopsis 1 #include stdarg.h void va_end(va_list ap); Description 2 The va_end macro facilitates a normal return from the function whose variable argument list was referred to by the expansion of va_start, or the function containing the expansion of va_copy, that initialized the va_list ap. The va_end macro may modify ap so that it is no longer usable (without an intervening invocation of va_start or va_copy). If there is no corresponding invocation of the va_start or va_copy macro, or if the va_end macro is not invoked before the return, the behavior is undefined. Returns 3 The va_end macro returns no value. 7.15.1.4 The va_start macro Synopsis 1 #include stdarg.h void va_start(va_list ap, parmN); Description 2 The va_start macro shall be invoked before any access to the unnamed arguments. 3 The va_start macro initializes ap for subsequent use by va_arg and va_end. va_start (or va_copy) shall not be invoked again for the same ap without an intervening invocation of va_end for the same ap. (...) At 10:47 08.11.2002, Moriyoshi Koizumi wrote: See http://www.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html This appears to imply that va_start() can be used more than twice. And I don't think va_start() always has to be invoked. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 09:32:48 - @@ -722,9 +722,13 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; + if (p == NULL) { + va_start(args, num_args); + va_end(args); + } while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +737,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } marcus At 09:52 08.11.2002, Moriyoshi Koizumi wrote: Hi, The attached patch is a probable fix for bug #19566. I guess the bug is that va_list is not properly initialized before each callback function call. I've tested it in PPC linux, and it works fine. Regards, Moriyoshi --
Re: [PHP-DEV] [PATCH] Fix for bug #19566
done. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: Moriyoshi could you make a *.phpt file from the bug? Attached is a new diff tested already. It also fixes a compiler warning. Since i do not have Zend karma someone with karma should commit it or give me karma. marcus cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend\) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 17:25:59 - @@ -722,9 +722,9 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +733,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } @@ -1163,7 +1163,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) { - Bucket *p1, *p2; + Bucket *p1, *p2 = NULL /* fixes warning */; int result; void *pData2; At 16:45 08.11.2002, Moriyoshi Koizumi wrote: Yep, the spec goes right. a corresponding va_end() dtor should be applied to ap once ap has been initialized by a va_start(). IMO no va_end() is needed without a preceding va_start(), and it doesn't matter if ap is used between va_start() and va_end(). BTW, could anyone commit this patch if there seems no problem? Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: Some comments on ISO9899 standard 7.15.1.3-2 Read between the lines: without va_end the behaviour is undefined. What ever that means i guess you have to call va_end and that requires va_start. 7.15.1.4-3 Says do not call va_start twice without va_end. marcus ISO/IEC 9899:1999 (E) ©ISO/IEC 7.15.1.3 The va_end macro Synopsis 1 #include stdarg.h void va_end(va_list ap); Description 2 The va_end macro facilitates a normal return from the function whose variable argument list was referred to by the expansion of va_start, or the function containing the expansion of va_copy, that initialized the va_list ap. The va_end macro may modify ap so that it is no longer usable (without an intervening invocation of va_start or va_copy). If there is no corresponding invocation of the va_start or va_copy macro, or if the va_end macro is not invoked before the return, the behavior is undefined. Returns 3 The va_end macro returns no value. 7.15.1.4 The va_start macro Synopsis 1 #include stdarg.h void va_start(va_list ap, parmN); Description 2 The va_start macro shall be invoked before any access to the unnamed arguments. 3 The va_start macro initializes ap for subsequent use by va_arg and va_end. va_start (or va_copy) shall not be invoked again for the same ap without an intervening invocation of va_end for the same ap. (...) At 10:47 08.11.2002, Moriyoshi Koizumi wrote: See http://www.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html This appears to imply that va_start() can be used more than twice. And I don't think va_start() always has to be invoked. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 09:32:48 - @@ -722,9 +722,13 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; + if (p == NULL) { + va_start(args, num_args); + va_end(args); + } while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +737,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht);
Re: [PHP-DEV] [PATCH] Fix for bug #19566
On Fri, 8 Nov 2002, Marcus Börger wrote: Moriyoshi could you make a *.phpt file from the bug? Attached is a new diff tested already. It also fixes a compiler warning. Since i do not have Zend karma someone with karma should commit it or give me karma. I can commit this, after you fix the whitespace :) Derick cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend\) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 17:25:59 - @@ -722,9 +722,9 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +733,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } @@ -1163,7 +1163,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) { - Bucket *p1, *p2; + Bucket *p1, *p2 = NULL /* fixes warning */; int result; void *pData2; At 16:45 08.11.2002, Moriyoshi Koizumi wrote: Yep, the spec goes right. a corresponding va_end() dtor should be applied to ap once ap has been initialized by a va_start(). IMO no va_end() is needed without a preceding va_start(), and it doesn't matter if ap is used between va_start() and va_end(). BTW, could anyone commit this patch if there seems no problem? Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: Some comments on ISO9899 standard 7.15.1.3-2 Read between the lines: without va_end the behaviour is undefined. What ever that means i guess you have to call va_end and that requires va_start. 7.15.1.4-3 Says do not call va_start twice without va_end. marcus ISO/IEC 9899:1999 (E) ©ISO/IEC 7.15.1.3 The va_end macro Synopsis 1 #include stdarg.h void va_end(va_list ap); Description 2 The va_end macro facilitates a normal return from the function whose variable argument list was referred to by the expansion of va_start, or the function containing the expansion of va_copy, that initialized the va_list ap. The va_end macro may modify ap so that it is no longer usable (without an intervening invocation of va_start or va_copy). If there is no corresponding invocation of the va_start or va_copy macro, or if the va_end macro is not invoked before the return, the behavior is undefined. Returns 3 The va_end macro returns no value. 7.15.1.4 The va_start macro Synopsis 1 #include stdarg.h void va_start(va_list ap, parmN); Description 2 The va_start macro shall be invoked before any access to the unnamed arguments. 3 The va_start macro initializes ap for subsequent use by va_arg and va_end. va_start (or va_copy) shall not be invoked again for the same ap without an intervening invocation of va_end for the same ap. (...) At 10:47 08.11.2002, Moriyoshi Koizumi wrote: See http://www.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html This appears to imply that va_start() can be used more than twice. And I don't think va_start() always has to be invoked. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 09:32:48 - @@ -722,9 +722,13 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; + if (p == NULL) { + va_start(args, num_args); + va_end(args); + } while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +737,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args);
Re: [PHP-DEV] [PATCH] Fix for bug #19566
I haven't followed the thread. What is the problem with the var_args()? Also, please don't commit the second part of the patch. The warning is due to the compiler not understanding the code well enough. Functionality wise there's no reason to NULL that variable. Live with the warning or upgrade to a better compiler. Andi At 07:25 PM 11/8/2002 +0100, Derick Rethans wrote: On Fri, 8 Nov 2002, Marcus Börger wrote: Moriyoshi could you make a *.phpt file from the bug? Attached is a new diff tested already. It also fixes a compiler warning. Since i do not have Zend karma someone with karma should commit it or give me karma. I can commit this, after you fix the whitespace :) Derick cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend\) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 17:25:59 - @@ -722,9 +722,9 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +733,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } @@ -1163,7 +1163,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) { - Bucket *p1, *p2; + Bucket *p1, *p2 = NULL /* fixes warning */; int result; void *pData2; At 16:45 08.11.2002, Moriyoshi Koizumi wrote: Yep, the spec goes right. a corresponding va_end() dtor should be applied to ap once ap has been initialized by a va_start(). IMO no va_end() is needed without a preceding va_start(), and it doesn't matter if ap is used between va_start() and va_end(). BTW, could anyone commit this patch if there seems no problem? Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: Some comments on ISO9899 standard 7.15.1.3-2 Read between the lines: without va_end the behaviour is undefined. What ever that means i guess you have to call va_end and that requires va_start. 7.15.1.4-3 Says do not call va_start twice without va_end. marcus ISO/IEC 9899:1999 (E) ©ISO/IEC 7.15.1.3 The va_end macro Synopsis 1 #include stdarg.h void va_end(va_list ap); Description 2 The va_end macro facilitates a normal return from the function whose variable argument list was referred to by the expansion of va_start, or the function containing the expansion of va_copy, that initialized the va_list ap. The va_end macro may modify ap so that it is no longer usable (without an intervening invocation of va_start or va_copy). If there is no corresponding invocation of the va_start or va_copy macro, or if the va_end macro is not invoked before the return, the behavior is undefined. Returns 3 The va_end macro returns no value. 7.15.1.4 The va_start macro Synopsis 1 #include stdarg.h void va_start(va_list ap, parmN); Description 2 The va_start macro shall be invoked before any access to the unnamed arguments. 3 The va_start macro initializes ap for subsequent use by va_arg and va_end. va_start (or va_copy) shall not be invoked again for the same ap without an intervening invocation of va_end for the same ap. (...) At 10:47 08.11.2002, Moriyoshi Koizumi wrote: See http://www.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html This appears to imply that va_start() can be used more than twice. And I don't think va_start() always has to be invoked. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 09:32:48 - @@ -722,9 +722,13 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; + if (p == NULL) { + va_start(args, num_args); + va_end(args); + } while (p != NULL) { + va_start(args, num_args);
Re: [PHP-DEV] [PATCH] Fix for bug #19566
var_args issue doesn't have much to do with the purpose of the patch. We were perhaps just curious about the usage of va_start() and va_end(). And that warning reducer was later added by Marcus, so the first version should look nice. What about it? Moriyoshi Andi Gutmans [EMAIL PROTECTED] wrote: I haven't followed the thread. What is the problem with the var_args()? Also, please don't commit the second part of the patch. The warning is due to the compiler not understanding the code well enough. Functionality wise there's no reason to NULL that variable. Live with the warning or upgrade to a better compiler. Andi At 07:25 PM 11/8/2002 +0100, Derick Rethans wrote: On Fri, 8 Nov 2002, Marcus Börger wrote: Moriyoshi could you make a *.phpt file from the bug? Attached is a new diff tested already. It also fixes a compiler warning. Since i do not have Zend karma someone with karma should commit it or give me karma. I can commit this, after you fix the whitespace :) Derick cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend\) Index: zend_hash.c === RCS file: /repository/ZendEngine2/zend_hash.c,v retrieving revision 1.93 diff -u -r1.93 zend_hash.c --- zend_hash.c 5 Nov 2002 18:22:02 - 1.93 +++ zend_hash.c 8 Nov 2002 17:25:59 - @@ -722,9 +722,9 @@ HASH_PROTECT_RECURSION(ht); - va_start(args, num_args); p = ht-pListHead; while (p != NULL) { + va_start(args, num_args); hash_key.arKey = p-arKey; hash_key.nKeyLength = p-nKeyLength; hash_key.h = p-h; @@ -733,8 +733,8 @@ } else { p = p-pListNext; } + va_end(args); } - va_end(args); HASH_UNPROTECT_RECURSION(ht); } @@ -1163,7 +1163,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) { - Bucket *p1, *p2; + Bucket *p1, *p2 = NULL /* fixes warning */; int result; void *pData2; At 16:45 08.11.2002, Moriyoshi Koizumi wrote: Yep, the spec goes right. a corresponding va_end() dtor should be applied to ap once ap has been initialized by a va_start(). IMO no va_end() is needed without a preceding va_start(), and it doesn't matter if ap is used between va_start() and va_end(). BTW, could anyone commit this patch if there seems no problem? Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: Some comments on ISO9899 standard 7.15.1.3-2 Read between the lines: without va_end the behaviour is undefined. What ever that means i guess you have to call va_end and that requires va_start. 7.15.1.4-3 Says do not call va_start twice without va_end. marcus ISO/IEC 9899:1999 (E) ©ISO/IEC 7.15.1.3 The va_end macro Synopsis 1 #include stdarg.h void va_end(va_list ap); Description 2 The va_end macro facilitates a normal return from the function whose variable argument list was referred to by the expansion of va_start, or the function containing the expansion of va_copy, that initialized the va_list ap. The va_end macro may modify ap so that it is no longer usable (without an intervening invocation of va_start or va_copy). If there is no corresponding invocation of the va_start or va_copy macro, or if the va_end macro is not invoked before the return, the behavior is undefined. Returns 3 The va_end macro returns no value. 7.15.1.4 The va_start macro Synopsis 1 #include stdarg.h void va_start(va_list ap, parmN); Description 2 The va_start macro shall be invoked before any access to the unnamed arguments. 3 The va_start macro initializes ap for subsequent use by va_arg and va_end. va_start (or va_copy) shall not be invoked again for the same ap without an intervening invocation of va_end for the same ap. (...) At 10:47 08.11.2002, Moriyoshi Koizumi wrote: See http://www.opengroup.org/onlinepubs/007908799/xsh/stdarg.h.html This appears to imply that va_start() can be used more than twice. And I don't think va_start() always has to be invoked. Moriyoshi [EMAIL PROTECTED] (Marcus Börger) wrote: I am not sure if va_start can be called twice in a row (rekursive). Manual does not say anything about that. How about: cvs -z3 -q diff zend_hash.c (in directory S:\php4-HEAD\Zend) Index: zend_hash.c ===
[PHP-DEV] Re: Ming streams bug
Hi Rasmus, It could actually be an fopencookie detection bug. Can you try both of these things: A. toggle the configure detected value for COOKIE_SEEKER_USES_FPOS_T then recompile. B. #undef HAVE_FOPENCOOKIE then recompile. Hopefully the first one solves the problem (so we just need to fix the configure check). --Wez. On 15/10/02, Rasmus Lerdorf [EMAIL PROTECTED] wrote: Wez, I think we need to pass a real FILE * into the ming stuff. Take a look at this segfault: (gdb) run ming.php Starting program: /usr/local/bin/php ming.php FWS%xeHdC Program received signal SIGSEGV, Segmentation fault. 0x403da4d4 in free () from /lib/libc.so.6 (gdb) bt #0 0x403da4d4 in free () from /lib/libc.so.6 #1 0x403cffe8 in _IO_free_wbackup_area_internal () from /lib/libc.so.6 #2 0x403cdee0 in _IO_seekoff_internal () from /lib/libc.so.6 #3 0x403d269a in fseek () from /lib/libc.so.6 #4 0x40506d82 in SWFInput_file_seek (input=0x8321ae0, offset=0, whence=0) at input.c:93 #5 0x40506c9e in SWFInput_seek (input=0x8321ae0, offset=0, whence=0) at input.c:52 #6 0x40506d31 in SWFInput_rewind (input=0x8321ae0) at input.c:75 #7 0x40507545 in methodWriteJpegFile (input=0x8321ae0, method=0x4001d610 phpByteOutputMethod, data=0x0) at jpeg.c:87 #8 0x4050776d in writeSWFJpegBitmapToMethod (block=0x8321b58, method=0x4001d610 phpByteOutputMethod, data=0x0) at jpeg.c:181 #9 0x40504451 in writeSWFBlockToMethod (block=0x8321b58, method=0x4001d610 phpByteOutputMethod, data=0x0) at block.c:87 #10 0x404f2ab8 in SWFBlockList_writeBlocksToMethod (list=0x8314480, method=0x4001d610 phpByteOutputMethod, data=0x0) at blocklist.c:78 #11 0x404f1ed2 in SWFMovie_output (movie=0x832cfd0, method=0x4001d610 phpByteOutputMethod, data=0x0) at movie.c:262 #12 0x4001d681 in zif_swfmovie_output (ht=0, return_value=0x832da2c, this_ptr=0x83228d4, return_value_used=0) at /home/rasmus/php4/ext/ming/ming.c:1432 #13 0x081d8807 in execute (op_array=0x8321104) at /home/rasmus/php4/Zend/zend_execute.c:1597 #14 0x081c698c in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/rasmus/php4/Zend/zend.c:839 #15 0x0818f622 in php_execute_script (primary_file=0xb880) at /home/rasmus/php4/main/main.c:1542 #16 0x081de9d6 in main (argc=2, argv=0xb924) at /home/rasmus/php4/sapi/cli/php_cli.c:695 #17 0x4037d1c4 in __libc_start_main () from /lib/libc.so.6 (gdb) up #1 0x403cffe8 in _IO_free_wbackup_area_internal () from /lib/libc.so.6 (gdb) up #2 0x403cdee0 in _IO_seekoff_internal () from /lib/libc.so.6 (gdb) up #3 0x403d269a in fseek () from /lib/libc.so.6 (gdb) up #4 0x40506d82 in SWFInput_file_seek (input=0x8321ae0, offset=0, whence=0) at input.c:93 93 if(fseek((FILE *)input-data, offset, whence) == -1) (gdb) p *(FILE *)input-data $3 = {_flags = 1930623196, _IO_read_ptr = 0x82308e0 /home/rasmus/php4/Zend/zend_API.c, _IO_read_end = 0x255 Address 0x255 out of bounds, _IO_read_base = 0x0, _IO_write_base = 0x82308e0 /home/rasmus/php4/Zend/zend_API.c, _IO_write_ptr = 0x249 Address 0x249 out of bounds, _IO_write_end = 0x8315030 \022s\017#\b\006\001, _IO_buf_base = 0x8314380 \022s\017#\b, _IO_buf_end = 0x2c Address 0x2c out of bounds, _IO_save_base = 0x8 Address 0x8 out of bounds, _IO_backup_base = 0x7 Address 0x7 out of bounds, _IO_save_end = 0x0, _markers = 0x0, _chain = 0x0, _fileno = 0, _blksize = 0, _old_offset = 137446308, _cur_column = 20156, _vtable_offset = 28 '\034', _shortbuf = \b, _lock = 0x5a01, _offset = 3066894738570346496, __pad1 = 0x0, __pad2 = 0x83143d0, _mode = 81, _unused2 = \022s\017#\b, '\0' repeats 15 times, C1\bC1\b , '\0' repeats 18 times} (gdb) p *(php_stream*)input-data $7 = {ops = 0x7312f8dc, abstract = 0x82308e0, filterhead = 0x255, filtertail = 0x0, wrapper = 0x82308e0, wrapperthis = 0x249, wrapperdata = 0x8315030, fgetss_state = 137446272, is_persistent = 44, mode = \b\0\0\0\a\0\0\0\0\0\0\0\0\0\0, rsrc_id = 0, in_free = 0, fclose_stdiocast = 0, stdiocast = 0x83143a4, __exposed = 136072892, __orig_path = 0x5a01 , context = 0x0, flags = 714067076, position = 0, readbuf = 0x83143d0 \022s\b#\bU\002, readbuflen = 81, readpos = 1930623196, writepos = 136515520, chunk_size = 178, eof = 0} It is casting it to a FILE * and trying to do an fseek, so passing it a php_stream is bad news here. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Ming streams bug
A. toggle the configure detected value for COOKIE_SEEKER_USES_FPOS_T then recompile. It was undefined. I defined it. B. #undef HAVE_FOPENCOOKIE then recompile. It was defined, I undefined it. Make clean, recompile and try again. Exactly the same segfault. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Ming streams bug
have you got a script I can try out? Did you try A and B separately? I might not be able to reproduce this, because my glibc is the older flavour :-/ I'll give it a go though! --Wez. On 16/10/02, Rasmus Lerdorf [EMAIL PROTECTED] wrote: A. toggle the configure detected value for COOKIE_SEEKER_USES_FPOS_T then recompile. It was undefined. I defined it. B. #undef HAVE_FOPENCOOKIE then recompile. It was defined, I undefined it. Make clean, recompile and try again. Exactly the same segfault. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Ming streams bug
It's just a spinning logo flash movie. I have attached the script and the little logo image it spins. And no, I didn't try the two separately yet. -Rasmus On Wed, 16 Oct 2002, Wez Furlong wrote: have you got a script I can try out? Did you try A and B separately? I might not be able to reproduce this, because my glibc is the older flavour :-/ I'll give it a go though! --Wez. On 16/10/02, Rasmus Lerdorf [EMAIL PROTECTED] wrote: A. toggle the configure detected value for COOKIE_SEEKER_USES_FPOS_T then recompile. It was undefined. I defined it. B. #undef HAVE_FOPENCOOKIE then recompile. It was defined, I undefined it. Make clean, recompile and try again. Exactly the same segfault. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php ? $s = new SWFShape(); $fp = fopen('php-big.jpg','r'); $jpg = new SWFBitmap($fp); fclose($fp); $w = $jpg-getWidth(); $h = $jpg-getHeight(); $f = $s-addFill($jpg); $f-moveTo(-$w/2, -$h/2); $s-setRightFill($f); $s-movePenTo(-$w/2, -$h/2); $s-drawLine($w, 0); $s-drawLine(0, $h); $s-drawLine(-$w, 0); $s-drawLine(0, -$h); $p = new SWFSprite(); $i = $p-add($s); for($step=0; $step360; $step+=2) { $p-nextFrame(); $i-rotate(-2); } $m = new SWFMovie(); $i = $m-add($p); $i-moveTo(230,120); $m-setRate(100); $m-setDimension($w*1.8, $h*1.8); header('Content-type: application/x-shockwave-flash'); $m-output(); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Ming streams bug
Try taking out the fclose($fp) line :-) fclose nukes the stream (just like all the other resource freeing functions) so it's not valid by the time that ming goes to use it = crash. Replacing fclose($fp) with $fp = null; is probably the correct thing to do in the script; there is not much that can be done to prevent the crash from happening :-/ --Wez. On 16/10/02, Rasmus Lerdorf [EMAIL PROTECTED] wrote: It's just a spinning logo flash movie. I have attached the script and the little logo image it spins. And no, I didn't try the two separately yet. -Rasmus On Wed, 16 Oct 2002, Wez Furlong wrote: have you got a script I can try out? Did you try A and B separately? I might not be able to reproduce this, because my glibc is the older flavour :-/ I'll give it a go though! --Wez. On 16/10/02, Rasmus Lerdorf [EMAIL PROTECTED] wrote: A. toggle the configure detected value for COOKIE_SEEKER_USES_FPOS_T then recompile. It was undefined. I defined it. B. #undef HAVE_FOPENCOOKIE then recompile. It was defined, I undefined it. Make clean, recompile and try again. Exactly the same segfault. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Ming streams bug
Hrm.. That does fix it. This has worked for ages with the fclose though. A bunch of leaks though: /home/rasmus/php4/Zend/zend_hash.c(178) : Freeing 0x08325DCC (32 bytes), script=ming.php Last leak repeated 3 times /home/rasmus/php4/Zend/zend_API.c(597) : Freeing 0x08325D6C (44 bytes), script=ming.php /home/rasmus/php4/Zend/zend_API.c(585) : Actual location (location was relayed) Last leak repeated 3 times I'll have a look at those. -Rasmus On Wed, 16 Oct 2002, Wez Furlong wrote: Try taking out the fclose($fp) line :-) fclose nukes the stream (just like all the other resource freeing functions) so it's not valid by the time that ming goes to use it = crash. Replacing fclose($fp) with $fp = null; is probably the correct thing to do in the script; there is not much that can be done to prevent the crash from happening :-/ --Wez. On 16/10/02, Rasmus Lerdorf [EMAIL PROTECTED] wrote: It's just a spinning logo flash movie. I have attached the script and the little logo image it spins. And no, I didn't try the two separately yet. -Rasmus On Wed, 16 Oct 2002, Wez Furlong wrote: have you got a script I can try out? Did you try A and B separately? I might not be able to reproduce this, because my glibc is the older flavour :-/ I'll give it a go though! --Wez. On 16/10/02, Rasmus Lerdorf [EMAIL PROTECTED] wrote: A. toggle the configure detected value for COOKIE_SEEKER_USES_FPOS_T then recompile. It was undefined. I defined it. B. #undef HAVE_FOPENCOOKIE then recompile. It was defined, I undefined it. Make clean, recompile and try again. Exactly the same segfault. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] URL Rewriting Possible Bug
I'm not sure if this is something that can easily be repaired or what not, but myself and another programmer ran in to a problem converting some legacy software to PHP (from an antiquated language called iHTML). We are using id based sessions throughout the site, and on one page we have PHP outputing we have a URL which says: doc.write(nbsp;a href=javascript:top.openHelp('http://help.internetstore.com/; + foldersNode[4] + ')img src='http://assets.internetstore.com/help2.gif' border=0/a a class=mainlink href=\javascript:top.redrawTree(+ foldersNode[5] +,'+ foldersNode[6] +','+ foldersNode[4] +','+ foldersNode[3] +')\+foldersNode[3]+/a/td/tr) And after the Session URL Rewriter gets through with it, we get: doc.write(nbsp;a href=javascript:top.openHelp('http://help.internetstore.com/; + foldersNode[4] + ')img src='http://assets.internetstore.com/help2.gif' border=0/a a class=mainlink href=\?sid=47388ff232bb66e8a37d9486502634bfjavascript:top.redrawTree(+ foldersNode[5] +,'+ foldersNode[6] +','+ foldersNode[4] +','+ foldersNode[3] +')\+foldersNode[3]+/a/td/tr) And that one throws Javascript errors. We know we can turn off URL Rewrite on that one page or the entire site, or the entire server, are possibly even use cookies, but it would be nice if it would not attempt to parse it, since it does so incorrectly. Any ideas? Adam Voigt [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] fix for bug #18654
Thanks, I've committed the patch to CVS. Sander On Mon, Aug 19, 2002 at 03:42:12PM +0200, Christophe Sollet wrote: hi, this patch fix bug #18654 by extending the nvexp definition. The diff contains the resulting re2c var_unserializer.c. [snip] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] fix for bug #18654
Sander Roobol wrote: Can it be merged in the 4.2 branch too ? It would be great to have 4.2.3 without this bug. Christophe Thanks, I've committed the patch to CVS. Sander On Mon, Aug 19, 2002 at 03:42:12PM +0200, Christophe Sollet wrote: hi, this patch fix bug #18654 by extending the nvexp definition. The diff contains the resulting re2c var_unserializer.c. [snip] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] fix for bug #18654
Yeah, should have done that immediately. Committed. On Tue, Aug 20, 2002 at 09:41:54PM +0200, Christophe Sollet wrote: Sander Roobol wrote: Can it be merged in the 4.2 branch too ? It would be great to have 4.2.3 without this bug. Christophe Thanks, I've committed the patch to CVS. Sander On Mon, Aug 19, 2002 at 03:42:12PM +0200, Christophe Sollet wrote: hi, this patch fix bug #18654 by extending the nvexp definition. The diff contains the resulting re2c var_unserializer.c. [snip] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] fix for bug #18654
hi, this patch fix bug #18654 by extending the nvexp definition. The diff contains the resulting re2c var_unserializer.c. Index: var_unserializer.c === RCS file: /repository/php4/ext/standard/var_unserializer.c,v retrieving revision 1.17 diff -u -r1.17 var_unserializer.c --- var_unserializer.c19 Aug 2002 10:58:18 -1.17 +++ var_unserializer.c19 Aug 2002 13:21:38 - -1,4 +1,4 -/* Generated by re2c 0.5 on Sun Aug 18 15:18:22 2002 */ +/* Generated by re2c 0.5 on Mon Aug 19 15:11:57 2002 */ #line 1 var_unserializer.re #include php.h #include ext/standard/php_var.h -581,13 +581,24 yy46:++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy47:if(yych = '/'){ -if(yych == '.')goto yy58; -goto yy2; +yy47:if(yych = ':'){ +if(yych = '.'){ +if(yych = '-')goto yy2; +goto yy58; +} else { +if(yych = '/')goto yy2; +if(yych = '9')goto yy46; +goto yy2; +} } else { -if(yych = '9')goto yy46; -if(yych == ';')goto yy51; -goto yy2; +if(yych = 'E'){ +if(yych = ';')goto yy51; +if(yych = 'D')goto yy2; +goto yy53; +} else { +if(yych == 'e')goto yy53; +goto yy2; +} } yy48:yych = *++YYCURSOR; if(yych = '/')goto yy2; Index: var_unserializer.re === RCS file: /repository/php4/ext/standard/var_unserializer.re,v retrieving revision 1.10 diff -u -r1.10 var_unserializer.re --- var_unserializer.re18 Aug 2002 12:22:28 -1.10 +++ var_unserializer.re19 Aug 2002 13:21:38 - -92,7 +92,7 /*!re2c iv = [+-]? [0-9]+; nv = [+-]? ([0-9]* . [0-9]+|[0-9]+ . [0-9]+); -nvexp = nv [eE] [+-]? iv; +nvexp = (iv | nv) [eE] [+-]? iv; any = [\000-\277]; */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] multipart/form-data bug [crossposted]
Sorry for the cross-post, but I don't know which side is causing this bug, Apache or PHP. OS: Solaris 8 Apache: 1.3.26 PHP: 4.2.2 (DSO) By default, PHP sets max_post_size to 8Mb. If the post data exceeds that, it seems PHP discards all of it (no post data gets to the script). In my situation upload_max_filesize was set higher than 8Mb (tho this may not have any effect on the bug). When a big (11Mb) file was posted with multipart/form-data, PHP ignored all the data, but it seems part of the POST data was *reparsed* by Apache! In the apache access logs it shows the post, then the next request looks like this (wrapped): 24.58.34.117 - - [16/Aug/2002:11:49:58 -0400] -1103527590377401575662824084 200 6568 - - This seems to be caused since PHP stopped after reading the HTTP header (ending in Content-Length: 11993812\n\n). The next lines in the post were: 1103527590377401575662824084 Content-Disposition: form-data; name=bar [EMAIL PROTECTED] 1103527590377401575662824084 and so on until the tcp session was reset. Does anyone see something odd here? :-) Enjoy. This does not happen on FreeBSD/Apache-1.3.26/PHP-cvs. But hey, I learned that a shortcut for GET / HTTP/1.0\n\n is -\n, and there are no headers to parse. :-) -James -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Tru64, snprintf and bug #1298
Yes, that is correct, bug #1298 (it's existed for a LONG time). The user is having some difficulty compiling the Zend libraries for 4.2.2. Mainly it seems that snprintf is turning up as an unresolved symbol. I asked him to grep through the /usr/include looking for it, and the result was nothing. Looking through the code I see PHP has it's own snprintf implementation, and that should suffice. Apparently zend_API.c though doesn't notice it. His fix was to place #include php.h inside the file, and everything worked fine. Does anyone have any more insight into this that they might be able to share? --- Dan KalowskyA little less conversation, http://www.deadmime.org/~danka little more action. [EMAIL PROTECTED]- A Little Less Conversation, [EMAIL PROTECTED]Elvis Presley -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Mail-Header in bug-list
Hi would it be possible to revert the headers, or put the status at the end of the subject?! Its impossible to read the subjects in your mailclient, even if you use a terminal. Thx in advance Georg -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Mail-Header in bug-list
- Original Message - From: Georg Richter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 26, 2002 11:04 PM Subject: [PHP-DEV] Mail-Header in bug-list Hi would it be possible to revert the headers, or put the status at the end of the subject?! Its impossible to read the subjects in your mailclient, even if you use a terminal. +1 with best regards Joerg Behrens -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Switching zlib.output_compression, bug #16109
On 2002-06-25 09:36:20, Yasuo Ohgaki wrote: Yasuo Ohgaki wrote: I would suggest turn off compression for image. I mean turn off compression manually. As you already know, turning on and off by header(mime-type) does not work always, thus it's confusing. Yes, but we need some kind of detection in order to disable it for PHP internally generated images like the PHP/Zend logos used by phpinfo(). Or we have to switch compression off there. Stefan -- Stefan Röhrich [EMAIL PROTECTED], [EMAIL PROTECTED] http://www.roehri.ch/~sr/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: Switching zlib.output_compression, bug #16109
Personally, I don't really care to have compression turned off automatically for images. I'd like to be able to make that choice myself. For the browsers that work correctly, an uncompressed generated image will still be able to take advantage of zlib compression. I *DO* like the ability to be able to ini_set (or turn off some other way) the zlib.output_compression switch. That way, if I want to turn off compression for some reason, I can just use the switch. FYI, Netscape doesn't just have problems with images. Netscape also doesn't properly render compressed ILAYERs. On my site, I have to disable HTML (For Netscape) that is rendered in an ILAYER. While the bugs in Netscape aren't necessarily PHP's problem, it really would be nice to be able to turn off compression in cases where we have to, *because* of the browser bugs. The choice of using .htaccess complicates something that should be easily tunable from within the script. Jaime Bozza -Original Message- From: Stefan Roehrich [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 25, 2002 8:19 AM To: Yasuo Ohgaki Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DEV] Re: Switching zlib.output_compression, bug #16109 On 2002-06-25 09:36:20, Yasuo Ohgaki wrote: Yasuo Ohgaki wrote: I would suggest turn off compression for image. I mean turn off compression manually. As you already know, turning on and off by header(mime-type) does not work always, thus it's confusing. Yes, but we need some kind of detection in order to disable it for PHP internally generated images like the PHP/Zend logos used by phpinfo(). Or we have to switch compression off there. Stefan -- Stefan Röhrich [EMAIL PROTECTED], [EMAIL PROTECTED] http://www.roehri.ch/~sr/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Switching zlib.output_compression, bug #16109
Stefan Roehrich wrote: Hello! There has been a bug report (#16109) about a bug in Netscape 4.79, which doesn't display images if Content-Encoding: gzip is used. After thinking about a browser detection config flag for zlib.output compression, at LinuxTag we discussed, that a more general solution would be better, that means switching off output compression for images and let it be possible to switch it off (or force it on) during script execution. I would suggest turn off compression for image. As you already know, turning on and off by header(mime-type) does not work always, thus it's confusing. -- Yasuo Ohgaki -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Switching zlib.output_compression, bug #16109
Yasuo Ohgaki wrote: Stefan Roehrich wrote: Hello! There has been a bug report (#16109) about a bug in Netscape 4.79, which doesn't display images if Content-Encoding: gzip is used. After thinking about a browser detection config flag for zlib.output compression, at LinuxTag we discussed, that a more general solution would be better, that means switching off output compression for images and let it be possible to switch it off (or force it on) during script execution. I would suggest turn off compression for image. I mean turn off compression manually. As you already know, turning on and off by header(mime-type) does not work always, thus it's confusing. -- Yasuo Ohgaki -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] for proc_close() Bug #17538
Do a cvs diff -u and post the patch to the list with [PATCH] in the subject; CC me directly. I'll try and apply it over the weekend, unless someone else here applies it for you in the meantime. That would be great :) Thanks for your extensive testing of proc_open/proc_close :-) No problems. Something gives me the impression that I'm the first person to use the functions to any great extent, but it's been fun learning and playing with the PHP source. The patch is somewhat more developed than what I posted before, I commented what's actually happening (once I figured out what was actually happening), and it checks that the process exited normally now (it didn't before, which would have returned spurious exit codes in some cases). I am moderately confident that it should be fairy reliable, as opposed to what I posted before, which was more of a one-off this works for me, someone please make it work for everyone. Thanks, KimS ? proc_close_patch Index: ext/standard/exec.c === RCS file: /repository/php4/ext/standard/exec.c,v retrieving revision 1.76 diff -u -r1.76 exec.c --- ext/standard/exec.c 23 May 2002 10:17:07 - 1.76 +++ ext/standard/exec.c 13 Jun 2002 00:03:21 - -559,23 +559,33 GetExitCodeProcess(child, wstatus); FG(pclose_ret) = wstatus; #else -# if HAVE_SYS_WAIT +#if HAVE_SYS_WAIT_H int wstatus; pid_t child, wait_pid; child = (pid_t)rsrc-ptr; do { + /* fetch status of child process */ wait_pid = waitpid(child, wstatus, 0); - } while (wait_pid == -1 errno = EINTR); + + /* if wait_pid == 1 and errno == EINTR, then waitpid() is just +* alerting of a signal that's been caught - so keep looping +* until wait_pid != -1 (the child process has exited) or +* errno != EINTR (there was a real error, not just a caught +* signal) +*/ + } while (wait_pid == -1 errno == EINTR); - if (wait_pid == -1) - FG(pclose_ret) = -1; - else - FG(pclose_ret) = wstatus; -# else + /* if the child process exited normally, set pclose_ret to the exit +* status of the child process, otherwise set it to -1 (this might +* happen if there's no child process, or it didn't exit normally) +*/ + FG(pclose_ret) = wait_pid 0 WIFEXITED(wstatus) ? + WEXITSTATUS(wstatus) : -1; +#else FG(pclose_ret) = -1; -# endif +#endif #endif } -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] zlib double free bug and php
Sorry to post here but I've received no response on the php-general list. I posted the following to that list a couple days ago and I was wondering if anyone on this list can help me. Thank you for your time.Lenny I've tried to search the archives/bug reports/faq's and didn't find any definitive answers on the zlib Double Free Bug CERT's Advisory CA-2002-07 issue. Even though I didn't compile php with the --with-zlib option when I run strings against the php library I still see zlib information. For example: strings libphp4.a | grep -i zlib Request error: class file/memory mismatch Zlib So Zlib is still in the libphp4.a library. So does this mean that I could possibly still be vulnerable to the zlib Double Free Bug? Also, if I DO need to compile php with the --with-zlib option I assume I will also need to give it the --with-zlib-dir option. I assume if that zlib install directory does NOT have the bug, then I would be safe from it. I'm asking since I know there's the ext/zlib directory under the php source directory (well at least php v4.0.6) and I'm not sure if the bug exists somewhere in those files. Thanks for any help you can give me on those 2 questions. Please mail me directly since I'm not on this list. Thanks for your time and help, Lenny Miceli -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] zlib double free bug and php
Hi, PHP is as vulnerable as it is the libz of your system. PHP does not include zlib, it links against it which means it has already to be on your system. It is up to you to have the proper libz on your system, PHP just links against it. That's it. - Markus On Wed, Jun 05, 2002 at 03:39:55PM -0400, Lenny Miceli wrote : Sorry to post here but I've received no response on the php-general list. I posted the following to that list a couple days ago and I was wondering if anyone on this list can help me. Thank you for your time.Lenny I've tried to search the archives/bug reports/faq's and didn't find any definitive answers on the zlib Double Free Bug CERT's Advisory CA-2002-07 issue. Even though I didn't compile php with the --with-zlib option when I run strings against the php library I still see zlib information. For example: strings libphp4.a | grep -i zlib Request error: class file/memory mismatch Zlib So Zlib is still in the libphp4.a library. So does this mean that I could possibly still be vulnerable to the zlib Double Free Bug? Also, if I DO need to compile php with the --with-zlib option I assume I will also need to give it the --with-zlib-dir option. I assume if that zlib install directory does NOT have the bug, then I would be safe from it. I'm asking since I know there's the ext/zlib directory under the php source directory (well at least php v4.0.6) and I'm not sure if the bug exists somewhere in those files. Thanks for any help you can give me on those 2 questions. Please mail me directly since I'm not on this list. Thanks for your time and help, Lenny Miceli -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc Did I help you?http://guru.josefine.at/wish_en Konnte ich helfen? http://guru.josefine.at/wish_de -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] zlib double free bug and php
Hello! On 2002-06-05 15:39:55, Lenny Miceli wrote: issue. Even though I didn't compile php with the --with-zlib option when I run strings against the php library I still see zlib information. For Maybe zlib is used by another library which PHP uses (e.g. some graphic library, MySQL, ...). So Zlib is still in the libphp4.a library. So does this mean that I could possibly still be vulnerable to the zlib Double Free Bug? If you linked against a vulnerable zlib. Also, if I DO need to compile php with the --with-zlib option I assume I will also need to give it the --with-zlib-dir option. I assume if It isn't needed, otherwise PHP tries to find zlib. that zlib install directory does NOT have the bug, then I would be safe from it. I'm asking since I know there's the ext/zlib directory under the php source directory (well at least php v4.0.6) and I'm not sure if the bug exists somewhere in those files. The bug was in the zlib library, not in any file distributed with PHP. If you link against a new zlib version you should be safe (if you built PHP with a shared zlib library it's enough to update this library, you don't have to rebuild PHP, but check with phpinfo() to which version PHP is actually linked after the update). You can use phpinfo() to see to which zlib version PHP is linked, 1.1.4 should be safe (but some systems use patched version of 1.1.3, which are safe, but don't show a higher version number (bare 1.1.3 is vulnerable)). Stefan -- Stefan Röhrich [EMAIL PROTECTED], [EMAIL PROTECTED] http://www.roehri.ch/~sr/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Operator Precedence bug
Andrew, On Wed, 15 May 2002, Andrew Sitnikov wrote: Hello derick, What you thing about this http://bugs.php.net/bug.php?id=17180 ? It must be marked as Open instead Analized ? No, I think it should be a documentation problem. It just doesn't make any sense to do it like this, and fixing it would require a lot of effort, which can better be spend on other useful issues. regards, Derick --- Did I help you? http://www.jdimedia.nl/derick/link.php?url=giftlist Frequent ranting: http://www.jdimedia.nl/derick/ --- PHP: Scripting the Web - [EMAIL PROTECTED] All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net --- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] Fix for bug 16888
The following fixes bug 16888 so that Apache and IIS no longer crash on Windows when using the domxml extension with more than 128 nodes. See http://bugs.php.net/bug.php?id=16888 for details. Will the memory leak gurus please have a go at this and let me know what problems arise? Also, please test on non Win platforms to make sure that no functionality is lost. I'll commit it on Tuesday after I get back from vacation. Thanks, Joseph -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] Fix for bug 16888
On Thu, 16 May 2002, Joseph Tate wrote: The following fixes bug 16888 so that Apache and IIS no longer crash on Windows when using the domxml extension with more than 128 nodes. See http://bugs.php.net/bug.php?id=16888 for details. Will the memory leak gurus please have a go at this and let me know what problems arise? Also, please test on non Win platforms to make sure that no functionality is lost. i certainly will (but i'm not the memory leak guru :) ), but the patch didn't make it through the mailing list. can you put it somewhere online? or send it to me personally, i can put it then on my webserver. chregu -- nam...christian stockeradr...bremgartnerstr. 66, ch-8003 zurich pho...+41 1 451 6021 www...http://phant.ch/chregu mob...+41 76 561 8860 [EMAIL PROTECTED] wor...+41 1 240 5670 gpg...0x5CE1DECB -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] HASH_(UN)PROTECT_RECURSION bug?
HASH_PROTECT_RECURSION/HASH_UNPROTECT_RECURSION is defined zend_hash.c. Why HASH_UNPROTECT_RECURSION is decrementing nApplyCount unconditionally while HASH_PROTECT_RECURSION is incrementing nApplyCount conditionally? It does not make sense, since apply count became 255 from 0 when bApplyProtection is false. Patch is included. -- Yasuo Ohgaki /usr/bin/diff: conflicting specifications of output style --- zend_hash.c.~1.83.~ Sat Apr 13 16:06:23 2002 +++ zend_hash.c Tue Apr 16 12:41:55 2002 -112,8 +112,9 } -#define HASH_UNPROTECT_RECURSION(ht) \ - (ht)-nApplyCount--; +#define HASH_UNPROTECT_RECURSION(ht) \ +if ((ht)-bApplyProtection) \ +(ht)-nApplyCount--; #define ZEND_HASH_IF_FULL_DO_RESIZE(ht)\ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] zend questions and bug #15333
http://bugs.php.net/15333 I've narrowed down the problem, but can't seem to get anywhere with it. The state of the server when the problem occurrs: All serviceable threads have been killed or have timed out. A request is received prompting the spawning of a new thread. The new thread then goes through and copies the global_constants_table, but that has been corrupted somewhere causing an access violation when trying to dereference uninitialized memory. This happens every time the server has been idle for ~10 minutes after serving up php pages. Here are my questions that I haven't been able to track down yet. Hopefully someone can save me some time. 1. What code is executed when a thread times out? zend_shutdown never seems to run (or at least my breakpoints there never fire). 2. It appears that global_constants_table is not global nor constant, each thread has a separate copy. Why is this the case? And if it is meant to be, where is the original global_constants_table. What could be modifying it so that it cannot be copied when a new thread is started? 3. Where would be a good place to start to find the answers to the zend questions that I have as I track this down. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] zend questions and bug #15333
Is this using the Microsoft libraries? If so, I have encountered similar string function problems while creating an NT service. In the MS libs, strings are handled as 32 bit integers with any odd bytes masked off at the end of the string. The rep counter increments 4 times per iteration until odd bytes are encountered. I worked around this by writing my own string copy function. Billy Rose [EMAIL PROTECTED] -Original Message- From: Joseph Tate [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 1:41 PM To: Php-Dev List Subject: [PHP-DEV] zend questions and bug #15333 http://bugs.php.net/15333 I've narrowed down the problem, but can't seem to get anywhere with it. The state of the server when the problem occurrs: All serviceable threads have been killed or have timed out. A request is received prompting the spawning of a new thread. The new thread then goes through and copies the global_constants_table, but that has been corrupted somewhere causing an access violation when trying to dereference uninitialized memory. This happens every time the server has been idle for ~10 minutes after serving up php pages. Here are my questions that I haven't been able to track down yet. Hopefully someone can save me some time. 1.What code is executed when a thread times out? zend_shutdown never seems to run (or at least my breakpoints there never fire). 2.It appears that global_constants_table is not global nor constant, each thread has a separate copy. Why is this the case? And if it is meant to be, where is the original global_constants_table. What could be modifying it so that it cannot be copied when a new thread is started? 3.Where would be a good place to start to find the answers to the zend questions that I have as I track this down. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] zend questions and bug #15333
Forgot to mention, the algorithm in the MS lib is what is faulty. It overruns the buffer at times. Billy Rose [EMAIL PROTECTED] -Original Message- From: Joseph Tate [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 1:41 PM To: Php-Dev List Subject: [PHP-DEV] zend questions and bug #15333 http://bugs.php.net/15333 I've narrowed down the problem, but can't seem to get anywhere with it. The state of the server when the problem occurrs: All serviceable threads have been killed or have timed out. A request is received prompting the spawning of a new thread. The new thread then goes through and copies the global_constants_table, but that has been corrupted somewhere causing an access violation when trying to dereference uninitialized memory. This happens every time the server has been idle for ~10 minutes after serving up php pages. Here are my questions that I haven't been able to track down yet. Hopefully someone can save me some time. 1.What code is executed when a thread times out? zend_shutdown never seems to run (or at least my breakpoints there never fire). 2.It appears that global_constants_table is not global nor constant, each thread has a separate copy. Why is this the case? And if it is meant to be, where is the original global_constants_table. What could be modifying it so that it cannot be copied when a new thread is started? 3.Where would be a good place to start to find the answers to the zend questions that I have as I track this down. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] zend questions and bug #15333
zend_strndup is a php implementation. It does not use the strndup function available through MS's library. The problem occurs because a length of 100 or more is passed in, signifying to me that the source of that length has become corrupted or not initialized. I've traced that back to the global_constants_table structure. I no longer get the specific error mentioned in the bug report, but get an error in the same location under the same circumstances. My error looks like the following: The HTTP server encountered an unhandled exception while processing the ISAPI Application ' msvcrt!memcpy + 0x33 php4ts!zend_strndup + 0x38 php4ts!zend_get_extension + 0xA0 php4ts!zend_hash_copy + 0x7B php4ts!zend_get_extension + 0xFB php4ts!zend_print_zval_r_ex + 0x999 php4ts!ts_resource_ex + 0x21F php4ts!ts_resource_ex + 0x98 php4isapi!HttpExtensionProc + 0x37 wam + 0x7A91 wam + 0x8634 RPCRT4!NdrServerInitialize + 0x45B RPCRT4!NdrStubCall2 + 0x1A5 RPCRT4!CStdStubBuffer_Invoke + 0x82 ole32!StgGetIFillLockBytesOnFile + 0xA270 ole32!StgGetIFillLockBytesOnFile + 0xA21F ole32!CoImpersonateClient + 0x1B8 + 0xFF6C8BE0 + 0x1132AE13 '. Of course I'm using the Release_TSDbg version of php4isapi rather than a release, so that's why I have a stack trace. All of this is with the current PHP_4_2_0 release branch. Joseph -Original Message- From: Rose, Billy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 2:54 PM To: 'Joseph Tate'; Php-Dev List Subject: RE: [PHP-DEV] zend questions and bug #15333 Forgot to mention, the algorithm in the MS lib is what is faulty. It overruns the buffer at times. Billy Rose [EMAIL PROTECTED] -Original Message- From: Joseph Tate [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 1:41 PM To: Php-Dev List Subject: [PHP-DEV] zend questions and bug #15333 http://bugs.php.net/15333 I've narrowed down the problem, but can't seem to get anywhere with it. The state of the server when the problem occurrs: All serviceable threads have been killed or have timed out. A request is received prompting the spawning of a new thread. The new thread then goes through and copies the global_constants_table, but that has been corrupted somewhere causing an access violation when trying to dereference uninitialized memory. This happens every time the server has been idle for ~10 minutes after serving up php pages. Here are my questions that I haven't been able to track down yet. Hopefully someone can save me some time. 1. What code is executed when a thread times out? zend_shutdown never seems to run (or at least my breakpoints there never fire). 2. It appears that global_constants_table is not global nor constant, each thread has a separate copy. Why is this the case? And if it is meant to be, where is the original global_constants_table. What could be modifying it so that it cannot be copied when a new thread is started? 3. Where would be a good place to start to find the answers to the zend questions that I have as I track this down. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] zend questions and bug #15333
In your stack dump, the function call that bombed was memcpy in the MS lib. Looking at the source in zend_alloc.c, I find that the lib's memcpy function is used. The way I finally tracked down my problem was tedious as hell, but I put the MS debug macro just before the function that was failing (in this case zend_strndup). Then I single stepped into the MS function that was failing. This method was required because I was running a service. I bet if you write an adhoc my_memcpy function in C and byte for byte copy over the string, the problem goes away. memcpy uses the same 32 bit algorothm as the string functions. I sent in a bug report to MS about a year ago, but was blown off (swept under the rug rather perhaps?). The algorithm seems to blow up only under weird circumstances. Billy Rose [EMAIL PROTECTED] -Original Message- From: Joseph Tate [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 2:05 PM To: Rose, Billy; Php-Dev List Subject: RE: [PHP-DEV] zend questions and bug #15333 zend_strndup is a php implementation. It does not use the strndup function available through MS's library. The problem occurs because a length of 100 or more is passed in, signifying to me that the source of that length has become corrupted or not initialized. I've traced that back to the global_constants_table structure. I no longer get the specific error mentioned in the bug report, but get an error in the same location under the same circumstances. My error looks like the following: The HTTP server encountered an unhandled exception while processing the ISAPI Application ' msvcrt!memcpy + 0x33 php4ts!zend_strndup + 0x38 php4ts!zend_get_extension + 0xA0 php4ts!zend_hash_copy + 0x7B php4ts!zend_get_extension + 0xFB php4ts!zend_print_zval_r_ex + 0x999 php4ts!ts_resource_ex + 0x21F php4ts!ts_resource_ex + 0x98 php4isapi!HttpExtensionProc + 0x37 wam + 0x7A91 wam + 0x8634 RPCRT4!NdrServerInitialize + 0x45B RPCRT4!NdrStubCall2 + 0x1A5 RPCRT4!CStdStubBuffer_Invoke + 0x82 ole32!StgGetIFillLockBytesOnFile + 0xA270 ole32!StgGetIFillLockBytesOnFile + 0xA21F ole32!CoImpersonateClient + 0x1B8 + 0xFF6C8BE0 + 0x1132AE13 '. Of course I'm using the Release_TSDbg version of php4isapi rather than a release, so that's why I have a stack trace. All of this is with the current PHP_4_2_0 release branch. Joseph -Original Message- From: Rose, Billy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 2:54 PM To: 'Joseph Tate'; Php-Dev List Subject: RE: [PHP-DEV] zend questions and bug #15333 Forgot to mention, the algorithm in the MS lib is what is faulty. It overruns the buffer at times. Billy Rose [EMAIL PROTECTED] -Original Message- From: Joseph Tate [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 1:41 PM To: Php-Dev List Subject: [PHP-DEV] zend questions and bug #15333 http://bugs.php.net/15333 I've narrowed down the problem, but can't seem to get anywhere with it. The state of the server when the problem occurrs: All serviceable threads have been killed or have timed out. A request is received prompting the spawning of a new thread. The new thread then goes through and copies the global_constants_table, but that has been corrupted somewhere causing an access violation when trying to dereference uninitialized memory. This happens every time the server has been idle for ~10 minutes after serving up php pages. Here are my questions that I haven't been able to track down yet. Hopefully someone can save me some time. 1.What code is executed when a thread times out? zend_shutdown never seems to run (or at least my breakpoints there never fire). 2.It appears that global_constants_table is not global nor constant, each thread has a separate copy. Why is this the case? And if it is meant to be, where is the original global_constants_table. What could be modifying it so that it cannot be copied when a new thread is started? 3.Where would be a good place to start to find the answers to the zend questions that I have as I track this down. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] zend questions and bug #15333
I've looked at it in the debugger immediately before the access violation and have found that both the pointer to the char* to be copied and the length are garbage, so it's not the lib. -Original Message- From: Rose, Billy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 3:29 PM To: 'Joseph Tate'; Rose, Billy; Php-Dev List Subject: RE: [PHP-DEV] zend questions and bug #15333 In your stack dump, the function call that bombed was memcpy in the MS lib. Looking at the source in zend_alloc.c, I find that the lib's memcpy function is used. The way I finally tracked down my problem was tedious as hell, but I put the MS debug macro just before the function that was failing (in this case zend_strndup). Then I single stepped into the MS function that was failing. This method was required because I was running a service. I bet if you write an adhoc my_memcpy function in C and byte for byte copy over the string, the problem goes away. memcpy uses the same 32 bit algorothm as the string functions. I sent in a bug report to MS about a year ago, but was blown off (swept under the rug rather perhaps?). The algorithm seems to blow up only under weird circumstances. Billy Rose [EMAIL PROTECTED] -Original Message- From: Joseph Tate [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 2:05 PM To: Rose, Billy; Php-Dev List Subject: RE: [PHP-DEV] zend questions and bug #15333 zend_strndup is a php implementation. It does not use the strndup function available through MS's library. The problem occurs because a length of 100 or more is passed in, signifying to me that the source of that length has become corrupted or not initialized. I've traced that back to the global_constants_table structure. I no longer get the specific error mentioned in the bug report, but get an error in the same location under the same circumstances. My error looks like the following: The HTTP server encountered an unhandled exception while processing the ISAPI Application ' msvcrt!memcpy + 0x33 php4ts!zend_strndup + 0x38 php4ts!zend_get_extension + 0xA0 php4ts!zend_hash_copy + 0x7B php4ts!zend_get_extension + 0xFB php4ts!zend_print_zval_r_ex + 0x999 php4ts!ts_resource_ex + 0x21F php4ts!ts_resource_ex + 0x98 php4isapi!HttpExtensionProc + 0x37 wam + 0x7A91 wam + 0x8634 RPCRT4!NdrServerInitialize + 0x45B RPCRT4!NdrStubCall2 + 0x1A5 RPCRT4!CStdStubBuffer_Invoke + 0x82 ole32!StgGetIFillLockBytesOnFile + 0xA270 ole32!StgGetIFillLockBytesOnFile + 0xA21F ole32!CoImpersonateClient + 0x1B8 + 0xFF6C8BE0 + 0x1132AE13 '. Of course I'm using the Release_TSDbg version of php4isapi rather than a release, so that's why I have a stack trace. All of this is with the current PHP_4_2_0 release branch. Joseph -Original Message- From: Rose, Billy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 2:54 PM To: 'Joseph Tate'; Php-Dev List Subject: RE: [PHP-DEV] zend questions and bug #15333 Forgot to mention, the algorithm in the MS lib is what is faulty. It overruns the buffer at times. Billy Rose [EMAIL PROTECTED] -Original Message- From: Joseph Tate [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 1:41 PM To: Php-Dev List Subject: [PHP-DEV] zend questions and bug #15333 http://bugs.php.net/15333 I've narrowed down the problem, but can't seem to get anywhere with it. The state of the server when the problem occurrs: All serviceable threads have been killed or have timed out. A request is received prompting the spawning of a new thread. The new thread then goes through and copies the global_constants_table, but that has been corrupted somewhere causing an access violation when trying to dereference uninitialized memory. This happens every time the server has been idle for ~10 minutes after serving up php pages. Here are my questions that I haven't been able to track down yet. Hopefully someone can save me some time. 1. What code is executed when a thread times out? zend_shutdown never seems to run (or at least my breakpoints there never fire). 2. It appears that global_constants_table is not global nor constant, each thread has a separate copy. Why is this the case? And if it is meant to be, where is the original global_constants_table. What could be modifying it so that it cannot be copied when a new thread is started? 3. Where would be a good place to start to find the answers to the zend questions that I have as I track this down. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http
[PHP-DEV] Re: Fix for Bug #16265 breaks inheritance!
On Tue, 26 Mar 2002, Wez Furlong wrote: Hi Derick, I don't know if you have tried something like this with the recent changes that were made to zend_compile.c: Class A { function fred() { } } Class B extends A { function fred() { } } Class B is not allowed to override fred()! A slightly more clever version of the method redeclaration check is needed I think! Yeah, that's why I asked Andi to confirm my patch, but I guess he didn't thought of this either. Derick -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [Fwd: posix_uname another bug @^|[@#\@^#~@{[?]
---BeginMessage--- refere include file : sys/utsname.h ! You can see if the macro __USE_GNU is set the char returned are 'domainname' else the char are '__domainname' #@\[~\ You know this function can do a apache segfault ?! Becarful cuz domainename doesn't exist on freebsd ! there is the current (PHP-4.2.0RC1) code on : ext/posix/posix.c /* {{{ proto array posix_uname(void) Get system name (POSIX.1, 4.4.1) */ PHP_FUNCTION(posix_uname) { struct utsname u; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) return; if (uname(u) 0) { POSIX_G(last_error) = errno; RETURN_FALSE; } if (array_init(return_value) == FAILURE) { // TODO: Should we issue a warning here so we don't have ambiguity // with the above return value ? RETURN_FALSE; } add_assoc_string(return_value, sysname, u.sysname, 1); add_assoc_string(return_value, nodename, u.nodename, 1); add_assoc_string(return_value, release, u.release, 1); add_assoc_string(return_value, version, u.version, 1); add_assoc_string(return_value, machine, u.machine, 1); #ifdef _GNU_SOURCE/* i'm okay */ add_assoc_string(return_value, domainname, u.domainname, 1); /* - {|^@#\|^[#\ */ #endif } /* }}} */ /*Fixed code--*/ /* {{{ proto array posix_uname(void) Get system name (POSIX.1, 4.4.1) */ PHP_FUNCTION(posix_uname) { struct utsname u; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) return; if (uname(u) 0) { POSIX_G(last_error) = errno; RETURN_FALSE; } if (array_init(return_value) == FAILURE) { // TODO: Should we issue a warning here so we don't have ambiguity // with the above return value ? RETURN_FALSE; } add_assoc_string(return_value, sysname, u.sysname, 1); add_assoc_string(return_value, nodename, u.nodename, 1); add_assoc_string(return_value, release, u.release, 1); add_assoc_string(return_value, version, u.version, 1); add_assoc_string(return_value, machine, u.machine, 1); #ifdef _GNU_SOURCE #ifdef __USE_GNU add_assoc_string(return_value, domainname, u.domainname, 1); #else add_assoc_string(return_value, domainname, u.__domainname, 1); #endif #endif } /* }}} */ ---End Message--- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [Fwd: posix_uname another bug @^|[@#\@^#~@{[?]
Why do you think apache gets a segfault? The only thing is the the 'domainname' key is missing from the hash although it should display the content of __domainname (on non-bsd systems) I'm willing to fix it if someone comes up with a proper patch that also honors BSD. It's not very critical I think (until I miss the obvious). - Markus On Sun, Mar 24, 2002 at 12:16:41PM +0100, Vergoz Michael (SYSDOOR) wrote : Date: Sun, 24 Mar 2002 12:03:42 +0100 From: Vergoz Michael (SYSDOOR) [EMAIL PROTECTED] Subject: posix_uname another bug @^|[@#\@^#~@{[? User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020214 To: php-qa [EMAIL PROTECTED] From - Sun Mar 24 12:03:43 2002 X-Mozilla-Status2: refere include file : sys/utsname.h ! You can see if the macro __USE_GNU is set the char returned are 'domainname' else the char are '__domainname' #@\[@~\ You know this function can do a apache segfault ?! Becarful cuz domainename doesn't exist on freebsd ! there is the current (PHP-4.2.0RC1) code on : ext/posix/posix.c /* {{{ proto array posix_uname(void) Get system name (POSIX.1, 4.4.1) */ PHP_FUNCTION(posix_uname) { struct utsname u; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) return; if (uname(u) 0) { POSIX_G(last_error) = errno; RETURN_FALSE; } if (array_init(return_value) == FAILURE) { // TODO: Should we issue a warning here so we don't have ambiguity // with the above return value ? RETURN_FALSE; } add_assoc_string(return_value, sysname, u.sysname, 1); add_assoc_string(return_value, nodename, u.nodename, 1); add_assoc_string(return_value, release, u.release, 1); add_assoc_string(return_value, version, u.version, 1); add_assoc_string(return_value, machine, u.machine, 1); #ifdef _GNU_SOURCE/* i'm okay */ add_assoc_string(return_value, domainname, u.domainname, 1); /* - {|^@#\|^[#\ */ #endif } /* }}} */ /*Fixed code--*/ /* {{{ proto array posix_uname(void) Get system name (POSIX.1, 4.4.1) */ PHP_FUNCTION(posix_uname) { struct utsname u; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) return; if (uname(u) 0) { POSIX_G(last_error) = errno; RETURN_FALSE; } if (array_init(return_value) == FAILURE) { // TODO: Should we issue a warning here so we don't have ambiguity // with the above return value ? RETURN_FALSE; } add_assoc_string(return_value, sysname, u.sysname, 1); add_assoc_string(return_value, nodename, u.nodename, 1); add_assoc_string(return_value, release, u.release, 1); add_assoc_string(return_value, version, u.version, 1); add_assoc_string(return_value, machine, u.machine, 1); #ifdef _GNU_SOURCE #ifdef __USE_GNU add_assoc_string(return_value, domainname, u.domainname, 1); #else add_assoc_string(return_value, domainname, u.__domainname, 1); #endif #endif } /* }}} */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- Please always Cc to me when replying to me on the lists. GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [Fwd: posix_uname another bug @^|[@#\@^#~@{[?]
have you reveiv the pgsql.c optimization code ? (is nothing to fix le utsname ;)) another question : how to become a php developer ? - Original Message - From: Markus Fischer [EMAIL PROTECTED] To: Vergoz Michael (SYSDOOR) [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, March 24, 2002 12:51 PM Subject: Re: [PHP-DEV] [Fwd: posix_uname another bug @^|[@#\@^#~@{[?] Why do you think apache gets a segfault? sorry not segfault but compilation problem ;) The only thing is the the 'domainname' key is missing from the hash although it should display the content of __domainname (on non-bsd systems) I'm willing to fix it if someone comes up with a proper patch that also honors BSD. It's not very critical I think (until I miss the obvious). - Markus On Sun, Mar 24, 2002 at 12:16:41PM +0100, Vergoz Michael (SYSDOOR) wrote : Date: Sun, 24 Mar 2002 12:03:42 +0100 From: Vergoz Michael (SYSDOOR) [EMAIL PROTECTED] Subject: posix_uname another bug @^|[@#\@^#~@{[? User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020214 To: php-qa [EMAIL PROTECTED] From - Sun Mar 24 12:03:43 2002 X-Mozilla-Status2: refere include file : sys/utsname.h ! You can see if the macro __USE_GNU is set the char returned are 'domainname' else the char are '__domainname' #@\[@~\ You know this function can do a apache segfault ?! Becarful cuz domainename doesn't exist on freebsd ! there is the current (PHP-4.2.0RC1) code on : ext/posix/posix.c /* {{{ proto array posix_uname(void) Get system name (POSIX.1, 4.4.1) */ PHP_FUNCTION(posix_uname) { struct utsname u; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) return; if (uname(u) 0) { POSIX_G(last_error) = errno; RETURN_FALSE; } if (array_init(return_value) == FAILURE) { // TODO: Should we issue a warning here so we don't have ambiguity // with the above return value ? RETURN_FALSE; } add_assoc_string(return_value, sysname, u.sysname, 1); add_assoc_string(return_value, nodename, u.nodename, 1); add_assoc_string(return_value, release, u.release, 1); add_assoc_string(return_value, version, u.version, 1); add_assoc_string(return_value, machine, u.machine, 1); #ifdef _GNU_SOURCE/* i'm okay */ add_assoc_string(return_value, domainname, u.domainname, 1); /* - {|^@#\|^[#\ */ #endif } /* }}} */ /*Fixed code--*/ /* {{{ proto array posix_uname(void) Get system name (POSIX.1, 4.4.1) */ PHP_FUNCTION(posix_uname) { struct utsname u; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) return; if (uname(u) 0) { POSIX_G(last_error) = errno; RETURN_FALSE; } if (array_init(return_value) == FAILURE) { // TODO: Should we issue a warning here so we don't have ambiguity // with the above return value ? RETURN_FALSE; } add_assoc_string(return_value, sysname, u.sysname, 1); add_assoc_string(return_value, nodename, u.nodename, 1); add_assoc_string(return_value, release, u.release, 1); add_assoc_string(return_value, version, u.version, 1); add_assoc_string(return_value, machine, u.machine, 1); #ifdef _GNU_SOURCE #ifdef __USE_GNU add_assoc_string(return_value, domainname, u.domainname, 1); #else add_assoc_string(return_value, domainname, u.__domainname, 1); #endif #endif } /* }}} */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- Please always Cc to me when replying to me on the lists. GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [Fwd: posix_uname another bug @^|[@#\@^#~@{[?]
Vergoz Michael wrote: have you reveiv the pgsql.c optimization code ? (is nothing to fix le utsname ;)) No. I didn't get any patch. Could mail me. another question : how to become a php developer ? Submit sevral patches? then apply CVS account? -- Yasuo Ohgaki -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] ZLib (double free) bug
What about implementing in build process check for the version of the zlib library. If =1.1.3 to give error message that =1.1.4 is needed. 1.1.4 is at : ftp://ftp.info-zip.org/pub/infozip/zlib/zlib-1.1.4.tar.gz Best regards, Andrey Hristov -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ZLib (double free) bug
On 2002-03-12 10:50:43, Andrey Hristov wrote: What about implementing in build process check for the version of the zlib library. If =1.1.3 to give error message that =1.1.4 is needed. 1.1.4 is at : I already thought about that, but there are people or even whole linux distributions (e.g. Debian), who are patching their zlib libraries without using the whole 1.1.4, so their zlib version stays at 1.1.3, but without the bug. So we would to really test for this double free error, we can't rely on the zlib version, if we don't want to break php build for this platforms. But I think using this double free bug would be a little bit of overkill for a configure script ... Stefan -- Stefan Röhrich [EMAIL PROTECTED], [EMAIL PROTECTED] http://www.roehri.ch/~sr/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ZLib (double free) bug
Yeap. :(( the RH RPM is 1.1.3-25.7 ftp://updates.redhat.com/7.2/en/os/i386/zlib-1.1.3 -25.7.i386.rpm Andrey - Original Message - From: Stefan Roehrich [EMAIL PROTECTED] To: Andrey Hristov [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, March 12, 2002 11:46 AM Subject: Re: [PHP-DEV] ZLib (double free) bug On 2002-03-12 10:50:43, Andrey Hristov wrote: What about implementing in build process check for the version of the zlib library. If =1.1.3 to give error message that =1.1.4 is needed. 1.1.4 is at : I already thought about that, but there are people or even whole linux distributions (e.g. Debian), who are patching their zlib libraries without using the whole 1.1.4, so their zlib version stays at 1.1.3, but without the bug. So we would to really test for this double free error, we can't rely on the zlib version, if we don't want to break php build for this platforms. But I think using this double free bug would be a little bit of overkill for a configure script ... Stefan -- Stefan Röhrich [EMAIL PROTECTED], [EMAIL PROTECTED] http://www.roehri.ch/~sr/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: GetImageSize,read_exif_data,Bug #6787,#14994
today i woke up and i think the solution is to have read_exif_data a third parameter whether or not to return information if no exif is present And to support TIFFs with GetImageSize we only need a small addition of say less than 100 lines c code Good to hear you woke up Not waking up would have been bad That does sound like the best approach -Rasmus -- PHP Development Mailing List http://wwwphpnet/ To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP-DEV] ICONV patch for bug 14423
Hello, attached is a fixed diff, it works on Linux now (RH 7.1). Derick On Sun, 3 Mar 2002, Dan Kalowsky wrote: I need a review bug #14423 (http://bugs.php.net/bug.php?id=14423edit=1) I think I've figured out what is wrong, but unfortunately I cannot do a buildconf on the machine I'm on currently (libtool is limited to 1.3, not 1.4). So if someone can try this patch out and comment on any corrections for it, I'd appriciate it :) You'll find the patch attached to the email. While this bug is limited to the FreeBSD platform, this patch will effect the building on all machines (alters the config.m4). So if at least one other OS could test it out as well, I'd appriciate it. --- Dan Kalowsky Tonight I think I'll walk alone. http://www.deadmime.org/~dank I'll find soul as I go home. [EMAIL PROTECTED] - Temptation, New Order Derick Rethans - PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED] SRM: Site Resource Manager - www.vl-srm.net - ? iconv.diff Index: config.m4 === RCS file: /repository/php4/ext/iconv/config.m4,v retrieving revision 1.7 diff -u -r1.7 config.m4 --- config.m4 30 Nov 2001 18:59:38 - 1.7 +++ config.m4 3 Mar 2002 18:11:24 - @@ -7,15 +7,27 @@ if test $PHP_ICONV != no; then +dnl This is a fix for why FreeBSD does not work with ICONV +dnl It seems libtool checks for libiconv_open which only exists in +dnl the giconv series of files under FreeBSD + + ac_os_uname=`uname -s 2/dev/null` + + if test $ac_os_uname = FreeBSD; then + lib_name=giconv + else + lib_name=iconv + fi + for i in /usr /usr/local $PHP_ICONV; do -test -r $i/include/iconv.h ICONV_DIR=$i +test -r $i/include/${lib_name}.h ICONV_DIR=$i done if test -z $ICONV_DIR; then AC_MSG_ERROR(Please reinstall the iconv library.) fi - if test -f $ICONV_DIR/lib/libconv.a -o -f $ICONV_DIR/lib/libiconv.$SHLIB_SUFFIX_NAME ; then + if test -f $ICONV_DIR/lib/libconv.a -o -f +$ICONV_DIR/lib/lib${lib_name}.$SHLIB_SUFFIX_NAME ; then PHP_ADD_LIBRARY_WITH_PATH(iconv, $ICONV_DIR/lib, ICONV_SHARED_LIBADD) AC_CHECK_LIB(iconv, libiconv_open, [ AC_DEFINE(HAVE_ICONV, 1, [ ]) Index: php_iconv.h === RCS file: /repository/php4/ext/iconv/php_iconv.h,v retrieving revision 1.9 diff -u -r1.9 php_iconv.h --- php_iconv.h 13 Dec 2001 14:31:16 - 1.9 +++ php_iconv.h 3 Mar 2002 18:11:24 - @@ -26,8 +26,9 @@ #define PHP_ICONV_API #endif +#if HAVE_ICONV extern zend_module_entry iconv_module_entry; -#define phpext_iconv_ptr iconv_module_entry +#define iconv_module_ptr iconv_module_entry PHP_MINIT_FUNCTION(miconv); PHP_MSHUTDOWN_FUNCTION(miconv); @@ -53,6 +54,14 @@ #define ICONV_INPUT_ENCODING ISO-8859-1 #define ICONV_OUTPUT_ENCODING ISO-8859-1 #define ICONV_INTERNAL_ENCODING ISO-8859-1 + +#else + +#define iconv_module_ptr NULL + +#endif /* HAVE_ICONV */ + +#define phpext_iconv_ptr iconv_module_ptr #endif /* PHP_ICONV_H */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ICONV patch for bug 14423
Um yeah, this is the patch I ment to send initially :) If no comments/concerns are heard within 24 hours, you'll find this patch in the cvs. On Sun, 3 Mar 2002, Derick Rethans wrote: Hello, attached is a fixed diff, it works on Linux now (RH 7.1). Derick On Sun, 3 Mar 2002, Dan Kalowsky wrote: I need a review bug #14423 (http://bugs.php.net/bug.php?id=14423edit=1) I think I've figured out what is wrong, but unfortunately I cannot do a buildconf on the machine I'm on currently (libtool is limited to 1.3, not 1.4). So if someone can try this patch out and comment on any corrections for it, I'd appriciate it :) You'll find the patch attached to the email. While this bug is limited to the FreeBSD platform, this patch will effect the building on all machines (alters the config.m4). So if at least one other OS could test it out as well, I'd appriciate it. --- Dan KalowskyTonight I think I'll walk alone. http://www.deadmime.org/~dankI'll find soul as I go home. [EMAIL PROTECTED]- Temptation, New Order Derick Rethans - PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED] SRM: Site Resource Manager - www.vl-srm.net - --- Dan KalowskyTonight I think I'll walk alone. http://www.deadmime.org/~dankI'll find soul as I go home. [EMAIL PROTECTED]- Temptation, New Order -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] ICONV patch for bug 14423
I need a review bug #14423 (http://bugs.php.net/bug.php?id=14423edit=1) I think I've figured out what is wrong, but unfortunately I cannot do a buildconf on the machine I'm on currently (libtool is limited to 1.3, not 1.4). So if someone can try this patch out and comment on any corrections for it, I'd appriciate it :) You'll find the patch attached to the email. While this bug is limited to the FreeBSD platform, this patch will effect the building on all machines (alters the config.m4). So if at least one other OS could test it out as well, I'd appriciate it. --- Dan KalowskyTonight I think I'll walk alone. http://www.deadmime.org/~dankI'll find soul as I go home. [EMAIL PROTECTED]- Temptation, New Order ? diff.iconv Index: config.m4 === RCS file: /repository/php4/ext/iconv/config.m4,v retrieving revision 1.7 diff -u -r1.7 config.m4 --- config.m4 30 Nov 2001 18:59:38 - 1.7 +++ config.m4 3 Mar 2002 06:24:44 - @@ -7,15 +7,27 @@ if test $PHP_ICONV != no; then +dnl This is a fix for why FreeBSD does not work with ICONV +dnl It seems libtool checks for libiconv_open which only exists in +dnl the giconv series of files under FreeBSD + + ac_os_uname = `uname -s 2/dev/null` + + if test $ac_os_uname = FreeBSD; then + lib_name=giconv + else + lib_name=iconv + fi + for i in /usr /usr/local $PHP_ICONV; do -test -r $i/include/iconv.h ICONV_DIR=$i +test -r $i/include/${lib_name}.h ICONV_DIR=$i done if test -z $ICONV_DIR; then AC_MSG_ERROR(Please reinstall the iconv library.) fi - if test -f $ICONV_DIR/lib/libconv.a -o -f $ICONV_DIR/lib/libiconv.$SHLIB_SUFFIX_NAME ; then + if test -f $ICONV_DIR/lib/libconv.a -o -f +$ICONV_DIR/lib/lib${lib_name}.$SHLIB_SUFFIX_NAME ; then PHP_ADD_LIBRARY_WITH_PATH(iconv, $ICONV_DIR/lib, ICONV_SHARED_LIBADD) AC_CHECK_LIB(iconv, libiconv_open, [ AC_DEFINE(HAVE_ICONV, 1, [ ]) Index: php_iconv.h === RCS file: /repository/php4/ext/iconv/php_iconv.h,v retrieving revision 1.9 diff -u -r1.9 php_iconv.h --- php_iconv.h 13 Dec 2001 14:31:16 - 1.9 +++ php_iconv.h 3 Mar 2002 06:24:44 - @@ -26,8 +26,9 @@ #define PHP_ICONV_API #endif +#if HAVE_ICONV extern zend_module_entry iconv_module_entry; -#define phpext_iconv_ptr iconv_module_entry +#define iconv_module_ptr iconv_module_entry; PHP_MINIT_FUNCTION(miconv); PHP_MSHUTDOWN_FUNCTION(miconv); @@ -53,6 +54,14 @@ #define ICONV_INPUT_ENCODING ISO-8859-1 #define ICONV_OUTPUT_ENCODING ISO-8859-1 #define ICONV_INTERNAL_ENCODING ISO-8859-1 + +#else + +#define iconv_module_ptr NULL + +#endif /* HAVE_ICONV */ + +#define phpext_iconv_ptr iconv_module_entry #endif /* PHP_ICONV_H */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings,no error code.]
Markus Fischer wrote: I'm forwarding this to php-dev@ (so people doing filtering don't miss it ;) and let's see what opinion others have about this. - Markus Even if I bogusified(?) it, +1 for return FALSE and set error level to E_NOTICE :) -- Yasuo Ohgaki Subject: Bug #12465 Updated: posix_* issuing Warnings, no error code. From: [EMAIL PROTECTED] Date: 28 Feb 2002 22:48:58 - To: [EMAIL PROTECTED] ID: 12465 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Bogus +Status: Open Bug Type: POSIX related Operating System: Linux PHP Version: 4.0.6 New Comment: I agree with Herbert here. It's pretty worthless for the function to generate this verbose error messages during runtime. It's mimic is excatly what the C version does (function-wise). Does the C version do any output itself if it encounters an error (e.g. posix_getpwuid) ? No. Why? Because a NULL return value is a valid return value. It's not a php_error() nor a E_WARNING. Instead, the extension should be re-written to a) return false (the PHP-way), b) store the errno in a thread-global contect variable and c) provide a function to cleanly retrieve the exacty error message (currently, you would habe to catch $php_errmsg (or whatever it was) and parse it out. Short: re-opening ;) Previous Comments: [2002-02-28 14:48:28] [EMAIL PROTECTED] It?s still nonsense to write an error-message! stat() *IS STILL USED* for checking the existence of files. Why do I have to *suppress* error-messages?! PHP should not *generate* them in the first! *If* you choose to implement stat() and name it after the C-function, then stat() should behave as closely as possible like its C-equivalent. [2002-02-04 02:46:54] [EMAIL PROTECTED] It returns false. You need to get rid of error messages with @... [2001-07-30 09:24:17] [EMAIL PROTECTED] hi, I tried to use some of the posix_* functions to work with user-accounts on the system, like posix_getpwnam() and posix_getpwuid(). I expected to get an error-code back (like Failed or FALSE) for pwnames or pwuids which do not exist in /etc/passwd. Instead, PHP will write a warning message in my html-output: : Warning: posix_getpwuid(4711) failed with 'Success' in : /data/home/webmaster/admin/admin.php : on line 197 and, what I think is strange, will fail with ?Success?. Could you please modify the posix_getpw* functions in a way that they 1) do not write strange warning-messages and 2) return a NULL-Value or FALSE, where the unix getpw*(3) will return NULL (just like documented in the man-page) thanks in advance, herbert rosmanith [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings, no error code.]
On Fri, Mar 01, 2002 at 06:59:36PM +0900, Yasuo Ohgaki wrote : Markus Fischer wrote: I'm forwarding this to php-dev (so people doing filtering don't miss it ;) and let's see what opinion others have about this - Markus Even if I bogusified(?) it, +1 for return FALSE and set error level to E_NOTICE :) My point was to remove the (not needed) php_error() calls completely and save the message(errorcode) in a variable so the user (developer) can decide himself if he wants to do something with the message or not php_error() call's are, verbosely spoken, pain in the ass to catch ($php_errmsg global var?? no thanks) It would overal make more sense for this module to don't do any error output itself but provide a error string fetch function or so -- Please always Cc to me when replying to me on the lists GnuPG Key: http://gurujosefineat/~mfischer/C2272BD0asc -- PHP Development Mailing List http://wwwphpnet/ To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP-DEV] Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings,no error code.]
Markus Fischer wrote: On Fri, Mar 01, 2002 at 06:59:36PM +0900, Yasuo Ohgaki wrote : Markus Fischer wrote: I'm forwarding this to php-dev (so people doing filtering don't miss it ;) and let's see what opinion others have about this - Markus Even if I bogusified(?) it, +1 for return FALSE and set error level to E_NOTICE :) My point was to remove the (not needed) php_error() calls completely and save the message(errorcode) in a variable so the user (developer) can decide himself if he wants to do something with the message or not php_error() call's are, verbosely spoken, pain in the ass to catch ($php_errmsg global var?? no thanks) It would overal make more sense for this module to don't do any error output itself but provide a error string fetch function or so I don't mind removing error messages, too :) -- Yasuo Ohgaki -- PHP Development Mailing List http://wwwphpnet/ To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP-DEV] Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings, no error code.]
My point was to remove the (not needed) php_error() calls completely and save the message(errorcode) in a variable so the user (developer) can decide himself if he wants to do something with the message or not. php_error() call's are, verbosely spoken, pain in the ass to catch ($php_errmsg global var?? no thanks). It would overal make more sense for this module to don't do any error output itself but provide a error string fetch function or so. +1 Having posix_errno() which returns the error of the last message and posix_strerror() which returns the description should be the way to go. In addition it is consistent with the rest of posix functions. Edin -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Output Buffer - Bug #15613
A. Chorbadjiev wrote: Hi, without output buffering turned on, wheter invoked with a handler or explicit i'm getting garbage data and/or infinite reloading of the page. It was already reported and I think its still open (#14865). Everything is ok if the buffer size is 4096. It happens only on XP (in my case). Asen Chorbadjiev This is really strange, since PHP just output one by one when output buffer is not used. What is your SAPI? ISAPI? It sounds like SAPI problem rather than output buffering. -- Yasuo Ohgaki Yasuo Ohgaki [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Wez Furlong wrote: Hey, Can someone who knows the output buffer code take a look at this bug? I only got involved just in case it was an abvious mistake, but it doesn't look like it and I'm not yet an output buffer guru. It seems odd that it works OK under NT but not under XP, so perhaps it is an apache-under-XP problem? --Wez. Is the user using iconv? mbstring? I guess the user is not using them, but if the user is using them. The user must turn off conversion. -- Yasuo Ohgaki On 19/02/02, [EMAIL PROTECTED] wrote: ID: 15613 Updated by: [EMAIL PROTECTED] -Summary: readfile doesn't work correctly with WIndows XP Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Output Control Operating System: Windows XP (Professional) PHP Version: 4.1.1 New Comment: Yuk! Do you have output buffering enabled, and/or gzip compression? (Just to confirm). -- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Output Buffer - Bug #15613
Hi, php 4.1.1 + apache 1.3.22 + XP pro (don't ask why) SAPI from the standard binary distribution A good example for the problem is the phpinfo() call since it produces a relatively large page. The infinite reloading occurs only over HTTP 1.1, over HTTP 1.0 the page loads ok but the garbage data still occurs. The access log says the request(s) made over http1.1 (when the browser does a dozen reloads) is logged with status success (200). Regards, Assen Chorbadjiev Yasuo Ohgaki [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... A. Chorbadjiev wrote: Hi, without output buffering turned on, wheter invoked with a handler or explicit i'm getting garbage data and/or infinite reloading of the page. It was already reported and I think its still open (#14865). Everything is ok if the buffer size is 4096. It happens only on XP (in my case). Asen Chorbadjiev This is really strange, since PHP just output one by one when output buffer is not used. What is your SAPI? ISAPI? It sounds like SAPI problem rather than output buffering. -- Yasuo Ohgaki Yasuo Ohgaki [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Wez Furlong wrote: Hey, Can someone who knows the output buffer code take a look at this bug? I only got involved just in case it was an abvious mistake, but it doesn't look like it and I'm not yet an output buffer guru. It seems odd that it works OK under NT but not under XP, so perhaps it is an apache-under-XP problem? --Wez. Is the user using iconv? mbstring? I guess the user is not using them, but if the user is using them. The user must turn off conversion. -- Yasuo Ohgaki On 19/02/02, [EMAIL PROTECTED] wrote: ID: 15613 Updated by: [EMAIL PROTECTED] -Summary: readfile doesn't work correctly with WIndows XP Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Output Control Operating System: Windows XP (Professional) PHP Version: 4.1.1 New Comment: Yuk! Do you have output buffering enabled, and/or gzip compression? (Just to confirm). -- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Output Buffer - Bug #15613
Hi, without output buffering turned on, wheter invoked with a handler or explicit i'm getting garbage data and/or infinite reloading of the page. It was already reported and I think its still open (#14865). Everything is ok if the buffer size is 4096. It happens only on XP (in my case). Asen Chorbadjiev Yasuo Ohgaki [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Wez Furlong wrote: Hey, Can someone who knows the output buffer code take a look at this bug? I only got involved just in case it was an abvious mistake, but it doesn't look like it and I'm not yet an output buffer guru. It seems odd that it works OK under NT but not under XP, so perhaps it is an apache-under-XP problem? --Wez. Is the user using iconv? mbstring? I guess the user is not using them, but if the user is using them. The user must turn off conversion. -- Yasuo Ohgaki On 19/02/02, [EMAIL PROTECTED] wrote: ID: 15613 Updated by: [EMAIL PROTECTED] -Summary: readfile doesn't work correctly with WIndows XP Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Output Control Operating System: Windows XP (Professional) PHP Version: 4.1.1 New Comment: Yuk! Do you have output buffering enabled, and/or gzip compression? (Just to confirm). -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] socket_send() ...also a bug?
It's documented on http://www.php.net/manual/en/zend.arguments.retrieval.php It's a kind of promoting binary safety. Not the passed number of parameter passed to zend_parse_parameters() is important but what modifies are used to describe the parameters. Since a string is not only meant to be characters from A-Z but in fact can be anything including binary data, it's a good idea [tm] to always get the point to the string AND it's length and work with both when making further function calls (if possible). On Sat, Feb 16, 2002 at 03:08:06AM +0100, Richard Samar wrote : Sean R. Bright wrote: len is the length of the buffer. When 's' is specified in zend_parse_parameters, both the string and the number of characters are returned to the calling function. In this case, len is the length of 'buf_len.' :-) oki, the given prototype ist wrong then. could you post me an example. I dont understand 's'. thx best regards -moh -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- Please always Cc to me when replying to me on the lists. GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] socket_send() ...also a bug?
I found something else about socket_send(): proto: int socket_send(resource socket, string buf, int len, int flags) 4 parameters from the source: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rsll, arg1, buf, buf_len, len, flags) == FAILURE) 5 parameters? what is len?? please remove it. it doesnt makes sense to me. the system call send() doesnt have 5 parameters. best regards -moh -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] socket_send() ...also a bug?
Sean R. Bright wrote: len is the length of the buffer. When 's' is specified in zend_parse_parameters, both the string and the number of characters are returned to the calling function. In this case, len is the length of 'buf_len.' :-) oki, the given prototype ist wrong then. could you post me an example. I dont understand 's'. thx best regards -moh -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Bug #15449 Updated: Bug running PHP Mod@ Win XP
ID: 15449 Updated by: [EMAIL PROTECTED] -Reported By: [EMAIL PROTECTED] +Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Apache related Operating System: Windows XP PHP Version: 4.1.1 New Comment: well.. this bug has been reportet at least 10 times in this bug forum. Look around. Previous Comments: [2002-02-08 06:55:43] [EMAIL PROTECTED] We use compaq notebooks with XP Home Edition :oP (native conf)for demonstration of our web app. The config: Apache 1.3.22 PHP 4.1.0 - apache module When running a simple phpinfo(); one of two appear to happen: 1- a bogus dns error 2- page keep reloading not interpreting the code - some kind of buffer overflow(?) This can get realy weird if the code get's more complicated. I can't reproduce this in any other box (98,2000 Server or Professional, Linux) launching Apache in debug (-X) mode seems to handle the problem for now. Any hint? -- Edit this bug report at http://bugs.php.net/?id=15449edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Bug #15449 Updated: Bug running PHP Mod@ Win XP
ID: 15449 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Duplicate Bug Type: Apache related Operating System: Windows XP PHP Version: 4.1.1 New Comment: Dupe... (tnx reel_taz) Previous Comments: [2002-02-09 03:59:45] [EMAIL PROTECTED] well.. this bug has been reportet at least 10 times in this bug forum. Look around. [2002-02-08 06:55:43] [EMAIL PROTECTED] We use compaq notebooks with XP Home Edition :oP (native conf)for demonstration of our web app. The config: Apache 1.3.22 PHP 4.1.0 - apache module When running a simple phpinfo(); one of two appear to happen: 1- a bogus dns error 2- page keep reloading not interpreting the code - some kind of buffer overflow(?) This can get realy weird if the code get's more complicated. I can't reproduce this in any other box (98,2000 Server or Professional, Linux) launching Apache in debug (-X) mode seems to handle the problem for now. Any hint? -- Edit this bug report at http://bugs.php.net/?id=15449edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Bug #15449 Updated: Bug running PHP Mod@ Win XP
ID: 15449 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Apache related Operating System: Windows XP PHP Version: 4.1.1 -- Edit this bug report at http://bugs.php.net/?id=15449edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PHP-DOC] Bug #15354: errr
Hi, On 3 Feb 2002 14:11:35 - [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.1.1 PHP Bug Type: Documentation problem Bug description: errr libphp4.a doen't exist in src/modules/php4/libphp4.a but libmodphp4.a exist, we cannot compile apache 1.3.19... -- Edit bug report at: http://bugs.php.net/?id=15354edit=1 Fixed in CVS : http://bugs.php.net/fix.php?id=15354r= Fixed in release : http://bugs.php.net/fix.php?id=15354r= Need backtrace : http://bugs.php.net/fix.php?id=15354r= Try newer version : http://bugs.php.net/fix.php?id=15354r= Not developer issue: http://bugs.php.net/fix.php?id=15354r= Expected behavior : http://bugs.php.net/fix.php?id=15354r= Not enough info: http://bugs.php.net/fix.php?id=15354r= ^^ isn't there anything missing? ;) Jan -- Q: Thank Jan? A: http://geschenke.an.dasmoped.net/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: diff style bug update headers
Gabor Hojtsy wrote: Hi! I would like to propose a diff like bug update header style, so to use MUCH easier to read with diff -u style +1 -- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Bug #15234: basename bug
From: [EMAIL PROTECTED] Operating system: Linux Mandrake 8.0 PHP version: 4.1.1 PHP Bug Type: Filesystem function related Bug description: basename bug This code $a = /74.html; $url = $a; echo $url, BR; echo basename($url, .html), BR; echo $aBR$urlBR; corrupts $a and $url both. Compare it with: $a = /74.html; $url = $a; echo $url, BR; echo basename($url, .html), BR; echo $aBR$urlBR; -- Edit bug report at: http://bugs.php.net/?id=15234edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #15236: include() bug
From: [EMAIL PROTECTED] Operating system: win2000 PHP version: 4.1.1 PHP Bug Type: IIS related Bug description: include() bug Hi, when I try to include an external include file with the line ? include(http://myesys.com/useronline.php?comp_id=12;); ? under IIS PHP returns me: Warning: Failed opening 'http://66.34.147.253/useronline.php?comp_id=12' for inclusion (include_path='.;..') on my Linux/Apache host the same same line work fine, but the file is on the same server. my php.ini lines for that problem are: allow_url_fopen = on; include_path=.;..; We are suppose to be able to access external http or ftp file by enable allow_url_fopen = on; or may be we cannot? Jordi Thank for help -- Edit bug report at: http://bugs.php.net/?id=15236edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14334 Updated: Bug in COM class
ID: 14334 Comment by: [EMAIL PROTECTED] Old Reported By: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: COM related Operating System: Windows 2000 Professional PHP Version: 4.0.6 New Comment: I am having the same problem which is a bit stranger though. One time my call is correct while done in another place produces php_OLECHAR_to_char error message. Working: $pdflib = new COM(PDFlib_com.PDF); print $pdflib-get_parameter(version,0); Prints version string as expected. Not working: $pdflib = new COM(PDFlib_com.PDF); print $pdflib-set_parameter(fontwarning,1); print $pdflib-get_parameter(version,0); Produces error message for the get_parameter line and 0 (true !!! in php for PDFlib, -1 is false) for the fontwarning line. Also, to make it even stranger, at least to me: When I switch the line in the non-working example, I both get the version string and 0 for the fontwarning Is there something wrong about the way I connect to PDFLib ? HTH W. Previous Comments: [2001-12-06 22:09:09] [EMAIL PROTECTED] If you mean php code, here goes: - $instance = new COM(WinampCOM.Application); $title = $instance-CurrentSongTitle; - The $title line will produce the error if run via the httpd, but not if pasted in the stdin of php.exe. The WinampCOM.Application com requires a winamp module, which can be found at http://www.adcock8.freeserve.co.uk/gen_com.zip If any more info is needed, please don't hesitate to ask. [2001-12-06 15:07:09] [EMAIL PROTECTED] If you mean php code, here goes: - $instance = new COM(WinampCOM.Application); $title = $instance-CurrentSongTitle; - The $title line will produce the error if run via the httpd, but not if pasted in the stdin of php.exe. The WinampCOM.Application com requires a winamp module, which can be found at http://www.adcock8.freeserve.co.uk/gen_com.zip If any more info is needed, please don't hesitate to ask. [2001-12-06 12:13:41] [EMAIL PROTECTED] please provide the shortest possible code that produces this error. [2001-12-04 02:55:21] [EMAIL PROTECTED] Warning: Error in php_OLECHAR_to_char() in g:\apache\test\index.php on line 65. This error is only returned when the script is run from the httpd. IIS, Apache, and Xitami, all return this error. When I use the script via pasting it to stdin on php.exe, it runs perfectly. The script returns no errors from the stdin. Edit this bug report at http://bugs.php.net/?id=14334edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #15129: htmlentities() bug
From: [EMAIL PROTECTED] Operating system: Win98 PHP version: 4.1.1 PHP Bug Type: *General Issues Bug description: htmlentities() bug htmlentities(), when asked to convert quotes, instead of converting to quot;, it converts it to \quot;. It adds a \ character before quot;. IMHO, this should not happen. -- Edit bug report at: http://bugs.php.net/?id=15129edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #15083: Big bug with mssql_fetch_xxxx methods
From: [EMAIL PROTECTED] Operating system: Windows 2000 Pro PHP version: 4.1.1 PHP Bug Type: MSSQL related Bug description: Big bug with mssql_fetch_ methods On PHP 4.0.6 on Windows 2000 Pro I use the php_mssql.dll extension to access mssql server 7.0 and all the method works very well. (hum!! only the problem with ntext type but with CAST(yourfieldname AS text) on the SQL query, that disappears) After updating to PHP 4.1.1 on Windows 2000 Pro The same code crashes Apache and Windows displays a dialog box with : Apache.exe The instruction at 0x006db197 referenced memory at 0x043bcc3a. The memory could not be written. I have search for a long time in the SQL query but in reality the problem is not there... The problem depends of the type returned by the query. All the numerical types work fine but all the string types like char, nchar, text, ... result in crashes. This problem appears only when you try to read the result with mssql_fetch_ methods... My configuration : Windows 2000 Pro MSSQL SERVER 7.0 APACHE 1.3.20 PHP 4.1.1 (same problem with PHP 4.1.0) -- Edit bug report at: http://bugs.php.net/?id=15083edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12813 Updated: Bug id #11058 but on linux.
ID: 12813 Updated by: lobbin Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Network related Operating System: Linux PHP Version: 4.0.6 New Comment: Does this still apply on 4.1.1? Previous Comments: [2001-08-20 09:41:09] [EMAIL PROTECTED] It looks like the getaddrinfo function dont consider the /etc/hosts file so if a domain cant be converted to an ip using dns server then the error will show. if i try to do: include(on.my.etc.hosts.files/whatever) the error will show up if i do include(my.real.domain.on.the.internet) everything will work fine Frank Pazzooo Contrepois [2001-08-17 11:04:29] [EMAIL PROTECTED] System Linux bato 2.2.19 #1 Thu Jun 7 10:44:22 Local time zone must be set--see zic manuali686 i686 unknown Build Date Aug 17 2001 Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local/php' '--with-openssl=/usr/local/' '--with-pgsql' '--without-mysql' Server API Apache when I try to fopen or include an url i got 2 warning: Warning: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/www/motoko/htdocs/cwnd-xml/parser-site-xml.php on line 374 Warning: Failed opening 'http://www.motoko.lan/cwnd-xml/CORPO/cwnd-parser-materiale.php?url=cwnd-materiale.xml' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/www/motoko/htdocs/cwnd-xml/parser-site-xml.php on line 374 everything work fine with windows using fopen Frank Pazzooo Contrepois Edit this bug report at http://bugs.php.net/?id=12813edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #15029: mktime bug
From: [EMAIL PROTECTED] Operating system: Windows NT PHP version: 4.0.6 PHP Bug Type: *General Issues Bug description: mktime bug The underlying code produces a bug in the time calculation of mktime. The 28th October 2001 has got 25 hours!!! ? function string2date($dat) { $resu = substr($dat,6,4).substr($dat,3,2).substr($dat,0,2); return $resu; }; $date = 25.10.2001; $stDate4 = 30.10.2001; $day = substr($date,0,2); $month = substr($date,3,2); $year = substr($date,6,4); $current_date = mktime (0,0,0,$month,$day,$year); while ($date != $stDate4) { // add 1 day = 86400 seconds to the timestamp $current_date = $current_date + 86400; $date = date (d.m.Y,$current_date); $Date = string2date($date); /* // this overrides the bug if ($first_date == $Date) { $current_date = $current_date + 86400; $date = date (d.m.Y,$current_date); $Date = string2date($date); } */ echo $Datebr; } ? -- Edit bug report at: http://bugs.php.net/?id=15029edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14167 Updated: Bug with php_sybase.c and php_sybase.h
ID: 14167 Comment by: [EMAIL PROTECTED] Old Reported By: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Sybase-ct (ctlib) related Operating System: LINUX RED HAT 7.0 PHP Version: 4.0.6 New Comment: see comment in bug #13763 Previous Comments: [2001-11-21 16:39:29] [EMAIL PROTECTED] excuse, the is are php_sybase_ct.c and php_sybase_ct.h [2001-11-21 16:37:09] [EMAIL PROTECTED] PHP can't retreive two or more result set. This case is produce with sp_helptext MYPROC on sybase V 11.9 and with a proc which make a compute inside or when proc make two SELECT at the end. COMPUTE is return as a second result set. Arnaud. Edit this bug report at http://bugs.php.net/?id=14167edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #15005: Date bug with two and four digit year
From: [EMAIL PROTECTED] Operating system: Windows2000 PHP version: 4.1.1 PHP Bug Type: Date/time related Bug description: Date bug with two and four digit year I didn't see this bug posted, and I know that it worked fine in all my scripts in 2001. In 2002, it displays 2011 instead of 2002 for the year example :date(Y); or date(y) will return 2011 or 11 instead of 2002 or 02 I'm using Windows 2000 with service pack 2 PHP 4.1.1 win32 binaries un-modified downloaded direct from php.net on Microsoft's Personal Web Server that came with Windows98 SE. Loading on IE 5.5. Thanks --Cameron Sellum -- Edit bug report at: http://bugs.php.net/?id=15005edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14961 Updated: Bug while unsetting vars with type array
ID: 14961 Updated by: mfischer Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: Session related Operating System: linux PHP Version: 4.1.1 New Comment: Bogus unless you provide more inforamtion (See bugs do's and don'ts) Previous Comments: [2002-01-10 03:54:51] [EMAIL PROTECTED] Bug while unsetting vars with type array. This var is session var. Edit this bug report at http://bugs.php.net/?id=14961edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10686 Updated: Bug in mktime() on values out of bounds
ID: 10686 Updated by: derick Reported By: [EMAIL PROTECTED] Old Status: Assigned Status: Closed Bug Type: Date/time related Operating System: MacOS X 10.0.2 (Darwin) PHP Version: 4.0.5 Old Assigned To: kalowsky Assigned To: New Comment: This is reported fixed. Previous Comments: [2001-11-18 02:37:56] [EMAIL PROTECTED] From: Abner Diaz [EMAIL PROTECTED] I can verify the behavior of PHP Bug ID 10686 (http:// bugs.php.net/bug.php?id=10686), regarding mktime malfunctions in OS X 10.1/Darwin 1.4. The fixes to datetime.c posted by [EMAIL PROTECTED] worked well. Thanks! Sincerely, Abner Diaz [2001-10-23 09:03:49] [EMAIL PROTECTED] Does it looks well? (Same in MacOS X 10.1 and Darwin 1.4.1) [2001-08-18 21:30:34] [EMAIL PROTECTED] i have a MacOSX box now so I'll test this out and submit it if it looks good... [2001-06-11 14:28:32] [EMAIL PROTECTED] you can use Darwin/Intel (see: http://www.darwinfo.de), if Sorry. Informations about Darwin you can find on: - http://www.darwinfo.org/ - http://www.apple.com/darwin/ Dieter [2001-06-09 07:38:48] [EMAIL PROTECTED] Von: Trevis Tagawa [EMAIL PROTECTED] Datum: Sam, 09. Jun. 2001 01:12:46 Europe/Berlin An: [EMAIL PROTECTED] Betreff: Thanks! just wanted to extend a thanks to you for posting the fix. searched the net high and low but found your fix on the php site. aloha! trevis. - Trevis Tagawa Instructional Systems Analyst Kamehameha Schools 1887 Makuakane Street Honolulu, HI 96817 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/?id=10686 Edit this bug report at http://bugs.php.net/?id=10686edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14789 Updated: bug with Caudium 1.0.34
ID: 14789 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Old Summary: _SERVER[REQUEST_URI] not fully given to Caudium 1.0.34 Status: Bogus Bug Type: Other web server Old Operating System: FreeBSD / Linux Operating System: FreeBsd 4.1 / Linux 2.2.17 Old PHP Version: 4.1.1 PHP Version: 4.1.0 New Comment: It is now fixed in Caudium CVS. People that have problems with Caudium PHP should download the latest php4.pike. Previous Comments: [2002-01-01 18:22:44] [EMAIL PROTECTED] Note that it's probably the same bug than http://bugs.php.net/bug.php?id=10159 , though. [2002-01-01 10:36:39] [EMAIL PROTECTED] REQUEST_URI is an apache specific variable. no bug -bogus. [2002-01-01 09:56:13] [EMAIL PROTECTED] When using PHP 4 with Caudium, the $REQUEST_URI / _SERVER[REQUEST_URI] var is not full. For example, look at this phpinfo(): http://aleph1.net/test.php3/toto/a=bc=d You get the following line : _SERVER[REQUEST_URI] /test.php3 It should have been : _SERVER[REQUEST_URI] /test.php3/toto/a=bc=d Edit this bug report at http://bugs.php.net/?id=14789edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] [Php-Dev] One Bug Down..
i can reliably report that Bug #4769 can be expired (the author made the appropriate changes in the code itself). -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14767 Updated: Bug unsetting vars using $_SESSION
ID: 14767 Updated by: sander Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: Session related Operating System: Linux 2.4 PHP Version: 4.1.1 New Comment: session_unregister('test') should work. Alternatively, you can use unset($_SESSION['test']); Previous Comments: [2001-12-30 06:58:28] [EMAIL PROTECTED] In a project I work on I ran into something I would say is a bug.. When I call the page with ?debug=3 the session var 'test' gets the value howdy and gets stored (no need to call session_register('test'); (odd?)). After this there seem to be no way of unsetting/removing this session var.. At least non of the methods below works. Bug? unset in #2 (see below) removes the var, so it doesn't show up in the var_dump (#6), but upon calling the page again with ?debug=2 (only show sess-vars), it shows up again. At the same: $_GETand $_SERVER is displayed in phpinfo, but not $_SESSION. Another bug? In php.ini: register_globals = On Script: // #1 if ($debug==3) $_SESSION['test'] = howdy; // #2 if ($debug==4) unset($_SESSION['test']); // #3 if ($debug==5) unset($test); // #4 if ($debug==6) session_unregister($test); // #5 if ($debug==7) session_unregister($_SESSION['test']); // #6 if ($debug1) var_dump($_SESSION); Edit this bug report at http://bugs.php.net/?id=14767edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10159 Updated: bug with Caudium 1.0.2RC2
ID: 10159 Updated by: mfischer Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: Other web server Operating System: FreeBsd 4.1 PHP Version: 4.0.4pl1 New Comment: Until you come up with a concrete problem this is bogus. Previous Comments: [2001-04-04 10:53:45] [EMAIL PROTECTED] The php support Caudium (roxen) server (the pike module) seems to be very buggy !! For example , phpNuke website based or phpmyadmin interface should not work !! Simple php pages work as Well. There is certainly a problem with include files, ... Edit this bug report at http://bugs.php.net/?id=10159edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14753: a bug about Ora_pLogon
From: [EMAIL PROTECTED] Operating system: Win2000AdvServer PHP version: 4.1.1 PHP Bug Type: Unknown/Other Function Bug description: a bug about Ora_pLogon run at pl/sql developer: /++/ SQL select * from pt_smsojb_temp; PT_SMSOBJ_TEMP_ID PT_SMSOBJ_TYPE PT_SMSOBJ_ID PT_SMSOBJ_MOBI PT_SMSOBJ_USER_ID PT_SMSOBJ_NAME - -- -- - 27 u111390002 1 ³ÂÍ¥êÀ 28 u 113950362526 1 Ò¶½¨±ó 29 o 11390005 1 ´óÍ· 26 u101390001 1 ÁÖÓ¦¹ã 30 o 213959355539 1 Íõ´óÁØ 31 o 313959344539 1 ÍõСÁØ 32 o 41390006 1 À 33 o 51390007 1 Àî´ó»ª 34 o 61390037 1 ÀîС»ª 35 o 713900030037 1 Àî²»»ª 36 o 813933030037 1 ÀîÁÖ»ª 37 o 91390037 1 ÀîÁÖÁÖ 12 rows selected /++/ my php code /++/ html head titleÁбí/title meta http-equiv=Content-Type content=text/html; charset=gb2312 link rel=stylesheet href=../style.css type=text/css /head body bgcolor=#FF text=#00 leftmargin=0 topmargin=0 ? $connection=Ora_pLogon(ptsms@doone,ptsms123); $cursor=Ora_Open($connection); form name=sendmore method=post action=sendtoobj.php?action=more target=center_w ? $query=select * from pt_smsojb_temp; Ora_Parse($cursor,$query); Ora_Exec($cursor); while(Ora_fetch($cursor)) { ?input type=checkbox name=member[] value=?echo Ora_getcolumn($cursor,0);? checked?echo Ora_getcolumn($cursor,5);?[?echo Ora_getcolumn($cursor,3);?]br ? } ? /form /body /html /++/ It will display 12 records sometimes or 13 records sometimes when I refresh the web,but it should display 13 records. Why? I used the function Ora_commit when I insert a record to database in php. It's my code. ? $query=insert into pt_smsojb_temp (PT_SMSOBJ_TEMP_ID,PT_SMSOBJ_TYPE,PT_SMSOBJ_ID,PT_SMSOBJ_MOBI,PT_SMSOBJ_USER_ID,PT_SMSOBJ_NAME) values (pt_smsojb_temp_id.nextval,'u','$PT_SMSOBJ_ID','$PT_SMSOBJ_MOBI','$userid','$PT_SMSOBJ_NAME'); Ora_Parse($curor,$query); Ora_Exec($curor); Ora_commit; ? -- Edit bug report at: http://bugs.php.net/?id=14753edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14676 Updated: bug: strtotime incorrect GMT conversion from date('r')
ID: 14676 Updated by: derick Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Date/time related Operating System: win PHP Version: 4.1.0 New Comment: Already fixed, and this will be in the maintenance release 4.1.1, which is due in a few days. Derick Previous Comments: [2001-12-23 17:02:48] [EMAIL PROTECTED] Suppose your machine is GMT+1. When date('r') returns also GMT+1, strtotime() shows a bug. ? $stamp= Thu, 20 Dec 2001 09:49:52 +0100; $stamp= strtotime($stamp); echo $stamp = . date(r, $stamp); //Shows: 1008481792 = Sun, 16 Dec 2001 06:49:52 +0100 ? To give you an idea of the solution, I use the following code to get correct results: ? $stamp= 20 Dec 2001 09:49:52 +0100; // beg patch-line if( strpos($stamp, date('O')))$stamp= substr($stamp,0,-6); // end patch-line $stamp= strtotime($stamp); echo $stamp = . date(r, $stamp); //Shows: 1008838192 = Thu, 20 Dec 2001 09:49:52 +0100 ? There is no problem when GMT date('r') is different from GMT as returned by date('O') Regards, IRMaturana Edit this bug report at http://bugs.php.net/?id=14676edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] PHP 4.0.6 IMAP BUG
On Thu, Dec 20, 2001 at 10:32:43AM +0100, Markus Fischer wrote: Glad I didn't, its a bug in ext/imap. Due the pointer juggling we're accidantly calling fs_free() on something which was never explicetely malloced. I've a patch here which takes care of this but I'm not too familiar with imap code. Your patch looks sound enough, although I'm not very familiar with that code, either. I don't see any harm committing it to the HEAD branch. -- Jon Parise ([EMAIL PROTECTED]) . Information Technology (2001) http://www.csh.rit.edu/~jon/ : Computer Science House Member -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] PHP 4.0.6 IMAP BUG
Hi! If you try to run this lines: ? imap_mime_header_decode('[sisyphus] Re: ?KOI8-R?B?7s/X2cog0MHU3iDQxdLFy8/EydLP18vJIA==?==?KOI8-R?B?xMzR?= mc'); ? PHP will crash Rgds, Anton [EMAIL PROTECTED] http://www.altlinux.ru -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] PHP 4.0.6 IMAP BUG
Verified with latest CVS. No time do dig in right now, but note the crash occurs in the imap library: (gdb) bt #0 0x40113bee in free () from /lib/libc.so.6 #1 0x40113ac3 in free () from /lib/libc.so.6 #2 0x402b4063 in fs_give () from /usr/lib/libc-client.so.2001 #3 0x4028f699 in zif_imap_mime_header_decode () from /home/mfischer/php4/lib/php/extensions/debug-non-zts-20010901/imap.so #4 0x0813a1ba in execute (op_array=0x81bc244) at ./zend_execute.c:1598 #5 0x08113f69 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 #6 0x08061481 in php_execute_script (primary_file=0xb504) at main.c:1308 #7 0x0805eccf in main (argc=3, argv=0xb594) at cgi_main.c:753 #8 0x400be65f in __libc_start_main () from /lib/libc.so.6 - Markus On Wed, Dec 19, 2001 at 06:35:11PM +0300, Kachalov Anton wrote : If you try to run this lines: ? imap_mime_header_decode('[sisyphus] Re: ?KOI8-R?B?7s/X2cog0MHU3iDQxdLFy8/EydLP18vJIA==?==?KOI8-R?B?xMzR?= mc'); ? PHP will crash Rgds, Anton [EMAIL PROTECTED] http://www.altlinux.ru -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Please always Cc to me when replying to me on the lists. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] PHP 4.0.6 IMAP BUG
On Wed, Dec 19, 2001 at 05:35:53PM +0100, Markus Fischer wrote: Verified with latest CVS. No time do dig in right now, but note the crash occurs in the imap library: Please forward the test case and your backtrace to the c-client mailing list: http://www.washington.edu/imap/c-client-list.html -- Jon Parise ([EMAIL PROTECTED]) . Information Technology (2001) http://www.csh.rit.edu/~jon/ : Computer Science House Member -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14561: strtotime() bug
From: [EMAIL PROTECTED] Operating system: Linux ?.? PHP version: 4.0.6 PHP Bug Type: Date/time related Bug description: strtotime() bug strtotime(19:30 Dec 17); // works okay strtotime(Dec 17 19:30); // returns -1 that's a bug i think. strangely enough the bug wasn't there in Php 4.0.5.. only in 4.0.6 gtx Bucky -- Edit bug report at: http://bugs.php.net/?id=14561edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13375 Updated: bug with include() ?
ID: 13375 Updated by: yohgaki Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Scripting Engine problem Operating System: LINUX PHP Version: 4.0.5 New Comment: Cannot reproduce with 4.1.0. Do you still have problem with 4.1.0? Previous Comments: [2001-09-21 08:33:21] [EMAIL PROTECTED] hmmm.. didn't catch this in the include() notes or docs: PHP 4.0.5 doesn't seem to process an include() file correctly if the file has comments on the first line after the ? took me a while to try it without the comments but my function only worked when I did. the include file looked like this: ? //some comments on first line function null_zero_val($zero_val) { if ($zero_val == '0') { $zero_val = ''; return $zero_val; } else { return $zero_val; } } ? before I took the comments out all the code was returned in the web browser as text without line breaks and an error was generated saying call to undefined function Edit this bug report at http://bugs.php.net/?id=13375edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]