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.

Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)


In reply to debugging mod_perl? by Flame

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.