Compiling in Debugging Flags

12 views
Skip to first unread message

Chris Maness

unread,
May 2, 2008, 10:36:37 AM5/2/08
to FreeBSD List
How do I compile in debugging into apache using ports? There is no
configmenu when one begins to install/compile the port. I'm still having
trouble with apache crashing on a recently upgraded server. (after I have
rebuilt all of the ports). I was having the same problem with apache on a
sandbox server after upgrade to 7.0-RELEASE. I wasn't ever able to figure
it out. I have just upgraded apache on a production server, and I am not
able to cut over until apache working. I get no errors in log files no
errors on std out, and no core dump either. If I attache to GDB, I get no
messages either. Wierd.

Thanks,

Chris Maness
(909) 223-9179
http://www.chrismaness.com
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Bill Moran

unread,
May 2, 2008, 10:58:53 AM5/2/08
to Chris Maness, FreeBSD List
In response to Chris Maness <ch...@chrismaness.com>:

> How do I compile in debugging into apache using ports? There is no
> configmenu when one begins to install/compile the port. I'm still having
> trouble with apache crashing on a recently upgraded server. (after I have
> rebuilt all of the ports). I was having the same problem with apache on a
> sandbox server after upgrade to 7.0-RELEASE. I wasn't ever able to figure
> it out. I have just upgraded apache on a production server, and I am not
> able to cut over until apache working. I get no errors in log files no
> errors on std out, and no core dump either. If I attache to GDB, I get no
> messages either. Wierd.

