ID: 31433 User updated by: dgrimes at scvl dot com Reported By: dgrimes at scvl dot com -Status: Feedback +Status: Open Bug Type: Reproducible crash Operating System: SCO OpenServer 5 PHP Version: 4CVS, 5CVS (2005-01-22) New Comment:
SCO sent this to me: Dean, Please have a look at this TA and let me know if you think this will help your situation. It appears that this is applicable to OSr5.0.0 to 5.0.6. Thanks, Todd *********************** TA # 100815 ********************************** Calling realpath(S) from within my program causes a core dump. KEYWORDS: v5 5.0.0 osr5 openserver dev sys development system ds getcwd realpath memory fault coredump core dump ENGREF LTD-246-807 RELEASE: SCO OpenServer Development System Release 5.0.0 PROBLEM: If I make a call to realpath(S) from within my source I find that, when compiled, the resulting binary will terminate with the error: Memory fault(coredump) CAUSE: The character buffer passed to realpath(S) is being passed to a function called pathcanon(). This function is calling getcwd(S) with a buffer size of 4096 bytes. getcwd(S) clears this buffer and overruns the stack causing the core dump. SOLUTION: This problem has been reported to SCO Engineering. To work around this problem, make sure that the character buffer passed to realpath(S) is 4096 bytes in size: char buff[4096]; realpath(filename, buff); where 'filename' is the name of the file whose path you wish to resolve. -------------------------------------- Thanks, Dean Previous Comments: ------------------------------------------------------------------------ [2005-01-26 06:18:49] [EMAIL PROTECTED] See also bug #23665 ------------------------------------------------------------------------ [2005-01-26 06:14:08] [EMAIL PROTECTED] You could ask SCO support why the realpath() function is called from libsocket.so.2 and not from libc.so.1.. ------------------------------------------------------------------------ [2005-01-26 05:49:06] [EMAIL PROTECTED] Can you provide the above backtrace but using the snapshot? ------------------------------------------------------------------------ [2005-01-24 22:59:30] dgrimes at scvl dot com That version compiled just fine but I still have the original problem. PHP 4.0.6 compiles and doesn't have this issue. It's the version were using now. I can open an issue with SCO if you think it's a bad libc. Can you give me more information that supports that conclusion? Dean ------------------------------------------------------------------------ [2005-01-22 21:34:09] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip The compile failure should at least be fixed now. ------------------------------------------------------------------------ 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/31433 -- Edit this bug report at http://bugs.php.net/?id=31433&edit=1