From: mfrench at applied-handling dot com Operating system: Linux 2.2.20 Kernel (Debian) PHP version: 5.0.1 PHP Bug Type: Reproducible crash Bug description: String concat causes segmentation fault
Description: ------------ I have a file that is building up a DB query as a string. The query is long enough that for reasons of readability, I am attempting to split it onto two lines, and concatenate the two parts of the string together into a single variable. Performing this string concatenation causes a segmentation fault. Putting both halves of the string on a single line and assigning it to the variable all at once avoids the error. Reproduce code: --------------- //This causes a segmentation fault: $qry = "SELECT h.*, oe.LevelDepth, oe.LevelName AS oeName, oe.OrgChartID"; $qry .= " FROM tblHierarchy h JOIN tblOrgElement oe ON h.OrgElementID=oe.OrgElementID WHERE levelID=2"; echo $qry; //This runs without error: $qry = "SELECT h.*, oe.LevelDepth, oe.LevelName AS oeName, oe.OrgChartID FROM tblHierarchy h JOIN tblOrgElement oe ON h.OrgElementID=oe.OrgElementID WHERE levelID=2"; echo $qry; Expected result: ---------------- I expect to see the full string output to the page. Actual result: -------------- Apache does not serve the page, and my browser reports "Cannot find server". The server logs show a segmentation fault. The code is trying to build up a DB query. However, the segmentation fault occurs on the second line building up the string. Commenting out the entire rest of the file, and only ECHOing the string to the page still generates the seg fault, where the entire file runs without error when the string is built all on one line with no concatenation. -- Edit bug report at http://bugs.php.net/?id=30367&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30367&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30367&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30367&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30367&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30367&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30367&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30367&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30367&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30367&r=support Expected behavior: http://bugs.php.net/fix.php?id=30367&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30367&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30367&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30367&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30367&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30367&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30367&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30367&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30367&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30367&r=mysqlcfg
