From users-return-118316-archive-asf-public=cust-asf.ponee.io@httpd.apache.org Tue Jan 8 18:56:42 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 99527180652 for ; Tue, 8 Jan 2019 18:56:41 +0100 (CET) Received: (qmail 47713 invoked by uid 500); 8 Jan 2019 17:56:38 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 47624 invoked by uid 99); 8 Jan 2019 17:56:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2019 17:56:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BCACFC0C51 for ; Tue, 8 Jan 2019 17:56:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.855 X-Spam-Level: * X-Spam-Status: No, score=1.855 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.143, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=rowe-clan-net.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id nty2Xpk-onpw for ; Tue, 8 Jan 2019 17:56:36 +0000 (UTC) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id AB6C860FE2 for ; Tue, 8 Jan 2019 17:56:35 +0000 (UTC) Received: by mail-ed1-f43.google.com with SMTP id a20so5074740edc.8 for ; Tue, 08 Jan 2019 09:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rowe-clan-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=m+byvRx/KoRv216+GoVoLi98O7Wrlzn22Ah0BaEXNLA=; b=NZURqley+IZT3a4gIHzzTfICo/52UbkC2ULG3GtV9Ytabio4zedXnBALFj7rZiOu1m uDgPHqmSs07UY0BEwUFDcv7c/LiJBN72VNXZb54HYxt0L53wd44MtlKzvEySJn/CYheU BntjNGXNt9LgCgb7CwkV7rZombEflz4hK+YhEWL0ypBbHu2oHqBhjYM52TlE/H0z4jJX 798fWEgOEaQVTPJH3gzk5pgjdFVk3WxdA2ttmT2S4y+N9Lp/0iwWwV++DKX1oCpMiIaQ yt/5GWr8y9Erur8s+iI9nD/Ij6CLMuwz0WL+pa09K6xQaUa/2JuNbAbAf/0pRX4XvEPY GzBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=m+byvRx/KoRv216+GoVoLi98O7Wrlzn22Ah0BaEXNLA=; b=LBxlzKUO+lZDG2wyitQ+MwaJas7Yitb51Vte2cW2ateWqOL2EhO2xwq+HyVmapBO7O WSMSHr+t4cNHPywN0rmugu9Q0KjMlG/9fmZQcfPYIputo+eYxe2BwdMlwdiwmuQMPKCD khHz66zmOgOlX+deStljP8hLHA/Wx4XLcEq0YObBxkps4SpfIKrI1Dj5l5eyrnQ4VVor UO5zYy8GEBMhV2NnKooRryg64AC2o9tdUsMo/xlzd67N5Pvt304y5bmc/bPgpXEScxay xDJrAtDji/dgVLMXfeND1/a9+g5g5DfiN8Gjd4n0jyYWQoxmXynj2u1nTvJbAtM3mStX y1cg== X-Gm-Message-State: AJcUukdYYZSGmsYxHBj2fqUY8+sCe5YQf1CpXlFbveF2+jfDUi63ia0A ElEDNdxY+dzdmQUnN/s8WSIFZmVCw8d9Tby97UZzWRGzE4bi3g== X-Google-Smtp-Source: ALg8bN7BudX/eVRcq+Acd7IsYTZN2dYR0ngDrkr0zYFfuKdQzhmR2RJJDVihTla1ddYiepdhvPsip2NNWaeb8DChrFQ= X-Received: by 2002:a50:d753:: with SMTP id i19mr3075759edj.75.1546970193971; Tue, 08 Jan 2019 09:56:33 -0800 (PST) MIME-Version: 1.0 References: <1c5498559d784fd89978e4dc92624a8a@DC03PXMBP003.jacksonnational.com> <24e7f376147c402e996daa8b11c1f474@DC03PXMBP003.jacksonnational.com> In-Reply-To: From: William A Rowe Jr Date: Tue, 8 Jan 2019 11:56:08 -0600 Message-ID: To: users@httpd.apache.org Content-Type: multipart/alternative; boundary="000000000000e3dc8d057ef6109d" Subject: Re: [users@httpd] URGENT: Apache HTTP Migration from 1.3 to 2.4 UNIX Solaris --000000000000e3dc8d057ef6109d Content-Type: text/plain; charset="UTF-8" On Tue, Jan 8, 2019 at 10:48 AM wrote: > > I have migrated a user module mod_example from 1.3 to 2.4. But when I try > to start the apache it is giving a segmentation fault and creating a core. > > Following is the stacktrace while debug: > t@1 (l@1) signal SEGV (no mapping at the fault address) in strlen at > 0xfefcceb8 > 0xfefcceb8: strlen+0x0018: ldub [%o2], %o1 > Current function is apr_pstrdup > 77 len = strlen(s) + 1; > (dbx) where > current thread: t@1 > [1] strlen(0x1, 0xed568, 0x1, 0xed558, 0x1, 0x0), at 0xfefcceb8 > =>[2] apr_pstrdup(a = 0xb8190, s = 0x1 ""), line > 77 in "apr_strings.c" > [3] ap_add_module_commands(m = 0xfebc80d8, p = ), > line 546 in "config.c" > [4] ap_add_module(m = 0xfebc80d8, p = 0xb8190, sym_name = unavailable>), at 0x5db30 > [5] ap_add_loaded_module(mod = 0xfebc80d8, p = 0xb8190, short_name = > 0xed510 "example_module"), line 713 in "config.c" > [6] load_module(cmd = 0xffbfec90, dummy = , modname = > 0xed510 "example_module", filename = ), line 302 in > "mod_so.c" > > This is happening while loading a user module that I created: > LoadModule example_module modules/mod_example.so > > Please provide your valuable insight into it so that I can go forward. > The info above is a bit limited in diagnosing the specifics of source code you didn't share, and we aren't that great at divining the invisible, so two thoughts for you; first build an httpd/apr/your module with CFLAGS -g -O0. Sometimes you can only reproduce a crash with an optimized build, but the -g flag always remains useful in this regard (and objcopy can strip those symbols for general distribution.) I'm guessing the above was built with '-g' but with some '-O', optimizing out some of the args that might have been helpful. Since we can't see above which command in your command_rec array caused this segfault, we can see you had an invalid string element. Line 546 of config.c tripped over your input. config.c:546 was trying to; dir = apr_pstrdup(tpool, cmd->name); This suggests you added a command to the list without an actual char* string name value. Compare your command_rec list with the templates of the various AP_INIT_* macros to ensure you provided valid initializers... only static const array values. Ensure you NULL terminate that list. --000000000000e3dc8d057ef6109d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue,= Jan 8, 2019 at 10:48 AM <singh= al.ankit@tcs.com> wrote:

