Friday, December 6, 2013

Compiling mod_jk on Mavericks -



Compiling mod_jk on Mavericks




After the upgrade to Mavericks and solving SVN problems, the Apache Server refused to start with a message:
"Job appears to have crashed: Abort trap: 6"

Looking at the log, I discovered that the Apache Tomcat Connector "mod_jk" aborts with a log message: detected source and destination buffer overlap.

This is a bug on the Apache Connector as stated here and not solved until the current version (tomcat-connectors-1.2.37).

The most simple solution is to modify the tomcat-connectors-1.2.37-src/native/common/jk_map.c file, changing the following lines, at the jk_map_get_int(..) method at line 184.

The original code:

int jk_map_get_int(jk_map_t *m, const char *name, int def)
{
    char buf[100];
    const char *rc;
    size_t len;
    int int_res;
    int multit = 1;

    sprintf(buf, "%d", def);
    rc = jk_map_get_string(m, name, buf);


After edition (changes in bold):

int jk_map_get_int(jk_map_t *m, const char *name, int def)
{
    char buf[100];
    char buf2[100];
    const char *rc;
    size_t len;
    int int_res;
    int multit = 1;

    sprintf(buf2, "%d", def);
    rc = jk_map_get_string(m, name, buf2);

Just recompile/install as indicated in my blog about Tomcat/Pentaho installation.

1 comment:

  1. Thank you so much! This saved me hours of troubleshooting.

    ReplyDelete