Hi William,
Thank you for the response.
I have compiled the code with -g option.
Please find the excerpts from the code and httpd.conf file:
Code declaration:
static const command_rec example_cmds[] =
{
("SCENARIO",CallScenarioName,NULL,RSRC_CONF,"Define scenario name"),
{NULL}
};
module MODULE_VAR_EXPORT example_module =
{
STANDARD20_MODULE_STUFF,
create_example_dir_config, /* per-directory config creator */
NULL, /* dir config merger */
example_create_server_config, /* server config creator */
NULL, /* server config merger */
example_cmds, /* command table */
register_hooks, /* [7] list of handlers */
};
httpd.conf:
<IfModule example_module>
SCENARIO WEBUI_DEFAULTOPEN
</IfModule>
<Location /COMSHTTPS>
SetHandler example-handler
</Location>
Could you please suggest whether need to make more entries in the
httpd.conf of command entries?
Thanks & Regards
Ankit Singhal
Tata Consultancy Services
Mailto: [email protected]
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Consulting
____________________________________________
From: "William A Rowe Jr" <[email protected]>
To: [email protected]
Date: 08-01-2019 14:57
Subject: Re: [users@httpd] URGENT: Apache HTTP Migration from 1.3
to 2.4 UNIX Solaris
"External email. Open with Caution"
On Tue, Jan 8, 2019 at 10:48 AM <[email protected]> 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 "<bad address 0x00000001>"), line
77 in "apr_strings.c"
[3] ap_add_module_commands(m = 0xfebc80d8, p = <value unavailable>),
line 546 in "config.c"
[4] ap_add_module(m = 0xfebc80d8, p = 0xb8190, sym_name = <value
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 = <value unavailable>, modname =
0xed510 "example_module", filename = <value unavailable>), 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.
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you