Folks,
        I'm trying to trace down a TCP_NODELAY problem and wanted to see if it 
exists on the latest connector mod_jk2. So I configured Apache 2.0.42, 
Tomcat 4.1.12 and downloaded jakarta-tomcat-connectors-4.1.12-src. I 
managed to use GNU's libtoolize to configure (./configure 
--with-apxs2=/usr/local/apache2/bin/apxs 
--with-apr-lib=/usr/local/apache2/lib 
--with-apr-include=/usr/local/apache2/include 
--with-tomcat1=/usr/local/jakarta-tomcat-4.1.12).

        The compilation was successful and I copied mod_jk2.so to 
/usr/local/apache2/modules. I configured httpd.conf to load the module 
and appended the following:

<IfModule mod_jk2.c>
JkSet "config.file" "/usr/local/apache2/conf/workers2.properties"
</IfModule>

        I added a super simple workers2.properties file in the same dir and 
tried to start apache. I got a seg fault. Here's the stacktrace from 
Mac OS X default crash logger:

Command:    httpd
PID:        853

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x736f0028

Thread 0 Crashed:
  #0   0x90001600 in strlen
  #1   0x900023e0 in vfprintf
  #2   0x90015ee0 in __sbprintf
  #3   0x900018a8 in vfprintf
  #4   0x900017ec in fprintf
  #5   0x0060fdbc in jk2_map_default_get (jk_map.c:97)  <-- it's '97' 
because I added printf
  #6   0x0060df50 in jk2_env_createBean2 (jk_env.c:218)
  #7   0x0061ee0c in jk2_create_config (mod_jk2.c:351)
  #8   0x0002214c in ap_single_module_configure (config.c:1845)
  #9   0x00007ad8 in load_module (mod_so.c:337)
  #10  0x00020308 in invoke_cmd (config.c:749)
  #11  0x000213d0 in execute_now (config.c:1347)
  #12  0x00020a40 in ap_build_config_sub (config.c:944)
  #13  0x00020f68 in ap_build_config (config.c:1151)
  #14  0x000218f0 in ap_process_resource_config (config.c:1556)
  #15  0x000220e8 in ap_read_config (config.c:1834)
  #16  0x0000c184 in main (main.c:615)
  #17  0x00001ae0 in _start (crt.c:267)
  #18  0x00001960 in start


Here's output with some printf statements inserted in jk_map.c:
entering for threadMutex  (no. maps: 25)
         0:  logger.file (°Z°Z°Z°Z°Z°Z) <- funny output is from 
fprintf(stderr,"%s", mPriv->values[i])
         1:  logger.win32 (°Z°Z°Z°Z°Z)
         2:  workerEnv (°Z°ZA°Z°Z)
         3:  uriMap (°Z°Za°Z°Z)
         4:  uriEnv (°Z°ZA°Z°Z)
         5:  endpoint (°Z°ZA°Z°Z)
         6:  uri (°Z°ZA°Z°Z)
         7:  config (°Z°Z°Z°Z°Z°Z)
         8:  ajp13 (°Z°ZA°Z°Z)
         9:  lb (,)
         10:  status (°Z°Z°Z°Z°Z)
         11:  run (,)
         12:  channel.un (°Z°ZA°Z°Z)
         13:  channel.apr (°Z°ZA°Z°Z)
         14:  shm (°Z°Z°Z°Z°Z°Z)
         15:  channel.socket (°Z°ZA°Z°Z)
         16:  handler.response (°Z°Z°Z°Z°Z°Z)
         17:  handler.logon (°Z°Z°Z°Z°Z°Z)
         18:  threadMutex (°Z°Z°Z°Z°Z°Z)
done for threadMutex
entering for logger.apache2:  (no. maps: 1)
         0:  threadMutex:0 ()
done for logger.apache2:
...
...
entering for uri:/examples/*  (no. maps: 19)
         0:  threadMutex:0 ()
         1:  logger.apache2: ()
         2:  logger.apache2 ()
         3:  logger ()
         4:  uriMap: ()
         5:  uriMap ()
         6:  config: ()
         7:  config ()
         8:  shm: ()
         9:  shm ()
         10:  workerEnv: ()
         11:  workerEnv ()
         12:  uri: ()
         13:  uri ()
         14:  threadMutex:1 ()
         15:  threadMutex:2 ()
         16:  threadMutex:3 ()
         17:  ajp13:localhost:8009 ()
         18:  channel.socket:localhost:8009 ()
done for uri:/examples/*
entering for uri  (no. maps: 26)
         0:  logger.file (°Z°Z°Z°Z°Z°Z)
         1:  logger.win32 (°Z°Z°Z°Z°Z)
         2:  workerEnv (°Z°ZA°Z°Z)
         3:  uriMap (°Z°Za°Z°Z)
         4:  uriEnv (°Z°ZA°Z°Z)
         5:  endpoint (°Z°ZA°Z°Z)
         6:  uri (°Z°ZA°Z°Z)
done for uri
entering for workerEnv  (no. maps: 19)
         0:  threadMutex:0 ()
         1:  logger.apache2: ()
         2:  logger.apache2 ()
         3:  logger ()
         4:  uriMap: ()
         5:  uriMap ()
         6:  config: ()
         7:  config ()
         8:  shm: ()
         9:  shm ()
         10:  workerEnv: ()
         11:  workerEnv ()
done for workerEnv
entering for ver  (no. maps: 1)
         0:  worker (ajp13:localhost:8009)
done for ver
[here it churns for a few seconds before segfaulting]
bin/apachectl: line 87:   853 Segmentation fault      $HTTPD -k $ARGV

        Anyone has a clue on what could be wrong? Just pointers would help. I 
tried following the stack trace but am temporarily thrown off by how 
jk2_env_createBean2() gets to jk2_map_default_get(), especially the 
second parameter's type. It seems to be casted from (char *) to 
(jk_map_t *), which is kind of weird.

        Appreciate it.

Han Ming


#------------------------ workers2.properties 
--------------------------------

# Shared memory handling. Needs to be set.
[shm]
file=/usr/local/apache2/logs/shm.file
size=1048576

# Example socket channel, explicitly set port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
#keepalive=1

# define the worker
[ajp13:localhost:8009]
#        channel=channel.un:/usr/local/tomcat/work/jk2.socket
# To use the TCP/IP socket instead, just comment out the above
# line, and uncomment the one below
channel=channel.socket:localhost:8009

# Announce a "status" worker
[status:status]

# Uri mapping
[uri:/examples/*]
worker=ajp13:localhost:8009
#worker=ajp13:/usr/local/tomcat/work/jk2.socket

[uri:/jkstatus/*]
worker=status:status

#---- end of workers2.properties
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to