[Speedycgi-users] speedy bus error under FreeBSD-5.x
Brought to you by:
samh
|
From: Lars T. <la...@th...> - 2003-05-21 08:45:21
|
Hi all,
It seems the speedy executable has some problems running under FreeBSD-5.x,
e.g.:
--cut--
[lth@bhor speedy]$ ./speedy -- -v
Bus error (core dumped)
[lth@bhor speedy]$
--cut--
This, and another bus error problem stems from a couple of code bugs, solved
by the following patch:
--cut--
--- src/speedy_opt.c Mon Sep 30 07:19:54 2002
+++ /tmp/speedy_opt.c Tue May 20 11:11:28 2003
@@ -165,6 +165,8 @@ static void cmdline_split(
++p;
if (*p)
strlist_append(doing_speedy_opts ? speedy_opts : perl_args,
*p);
+ else
+ break;
}
if (*p) {
@@ -422,7 +424,7 @@ const char * const *speedy_opt_script_ar
}
SPEEDY_INLINE const char *speedy_opt_script_fname(void) {
- return exec_argv.ptrs[script_argv_loc];
+ return exec_argv.len > script_argv_loc ?
exec_argv.ptrs[script_argv_loc] : NULL;
}
#ifdef SPEEDY_BACKEND
--cut--
Apparently, malloc() of current beta versions of 5.x has the the 'J' flag
set, and is therefore much more unforgiving regarding pointer overruns than
under 4.x (and under Linux), so this is probably why this has not been
discovered before.
Thanks to tobez for invaluable help with debugging this.
/Lars
|