First, put WITH_DEBUG=absolutely in /etc/make.conf. This will cause all
ports that are built to have debug symbols. I believe you need to save
the /usr/ports/*/[portname]/work directory after installing, so don't do
a make clean until you've archived that somewhere.

Then, ensure the sysctls in the kernel are all frobbed to allow coredumps.
Specifically:
kern.coredump: 1
kern.sugid_coredump: 1

Then, make sure the www user has write access to wherever it's trying to
dump to. Personally, I prefer to tweak kern.corefile to be
/usr/local/corefiles/%N.%P.core. I can then ensure that directory exists
and that all users have write access to it (probably not the best idea
on a production server, however)

>From there, you should be getting usable coredumps.

--
Bill Moran
http://www.potentialtech.com

Chris Maness

unread,
May 2, 2008, 11:51:36 AM5/2/08
to Bill Moran, FreeBSD List
> Then, ensure the sysctls in the kernel are all frobbed to allow coredumps.
> Specifically:
> kern.coredump: 1
> kern.sugid_coredump: 1
>

What is frobbed?

Chris

Bill Moran

unread,
May 2, 2008, 1:00:17 PM5/2/08
to Chris Maness, FreeBSD List
In response to Chris Maness <ch...@chrismaness.com>:

> > Then, ensure the sysctls in the kernel are all frobbed to allow coredumps.


> > Specifically:
> > kern.coredump: 1
> > kern.sugid_coredump: 1
>
> What is frobbed?

http://en.wikipedia.org/wiki/Frob

You need to learn important things like this if you're going to get
anywhere in this business ...

Chris Maness

unread,
May 2, 2008, 6:54:08 PM5/2/08
to Bill Moran, FreeBSD List
Bill Moran wrote:
> In response to Chris Maness <ch...@chrismaness.com>:
>
>
>>> Then, ensure the sysctls in the kernel are all frobbed to allow coredumps.
>>> Specifically:
>>> kern.coredump: 1
>>> kern.sugid_coredump: 1
>>>
>> What is frobbed?
>>
>
> http://en.wikipedia.org/wiki/Frob
>
> You need to learn important things like this if you're going to get
> anywhere in this business ...
>
>
sysctl -a | grep core
kern.corefile: %N.core
kern.nodump_coredump: 0
kern.coredump: 1
kern.sugid_coredump: 0
<6>pid 36665 (conftest), uid 0: exited on signal 11 (core dumped)
<6>pid 97013 (httpd), uid 0: exited on signal 11 (core dumped)
<6>pid 48143 (conftest), uid 0: exited on signal 12 (core dumped)
<6>pid 69261 (httpd), uid 0: exited on signal 11 (core dumped)
<6>pid 30477 (httpd), uid 0: exited on signal 11 (core dumped)
<6>pid 17468 (httpd), uid 0: exited on signal 11 (core dumped)
<6>pid 72511 (httpd), uid 0: exited on signal 11 (core dumped)
<6>pid 88618 (httpd), uid 0: exited on signal 11 (core dumped)
<6>pid 91921 (httpd), uid 0: exited on signal 11 (core dumped)
<6>pid 48962 (httpd), uid 0: exited on signal 11 (core dumped)
<6>pid 96510 (httpd), uid 0: exited on signal 11 (core dumped)
debug.elf32_legacy_coredump: 0

How do I change the the values? Also, where do the files go by default?

Chris Maness

unread,
May 2, 2008, 7:42:36 PM5/2/08
to Bill Moran, FreeBSD List
Never mind, I figured it out. Stay tuned, and I'll have some output.

Chris

Chris Maness

unread,
May 2, 2008, 7:53:58 PM5/2/08
to Bill Moran, FreeBSD List
Is it choking on:

/libexec/ld-elf.so.1

or

/libexec/ld-elf.so.1

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `httpd'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.4...done.
Loaded symbols for /lib/libcrypt.so.4
Reading symbols from /usr/local/lib/libexpat.so.6...done.
Loaded symbols for /usr/local/lib/libexpat.so.6
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/libexec/apache/mod_mmap_static.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_mmap_static.so
Reading symbols from /usr/local/libexec/apache/mod_vhost_alias.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_vhost_alias.so
Reading symbols from /usr/local/libexec/apache/mod_env.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_env.so
Reading symbols from /usr/local/libexec/apache/mod_log_config.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_log_config.so
Reading symbols from /usr/local/libexec/apache/mod_mime_magic.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_mime_magic.so
Reading symbols from /usr/local/libexec/apache/mod_mime.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_mime.so
Reading symbols from /usr/local/libexec/apache/mod_negotiation.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_negotiation.so
Reading symbols from /usr/local/libexec/apache/mod_status.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_status.so
Reading symbols from /usr/local/libexec/apache/mod_info.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_info.so
Reading symbols from /usr/local/libexec/apache/mod_include.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_include.so
Reading symbols from /usr/local/libexec/apache/mod_autoindex.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_autoindex.so
Reading symbols from /usr/local/libexec/apache/mod_dir.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_dir.so
Reading symbols from /usr/local/libexec/apache/mod_cgi.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_cgi.so
Reading symbols from /usr/local/libexec/apache/mod_asis.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_asis.so
Reading symbols from /usr/local/libexec/apache/mod_imap.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_imap.so
Reading symbols from /usr/local/libexec/apache/mod_actions.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_actions.so
Reading symbols from /usr/local/libexec/apache/mod_speling.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_speling.so
Reading symbols from /usr/local/libexec/apache/mod_userdir.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_userdir.so
Reading symbols from /usr/local/libexec/apache/mod_alias.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_alias.so
Reading symbols from /usr/local/libexec/apache/mod_rewrite.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_rewrite.so
Reading symbols from /usr/local/libexec/apache/mod_access.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_access.so
Reading symbols from /usr/local/libexec/apache/mod_auth.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_auth.so
Reading symbols from /usr/local/libexec/apache/mod_auth_anon.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_auth_anon.so
Reading symbols from /usr/local/libexec/apache/mod_auth_db.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_auth_db.so
Reading symbols from /usr/local/libexec/apache/mod_digest.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_digest.so
Reading symbols from /usr/local/libexec/apache/libproxy.so...done.
Loaded symbols for /usr/local/libexec/apache/libproxy.so
Reading symbols from /usr/local/libexec/apache/mod_cern_meta.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_cern_meta.so
Reading symbols from /usr/local/libexec/apache/mod_expires.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_expires.so
Reading symbols from /usr/local/libexec/apache/mod_headers.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_headers.so
Reading symbols from /usr/local/libexec/apache/mod_usertrack.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_usertrack.so
Reading symbols from /usr/local/libexec/apache/mod_log_forensic.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_log_forensic.so
Reading symbols from /usr/local/libexec/apache/mod_unique_id.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_unique_id.so
Reading symbols from /usr/local/libexec/apache/mod_setenvif.so...done.
Loaded symbols for /usr/local/libexec/apache/mod_setenvif.so
Reading symbols from /usr/local/libexec/apache/libphp5.so...done.
Loaded symbols for /usr/local/libexec/apache/libphp5.so
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libxml2.so.5...done.
Loaded symbols for /usr/local/lib/libxml2.so.5
Reading symbols from /lib/libz.so.4...done.
Loaded symbols for /lib/libz.so.4
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x28b00bd0 in ?? ()

Chris Maness

unread,
May 2, 2008, 9:08:06 PM5/2/08
to Bill Moran, FreeBSD List
Sorry about all of the e-mails. I remembered that I was having issues
with apache and the php5 module. I have deinstalled php5 and apache
runs fine. However, even with the latest ports tree with apache13 and
php5 module rebuilt, apache crashes. I had this same exact behavior on
a test box, but I don't see other complaints in the archives. Am I the
only one running apache13 with the php5 module installed? Also, this
works fine on my 6.3-RELEASE production server (however, it is not
upgraded to the latest version).

Thanks,
Chris Maness

Toomas Aas

unread,
May 4, 2008, 4:38:21 PM5/4/08
to Chris Maness, ques...@freebsd.org
L, 03 mai 2008 kirjutas Chris Maness <ch...@chrismaness.com>:

> Sorry about all of the e-mails. I remembered that I was having issues
> with apache and the php5 module. I have deinstalled php5 and apache
> runs fine. However, even with the latest ports tree with apache13 and
> php5 module rebuilt, apache crashes.

This might not be caused by mod_php5 as such, but by some PHP
extension(s). I have seen cases where even the order in which
extensions are loaded in /usr/local/etc/php/extensions.ini is
significant. Have them in one order and you get coredumps. Move one
extension from top to bottom - no more coredumps. This is one of the
great mysteries of the nature. Happy experimenting :)

--
Toomas Aas

Chris Maness

unread,
May 4, 2008, 6:01:18 PM5/4/08
to Toomas Aas, ques...@freebsd.org
Toomas Aas wrote:
> L, 03 mai 2008 kirjutas Chris Maness <ch...@chrismaness.com>:
>
>> Sorry about all of the e-mails. I remembered that I was having issues
>> with apache and the php5 module. I have deinstalled php5 and apache
>> runs fine. However, even with the latest ports tree with apache13 and
>> php5 module rebuilt, apache crashes.
>
> This might not be caused by mod_php5 as such, but by some PHP
> extension(s). I have seen cases where even the order in which
> extensions are loaded in /usr/local/etc/php/extensions.ini is
> significant. Have them in one order and you get coredumps. Move one
> extension from top to bottom - no more coredumps. This is one of the
> great mysteries of the nature. Happy experimenting :)
>
I tried that one too a while back. I rotated all of them from the
bottom to the top, and it did not cure the problem.

Tanks,
Chris Maness

Chris Maness

unread,
May 4, 2008, 6:54:38 PM5/4/08
to Patrick Clochesy, Toomas Aas, ques...@freebsd.org
Patrick Clochesy wrote:
> Standard diagnostic rules apply. What does a coredump say? GDB? Did
> you remove all modules and readd 1-by-1 to isolate the problem if the
> modules are your suspicion? What is the frequency of the crashes?
>
> -Patrick
I have posted all of the output. The whole thread can be found at:


http://groups.google.com/group/ml-freebsd-questions/browse_thread/thread/e39765ecef6c602d?hl=en


It crashes when I include php5 module.

Patrick Clochesy

unread,
May 4, 2008, 6:40:51 PM5/4/08
to Chris Maness, Toomas Aas, ques...@freebsd.org
Standard diagnostic rules apply. What does a coredump say? GDB? Did
you remove all modules and readd 1-by-1 to isolate the problem if the
modules are your suspicion? What is the frequency of the crashes?

-Patrick

Chris Maness

unread,
May 4, 2008, 7:12:55 PM5/4/08
to Patrick Clochesy, Andrey Chernov, Toomas Aas, ques...@freebsd.org
Chris Maness wrote:
> Patrick Clochesy wrote:
>> Standard diagnostic rules apply. What does a coredump say? GDB? Did
>> you remove all modules and readd 1-by-1 to isolate the problem if the
>> modules are your suspicion? What is the frequency of the crashes?
>>
>> -Patrick
> I have posted all of the output. The whole thread can be found at:
>
>
> http://groups.google.com/group/ml-freebsd-questions/browse_thread/thread/e39765ecef6c602d?hl=en
>
>
>
> It crashes when I include php5 module.
>
It seems to work fine in a clean install of RELEASE-7.0, so the issue
seems to be in the upgrading process. I will install a clean version of
RLEASE-6.3 get it running and upgrade it, so I provide an e-mail
detailing how to reproduce the problem. I have too much work in my 6.3
server to re configure it from scratch, so I am really counting on
finding the root of this problem so that I can upgrade my production
server. Thanks for all of the help.

Chris Maness

Chris Maness

unread,
May 4, 2008, 7:46:50 PM5/4/08
to Patrick Clochesy, Andrey Chernov, Toomas Aas, ques...@freebsd.org
Chris Maness wrote:
> Chris Maness wrote:
>> Patrick Clochesy wrote:
>>> Standard diagnostic rules apply. What does a coredump say? GDB? Did
>>> you remove all modules and readd 1-by-1 to isolate the problem if
>>> the modules are your suspicion? What is the frequency of the crashes?
>>>
>>> -Patrick
>> I have posted all of the output. The whole thread can be found at:
>>
>>
>> http://groups.google.com/group/ml-freebsd-questions/browse_thread/thread/e39765ecef6c602d?hl=en
>>
>>
>>
>> It crashes when I include php5 module.
>>
> It seems to work fine in a clean install of RELEASE-7.0, so the issue
> seems to be in the upgrading process. I will install a clean version
> of RLEASE-6.3 get it running and upgrade it, so I provide an e-mail
> detailing how to reproduce the problem. I have too much work in my
> 6.3 server to re configure it from scratch, so I am really counting on
> finding the root of this problem so that I can upgrade my production
> server. Thanks for all of the help.
>
> Chris Maness
>
Sorry, guys. I spoke too soon. It is crashing on the fresh install as
well. I just rebooted, and the same situation occurs, httpd core dumps
instantly. (with php5 module installed) The only other thing I did
begin installing squirrel mail. I have a virtual installation that I
will try it on too. This is the third instance of apache13 port
crashing with the php5 built with the module. I did nothing to
httpd.conf except add a virtual host. I checked this with apachectl
checkconfig and it was fine. After it started crashing, I removed the
vhost and it was still crashing.

Thanks,

Chris Maness

unread,
May 4, 2008, 10:55:42 PM5/4/08
to Toomas Aas, ques...@freebsd.org
Toomas Aas wrote:
> L, 03 mai 2008 kirjutas Chris Maness <ch...@chrismaness.com>:
>
>> Sorry about all of the e-mails. I remembered that I was having issues
>> with apache and the php5 module. I have deinstalled php5 and apache
>> runs fine. However, even with the latest ports tree with apache13 and
>> php5 module rebuilt, apache crashes.
>
> This might not be caused by mod_php5 as such, but by some PHP
> extension(s). I have seen cases where even the order in which
> extensions are loaded in /usr/local/etc/php/extensions.ini is
> significant. Have them in one order and you get coredumps. Move one
> extension from top to bottom - no more coredumps. This is one of the
> great mysteries of the nature. Happy experimenting :)
>
It is a problem with php extension "extension=mhash.so." If I remove it
from extensions.ini it works. However, there does not seem to be order
of arrangement that restores sanity. I believe I need mhash for
squirrelmail.

Any further suggestions would be appreciated.

Thanks,
Chris Maness

Norberto Meijome

unread,
May 5, 2008, 5:51:05 AM5/5/08
to ques...@freebsd.org
On Sun, 04 May 2008 19:55:42 -0700
Chris Maness <ch...@chrismaness.com> wrote:

> It is a problem with php extension "extension=mhash.so." If I remove it
> from extensions.ini it works. However, there does not seem to be order
> of arrangement that restores sanity. I believe I need mhash for
> squirrelmail.
>
> Any further suggestions would be appreciated.

I am risking stating the obvious here, but you HAVE rebuilt everything related
to mhash (including security/mhash), right?

I have just installed security/php5-mhash from scratch and it loads without any
issue... of course, i only have php5 and php5-mhash installed here, no other php
extensions...

FreeBSD ayiin.xxxx 7.0-STABLE FreeBSD 7.0-STABLE #46: Wed Apr 30 10:55:55 EST
2008 ro...@ayiin.xxx:/usr/obj/usr/src/sys/AYIIN i386

B
_________________________
{Beto|Norberto|Numard} Meijome

"The greatest dangers to liberty lurk in insidious encroachment by men of zeal,
well-meaning but without understanding." Justice Louis D. Brandeis

I speak for myself, not my employer. Contents may be hot. Slippery when wet.
Reading disclaimers makes you go blind. Writing them is worse. You have been
Warned.

Reply all
Reply to author
Forward
0 new messages