I get the same exact result with the prefork MPM, the 'worker' MPM crashes
like so:

[New Thread 27676 (LWP 20127)]
Delayed SIGSTOP caught for LWP 20127.
LWP 20101 exited.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 3076 (LWP 20103)]
top_check () at malloc.c:4607
4607    malloc.c: No such file or directory.
        in malloc.c
(gdb)

The backtrace..

#0  top_check () at malloc.c:4607
#1  0x40261d25 in malloc_check (sz=11, caller=0x4033937e) at malloc.c:4645
#2  0x4025f06d in __libc_malloc (bytes=11) at malloc.c:2798
#3  0x4033937e in my_malloc (Size=11, MyFlags=16) at my_malloc.c:36
#4  0x4033958f in my_strdup (from=0x403278c0 "WebSession", MyFlags=16)
    at my_malloc.c:81
#5  0x40336a23 in mysql_options (mysql=0x40313a08,
    option=MYSQL_READ_DEFAULT_GROUP, arg=0x403278c0 "WebSession")
    at libmysql.c:2283
#6  0x403210a3 in TMySQLSet::Configure (this=0x81a42f8)
    at classtemplate/TMySQLSet.tmpl:26

Keep in mind this is happening in the C++ constructor, nothing else gets
free'd or malloc'd before this class is created.

Just for the hell of it, let's try the threaded MPM and I'll try to sort
through its bugs to show mine.

Nevermind, it crashes before I have a chance.

[New Thread 30751 (LWP 28203)]
Delayed SIGSTOP caught for LWP 28203.
[New Thread 31776 (LWP 28204)]
Delayed SIGSTOP caught for LWP 28204.
Cannot find thread 33: invalid thread handle
(gdb)

Woot. Here's the backtrace for whoever's working on the threaded mpm..
dosen't look very useful though.

(gdb) bt
#0  0x401d6a21 in __linuxthreads_create_event () at events.c:26
#1  0x401d1110 in pthread_handle_create (thread=0x4064ac50,
attr=0x4064a9ac,
    start_routine=0x4003e904 <dummy_worker>, arg=0x811d554,
mask=0x819dc68,
    father_pid=28174, report_events=1, event_maskp=0x4064adac) at
manager.c:657
#2  0x401d09f5 in __pthread_manager (arg=0xe) at manager.c:167
#3  0x401d1509 in __pthread_manager_event (arg=0xe) at manager.c:231
(gdb)

In the 4-5 years I've been working with C/C++, I've never dealt with
anything this hosed. BTW - its dying when apache trys to find the handler
declared with 'SetHandler', since the first thing my module does is:

TWebSession WebSession = new TWebSession();
(which in turn has a bunch of other classes that it starts, including
TMySQLSet..)

I've also gotten the exact same results using threaded and non-threaded
mysql client libraries. Ugh.

Mabye I'm barking up the wrong tree?

My code (not MySQL's) uses malloc() and free() all over, it wasn't untill
I started filling in the blanks for the MySQL interfaces that this became
a problem. Any of the mysql code that uses malloc() is causing problems,
mysql_options(), mysql_connect(), etc. The only thing that I could
possibly think makes this apache's problem is the DSO interface and having
DSO's linked to external libraries. Problem is, 'WebSession' just loads a
shared object with dlopen() and runs a specified function from it
(passing the C++ class as a variable), and it does that fine w/o mysql.
It's purpose is to act as middleware between mysql, apache, and the
modules it houses. A simplified interface.

Also, I wanted to note that this is not a problem in apache 1.3, just 2.0.
The module I'm writing isin't expected to be in production for months, so
I figured writing for 2.0 now would make sense, versus having to rewrite
it again when 2.0 came out.

Oh well, back to pulling my hair out.

Justin

On Wed, 31 Oct 2001, Aaron Bannert wrote:

> On Wed, Oct 31, 2001 at 02:02:01PM -0600, Justin C. Darby wrote:
> > Configure line: ./configure --enable-ssl --enable-so --with-mpm=prefork
> > --enable-maintainer-mode
>
> Try this:
>
> CFLAGS="-Wall -g" CPPFLAGS="-Wall -g" ./configure --yourflags
>
> > --with-mpm=prefork because threaded seems to be a mess at the moment,
>
> <gratuitous plug>
> Have you tried the worker MPM? :)
> </gratuitous plug>
>
>
> Would you mind reposting the trace with the above CFLAGS/CPPFLAGS changes?
> (the full output is probably unnecessary)
>
> -aaron
>

Reply via email to