Summary: | mod_jk segmentation fault at jk_shm.c:875 | ||
---|---|---|---|
Product: | Tomcat Connectors | Reporter: | erik.hermans |
Component: | mod_jk | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.2.41 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | Linux | ||
Attachments: |
error_log
httpd.conf jk.log mod_jk.conf workers.properties Fall back to process local memory to avoid crash when shm init failed |
Description
erik.hermans
2016-03-15 15:07:02 UTC
Hi, thanks for the report and looking at the core using the debugger. Is this reproducible? Are you starting under load or does it also happen when starting during an idle time? Any warnings or errors in the mod_jk log file during atartup or between startup and the crash? Would it be possible to reproduce with "JkLogLevel debug" and provide access to the logs and you config (Jk dircetives from httpd and workers.properties, plus info about vhost structure)? That will produce loads of log output though, so one would typically only do it on a test system. If some of that info is not supposed to be available in the open, you might send that via private mail to me. Regards, Rainer Created attachment 33676 [details]
error_log
Created attachment 33677 [details]
httpd.conf
Created attachment 33678 [details]
jk.log
Created attachment 33679 [details]
mod_jk.conf
Created attachment 33680 [details]
workers.properties
The problem is reproducable. It also happens when starting during an idle time JkLogLevel debug was already set. You will find conf files and logs attached There's an error during initializing shm: [Tue Mar 15 15:38:00.076 2016] [11496:140079373203424] [error] init_jk::mod_jk.c (3574): Initializing shm:/etc/httpd/logs/jk-runtime-status.11496 errno=13. Load balancing workers will not function properly. errno 13 on Red Hat is "Permission denied". Since you have not configure a JkShmFile, mod_jk had chosen a path, which in your case was a file in the directory /etc/httpd/logs/. Most likely /etc/httpd is your Apache ServerRoot. mod_jk appends "logs" and tries to open the shared memory in that directory. If that isn't what fits your installation, you should explicitely choose a JkShmFile. See also http://tomcat.apache.org/connectors-doc/reference/apache.html. I'll keep that ticket open, because we should fail more gracefully than producing a core dump. But your solution would be to configure a correct JkShmFile. Please let us know if that fixes your crashes. I configured JkShmFile as you suggested, and now it works. Would indeed be nice if mod_jk would fail more gracefully. Created attachment 33685 [details]
Fall back to process local memory to avoid crash when shm init failed
This patch should prevent the crash, when shared memory initialization fails. Since IMHO it is not a good idea to use the module in this case, I wonder whether it would actually be better to fail during startup in this case and not let users proceed.
Currently the failure only affects setups using a load balancer worker. But this could change any time and even configs without farming should always add an lb worker above their ajp workers.
Anyone having an opinion, please respond here. If I hear no objections, I will likely choose to let the module fail the web server startup if it can't init its shared memory (and not apply the patch).
+1 for fail early (with a proper error message, of course) This has been fixed in trunk and will be included in 1.2.42 onwards. |