I have migrated a user module mod_example from 1.3 to 2.4. But when I try to start the apache it is giving a segmenta= tion fault and creating a core.

Following is the stacktrace wh= ile debug:
t@1 (l@1) signal SEGV (no mapping = at the fault address) in strlen at 0xfefcceb8
0xfefcceb8: strlen+0x0018: =C2=A0 = =C2=A0 =C2=A0ldub =C2=A0 =C2=A0 [%o2], %o1
Current function is apr_pstrdup
=C2=A0 =C2=A077 =C2=A0 =C2=A0 =C2= =A0 len =3D strlen(s) + 1;
(dbx) where
current thread: t@1
=C2=A0 [1] strlen(0x1, 0xed568, 0x= 1, 0xed558, 0x1, 0x0), at 0xfefcceb8
=3D>[2] apr_pstrdup(a =3D 0xb81= 90, s =3D 0x1 "<bad address 0x00000001>"), line 77 in "apr_s= trings.c"
=C2=A0 [3] ap_add_module_commands(= m =3D 0xfebc80d8, p =3D <value unavailable>), line 546 in "config.= c"
=C2=A0 [4] ap_add_module(m =3D 0xf= ebc80d8, p =3D 0xb8190, sym_name =3D <value unavailable>), at 0x5db30
=C2=A0 [5] ap_add_loaded_module(mo= d =3D 0xfebc80d8, p =3D 0xb8190, short_name =3D 0xed510 "example_module&= quot;), line 713 in "config.c"
=C2=A0 [6] load_module(cmd =3D 0xf= fbfec90, dummy =3D <value unavailable>, modname =3D 0xed510 "example_modu= le", filename =3D <value unavailable>), line 302 in "mod_so.c"

This is happening while loadin= g a user module that I created:
LoadModule example_module modules/= mod_example.so

Please provide your valuable insig= ht into it so that I can go forward.

The info above is a bit limited in dia= gnosing the specifics of source code
you didn't share, and we= aren't that great at divining the invisible, so two
thoughts= for you; first build an httpd/apr/your module with CFLAGS -g -O0.
Sometimes you can only reproduce a crash with an optimized build, but=C2= =A0
the -g flag always remains useful in this regard (and objcopy= can strip=C2=A0
those symbols for general distribution.) I'm= guessing the above was built=C2=A0
with '-g' but with so= me '-O', optimizing out some of the args that might=C2=A0
have been helpful.

Since we can't see above w= hich command in your=C2=A0command_rec array
caused this segfault,= we can see you had an invalid string element.=C2=A0

Line 546 of config.c tripped over your input. config.c:546 was trying to= ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 dir =3D apr_pstrdup(tpool, cmd= ->name);

This suggests you added a command to the list without an actual cha= r*
string name value.

Compare your= command_rec list with the templates of the various=C2=A0
AP_INIT= _* macros to ensure you provided valid initializers... only=C2=A0
static const array values. Ensure you NULL terminate that list.
=

--000000000000e3dc8d057ef6109d--