Flame has asked for the wisdom of the Perl Monks concerning the following question:
Greetings fellow Monks,
I have been working for quite some time on a school project that runs off of mod_perl and uses a MySQL database, however now I am faced with a... irritating problem. It appears that I have recently introduced a bug that causes the eventual lockup of the Apache threads that try to run it. I base this uppon the following excerpt from the error logs:
DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. DBD::mysql::st execute failed: Can't connect to local MySQL server thr +ough socket '/var/lib/mysql/mysql.sock' (111) at /usr/local/lib/perl5 +/site_perl/5.8.0/Apache/Session/Store/DBI.pm line 86. [Fri May 16 21:57:42 2003] [notice] child pid 1313 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1312 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1311 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1310 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1307 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1267 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1266 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1264 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1256 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1255 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 1254 exit signal Segment +ation fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 959 exit signal Segmenta +tion fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 796 exit signal Segmenta +tion fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 784 exit signal Segmenta +tion fault (11) [Fri May 16 21:57:42 2003] [notice] child pid 764 exit signal Segmenta +tion fault (11) SV = RV(0x8370c70) at 0x8994f60 REFCNT = 1 FLAGS = (PADBUSY,PADMY) [Fri May 16 21:57:46 2003] [warn] child process 763 still did not exit +, sending a SIGTERM [Fri May 16 21:57:46 2003] [warn] child process 797 still did not exit +, sending a SIGTERM [Fri May 16 21:57:46 2003] [warn] child process 1305 still did not exi +t, sending a SIGTERM [Fri May 16 21:57:46 2003] [warn] child process 1306 still did not exi +t, sending a SIGTERM [Fri May 16 21:57:46 2003] [warn] child process 1342 still did not exi +t, sending a SIGTERM [Fri May 16 21:57:46 2003] [warn] child process 1343 still did not exi +t, sending a SIGTERM [Fri May 16 21:57:46 2003] [warn] child process 1344 still did not exi +t, sending a SIGTERM [Fri May 16 21:59:08 2003] [warn] pid file /usr/local/apache/logs/http +d.pid overwritten -- Unclean shutdown of previous Apache run?
These errors lead me to look at the MySQL database, which I had been using Apache::DBI and DBI upon and I had recently stated using LOCK TABLES ....... upon. In an effort to discover the cause, I removed those lock calls and I later removed Apache::DBI, both with no useful results. The errors above caused me to wonder if one of several things had happened... since Apache was shut down as part of the standard shutdown sequence on the computer (Linux), it is possible that the database was shut down before apache and that the shutdown signals sortof "woke up" the frozen threads and caused them to try to finish what they had started, thus the inability to connect to mysql messages, but beyond that I couldn't come up with anything.
Now while I'd normally use debug mode or Devel::Ptkdb to trace a problem like this, since this was designed around mod_perl, I'm not sure how to simulate the mod_perl environment so that I can actually test it. Is there some method of simulating it for this purpose, or is there some other method of debugging I should try?
Thank you for taking the time to read this, it's rather poorly worded I realize. If anyone wishes to view the source code for my project, just ask and I'll post it to my scratchpad... if it will fit. (Too large to put here practically anyway... 90kb would be rather inconvenient)
My code doesn't have bugs, it just develops random features.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(UPDATE) debugging mod_perl?
by Flame (Deacon) on May 18, 2003 at 03:04 UTC | |
by perrin (Chancellor) on May 19, 2003 at 04:27 UTC | |
|
Re: debugging mod_perl?
by perrin (Chancellor) on May 19, 2003 at 04:31 UTC | |
by Flame (Deacon) on May 19, 2003 at 04:44 UTC | |
by perrin (Chancellor) on May 19, 2003 at 04:48 UTC | |
by Flame (Deacon) on May 19, 2003 at 04:57 UTC | |
by perrin (Chancellor) on May 19, 2003 at 05:16 UTC | |
|