Search

Search this site:

PHP segfaults, incomplete laptops

Shit. I hate losing time due to someone else’s faults. Yesterday, a client of mine told me his Horde is not working. Ok, set myself in debug mode. What do I see? Nothing, just a stupid blank webpage. What does the Apache log say? Not much, nothing too informative, and what’s worse, nothing I expect from a PHP application: [Tue Feb 15 09:54:26 2005] [notice] child pid 2421 exit signal Segmentation fault (11) Over and over. I set in paranoid mode, as I had just upgraded the system. New Horde2 and Imp3 versions had just made it in Sarge, so there was no doubt: I was the culprit. Besides, being tired made everything worse - Two hours checking and rechecking that no files were different from the files I had on a working server. Today I gave it a shot again… Started stracing the Apache processes - I saw the segfault shortly after opening /usr/share/php/Log.php, but couldn’t explain it nor relate it to anything else: (...) open("/usr/share/php/Log.php", O_RDONLY) = 5 fstat64(5, {st_mode=S_IFREG|0644, st_size=8526, ...}) = 0 fstat64(5, {st_mode=S_IFREG|0644, st_size=8526, ...}) = 0 lseek(5, 0, SEEK_CUR) = 0 lseek(5, 0, SEEK_SET) = 0 close(5) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- Ok, I spent some extra time grokking this, until I checked in order what was being opened and in what order (BTW, that helps a lot understand program flow, specially while diving through frameworks such as Horde in languages you don’t really enjoy reading, such as PHP ;-) ). First thing I noticed: Silly me. I was looking for the error messages in the Apache log, while Horde sends them to its own log file… Just opening the Horde logfile made me understand the problem right away: Feb 16 10:43:56 HORDE [error] [imp] Error retrieving session data (id = faea99bff4f2b114cde7f26e81818f7f) [on line 119 of "/usr/share/horde2/lib/SessionHandler/mysql.php"] Well… The thing is, my client modified the Horde code (yes, the code, not the configuration) to fit another system he developed - and the session-related columns simply had a different name. Gah. Now, fixing this queries got Horde back running… But I am not sure what to think about it: If Horde cannot find the sessions, should it complain visibly at least? Why just letting it die? Even more: Why the hell does it segfault? I am not sure on whether to file a bug for this… But it does annoy me.


Yesterday I called a friend of mine to check if my laptop was finally fixed (I have been laptopless for about a month already)… He told me he finally had it at home, he helped me send it and follow through the repair process with a vendor he trusts (trusted?)… But he wanted me to go with the power supply and battery just to test it.
– But I gave them to you together with the machine!
– You did?! This guy says you didn’t!
– I did… Why would I keep it?
– To spare me carrying extra weight? Well… I do believe you, but… Well, I’ll have to check with that guy…
So… No power, no battery… Sounds like I am still laptopless. Have been working at home from my trusty, old and annoyingly too very slow laptop-server (P120, 48MB RAM, 800x600). I need my laptop soon. He said he’d drop by today – I hope he does with good news…

Categories