Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Sean Redmond

Scott,

I've been using this Aolserver 3.0 + PHP 4.0.6 for over a year with no
problem -- this is new (mis)behavior. In what I'm trying to setup now, the
PHP version is the same, but I'm trying to use new versions of Aolserver
(3.4.2) and RedHat (7.2, old server has 6.2). I cannot think of any way
that Aolserver is causing this problem for PHP, though.

At 06:59 PM 11/26/2001 -0600, you wrote:
Hi Sean,

Is this something you can fix on your own? It's possible that the PHP module
for AOLserver is doing this (i.e. it's building a path without checking for
relative paths); I'm not sure as I've never used the module or PHP.

/s.

Sean Redmond
Brooklyn Museum of Art



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Scott Goodwin

I hate to say it, but drop back to 3.0 and test on RH 7.2. If it breaks,
then there's something different in the combo between AOLserver and RedHat
7.2.

If it works, then upgrade to AOLserver 3.1 and test, then 3.2 and test etc.
until you get to 3.4.2, also on RedHat 7.2. Let's find out which upgrade
breaks it. When it breaks, get a backtrace with GDB, then look at the
sources where it breaks and see what's changed between the code that broke
and the version before it.

Frankly, I'm surprised that a bad path would cause a segfault, which leads
me to believe that some var or pointer isn't being initialized before use.

/s.


 Scott,

 I've been using this Aolserver 3.0 + PHP 4.0.6 for over a year with no
 problem -- this is new (mis)behavior. In what I'm trying to setup now, the
 PHP version is the same, but I'm trying to use new versions of Aolserver
 (3.4.2) and RedHat (7.2, old server has 6.2). I cannot think of any way
 that Aolserver is causing this problem for PHP, though.

 At 06:59 PM 11/26/2001 -0600, you wrote:
 Hi Sean,
 
 Is this something you can fix on your own? It's possible that the PHP
module
 for AOLserver is doing this (i.e. it's building a path without checking
for
 relative paths); I'm not sure as I've never used the module or PHP.
 
 /s.

 Sean Redmond
 Brooklyn Museum of Art








Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Sean Redmond

At 11:24 AM 11/27/2001 -0500, Scott Goodwin wrote:
I hate to say it, but drop back to 3.0 and test on RH 7.2. If it breaks,
then there's something different in the combo between AOLserver and RedHat
7.2.


Actually, I tried that and ran into the same problem.


Sean Redmond
Brooklyn Museum of Art



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Scott Goodwin

Ok, then it sounds like an interaction problem between AOLserver and RedHat
7.2 (or more likely the PHP module and 7.2).

Can you post the backtrace?

/s.

 At 11:24 AM 11/27/2001 -0500, Scott Goodwin wrote:
 I hate to say it, but drop back to 3.0 and test on RH 7.2. If it breaks,
 then there's something different in the combo between AOLserver and
RedHat
 7.2.


 Actually, I tried that and ran into the same problem.


 Sean Redmond
 Brooklyn Museum of Art






Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Dossy

On 2001.11.27, Scott Goodwin [EMAIL PROTECTED] wrote:
 Frankly, I'm surprised that a bad path would cause a segfault, which leads
 me to believe that some var or pointer isn't being initialized before use.

My WAG would be that this is some keep people from busting out of
a chroot jail code that's busted.  The path that PHP is trying
to canonicalize is of the form ../ and a segfault on that smells
fishy of things like this.

RH6 to RH7 made the jump from libc5 to glibc2, right?  Hmm...

-- Dossy

--
Dossy Shiobara   mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Sean Redmond

At 12:22 PM 11/27/2001 -0500, you wrote:
On 2001.11.27, Scott Goodwin [EMAIL PROTECTED] wrote:
  Frankly, I'm surprised that a bad path would cause a segfault, which leads
  me to believe that some var or pointer isn't being initialized before use.

My WAG would be that this is some keep people from busting out of
a chroot jail code that's busted.  The path that PHP is trying
to canonicalize is of the form ../ and a segfault on that smells
fishy of things like this.

RH6 to RH7 made the jump from libc5 to glibc2, right?  Hmm...

-- Dossy

This is what worries me since the same segfault happens with 3.0 and 3.4.2.
However, I can't believe I'm the ONLY person in the world trying to install
this combination.

They're pretty much the same but here are the stack traces for both
versions of Aolserver:

Aolserver 3.0
--

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 4101 (LWP 17152)]
0x400afdd3 in canonicalize (
 name=0x8396940
/usr/local/aolserver-3.0/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/../src/load_prefs.php,
resolved=0x403bc12c )
 at canonicalize.c:88
88  canonicalize.c: No such file or directory.
 in canonicalize.c
(gdb) bt
#0  0x400afdd3 in canonicalize (
 name=0x8396940
/usr/local/aolserver-3.0/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/../src/load_prefs.php,
resolved=0x403bc12c )
 at canonicalize.c:88
#1  0x40291659 in virtual_file_ex (state=0x403bd164,
 path=0x8226f54 ../src/load_prefs.php, verify_path=0)
 at tsrm_virtual_cwd.c:299
#2  0x4020abcc in expand_filepath (filepath=0x8226f54 ../src/load_prefs.php,
 real_path=0x0) at fopen_wrappers.c:531
#3  0x4020a23f in php_fopen_and_set_opened_path (
 path=0x8226f54 ../src/load_prefs.php, mode=0x402a5c47 rb,
 opened_path=0x403bf3e4) at fopen_wrappers.c:237
#4  0x4020a859 in php_fopen_with_path (
 filename=0x8226f54 ../src/load_prefs.php, mode=0x402a5c47 rb,
 path=0x402a707b .:/usr/local/lib/php, opened_path=0x403bf3e4)
 at fopen_wrappers.c:391
#5  0x4020aa88 in php_fopen_url_wrapper (
 path=0x8226f54 ../src/load_prefs.php, mode=0x402a5c47 rb, options=1,
 issock=0x403bf2b0, socketd=0x403bf2b4, opened_path=0x403bf3e4)
 at fopen_wrappers.c:470
#6  0x40208481 in php_fopen_wrapper_for_zend (
 filename=0x8226f54 ../src/load_prefs.php, opened_path=0x403bf3e4)
 at main.c:477
#7  0x401ffd7e in open_file_for_scanning ()
from /usr/local/aolserver-3.0/bin/libphp4.so
#8  0x40200124 in compile_file () from /usr/local/aolserver-3.0/bin/libphp4.so
#9  0x402002c4 in compile_filename ()
from /usr/local/aolserver-3.0/bin/libphp4.so
#10 0x401eac66 in execute (op_array=0x81de830, executor_globals=0x81a5bd0)
 at ./zend_execute.c:2028
#11 0x401e89f3 in execute (op_array=0x82c5b20, executor_globals=0x81a5bd0)
 at ./zend_execute.c:1544
#12 0x401e89f3 in execute (op_array=0x82c5100, executor_globals=0x81a5bd0)
 at ./zend_execute.c:1544
#13 0x401e89f3 in execute (op_array=0x82c24c0, executor_globals=0x81a5bd0)
 at ./zend_execute.c:1544
#14 0x401e89f3 in execute (op_array=0x816b74c, executor_globals=0x81a5bd0)
 at ./zend_execute.c:1544
#15 0x401f6dbd in zend_execute_scripts (type=8, compiler_globals=0x8161868,
 executor_globals=0x81a5bd0, file_count=3) at zend.c:752
#16 0x40209967 in php_execute_script (primary_file=0x403cb6fc,
 compiler_globals=0x8161868, executor_globals=0x81a5bd0,
 core_globals=0x81644b0) at main.c:1206
#17 0x40207732 in php_ns_module_main (ns_context=0x8165340,
 sapi_globals=0x816cd08) at aolserver.c:434
#18 0x4020797f in php_ns_request_handler (context=0x8119450, conn=0x812a308)
 at aolserver.c:519
#19 0x08070c63 in Ns_ConnRunRequest (conn=0x812a308) at op.c:196
#20 0x08076dbe in ConnRun (connPtr=0x812a308) at serv.c:755
#21 0x08076745 in NsConnThread (arg=0x81b1728) at serv.c:554
#22 0x080c8430 in NsThreadMain (arg=0x82420f0) at thread.c:226
#23 0x4002ec6f in pthread_start_thread (arg=0x403cbbe0) at manager.c:284
#24 0x4002ed5f in pthread_start_thread_event (arg=0x403cbbe0) at manager.c:308

Aolserver 3.4.2
--
[New Thread 5126 (LWP 12186)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 5126 (LWP 12186)]
0x4013fa38 in ___lxstat64 (vers=3, name=0x403cd01c /usr, buf=0x403ce04c)
 at ../sysdeps/unix/sysv/linux/lxstat64.c:52
52  ../sysdeps/unix/sysv/linux/lxstat64.c: No such file or directory.
 in ../sysdeps/unix/sysv/linux/lxstat64.c
(gdb) bt
#0  0x4013fa38 in ___lxstat64 (vers=3, name=0x403cd01c /usr, buf=0x403ce04c)
 at ../sysdeps/unix/sysv/linux/lxstat64.c:52
#1  0x400afb7c in canonicalize (
 name=0x8280b90
/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/../src/load_prefs.php,
resolved=0x403ce10c )
 at canonicalize.c:150
#2  0x402cd659 in virtual_file_ex (state=0x403cf13c,
 path=0x83d3704 

Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Lamar Owen

On Tuesday 27 November 2001 12:22 pm, Dossy wrote:
 On 2001.11.27, Scott Goodwin [EMAIL PROTECTED] wrote:
  Frankly, I'm surprised that a bad path would cause a segfault, which
  leads me to believe that some var or pointer isn't being initialized
  before use.

 My WAG would be that this is some keep people from busting out of
 a chroot jail code that's busted.  The path that PHP is trying
 to canonicalize is of the form ../ and a segfault on that smells
 fishy of things like this.

 RH6 to RH7 made the jump from libc5 to glibc2, right?  Hmm...

No.  RH6 = glibc 2.1
RH7= glibc 2.2 -- 7.1 and 7.2 are kernel 2.4.

The last Red Hat with libc5 was 4.2.  Red Hat 5.0 did the libc5-glibc 2.0
upgrade.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Dossy

On 2001.11.27, Sean Redmond [EMAIL PROTECTED] wrote:
 0x400afdd3 in canonicalize (
 name=0x8396940
 
/usr/local/aolserver-3.0/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/../src/load_prefs.php,
 resolved=0x403bc12c )
 at canonicalize.c:88
 88  canonicalize.c: No such file or directory.
 in canonicalize.c

Could you add the directory containing the PHP source to your
gdb init, as well, and send that backtrace?  I'm guessing that's
where canonicalize.c lives, and it'd be interesting to see what
line 88 is actually doing that causes the segfault ...

 (gdb) bt
 #0  0x4013fa38 in ___lxstat64 (vers=3, name=0x403cd01c /usr,
 buf=0x403ce04c)
 at ../sysdeps/unix/sysv/linux/lxstat64.c:52

This is a little more telling.  I wonder where *buf points to ...
which we'd know looking at canonicalize.c ...

-- Dossy

--
Dossy Shiobara   mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Sean Redmond

At 01:22 PM 11/27/2001 -0500, you wrote:
Could you add the directory containing the PHP source to your
gdb init, as well, and send that backtrace?  I'm guessing that's
where canonicalize.c lives, and it'd be interesting to see what
line 88 is actually doing that causes the segfault ...

I did (tsrm_virtual_cwd.c, for instance, is part of PHP) but but there is
no file called canonicalize.c on my system. Is it built into gcc or
something? It seems to be part of stdlib.

BTW, if I build PHP with --enable-debug Aolserver crashes on startup:

[27/Nov/2001:12:12:42][14963.1024][-main-] Warning: modload: failed to load
'/usr/local/aolserver/bin/libphp4.so':
'/usr/local/aolserver/bin/libphp4.so: undefined symbol: tsrm_error'
[27/Nov/2001:12:12:42][14963.1024][-main-] Fatal: modload: failed to load
module '/usr/local/aolserver/bin/libphp4.so'



Sean Redmond
Brooklyn Museum of Art



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Dossy

On 2001.11.27, Sean Redmond [EMAIL PROTECTED] wrote:
 At 01:22 PM 11/27/2001 -0500, you wrote:
 Could you add the directory containing the PHP source to your
 gdb init, as well, and send that backtrace?  I'm guessing that's
 where canonicalize.c lives, and it'd be interesting to see what
 line 88 is actually doing that causes the segfault ...

 I did (tsrm_virtual_cwd.c, for instance, is part of PHP) but but there is
 no file called canonicalize.c on my system. Is it built into gcc or
 something? It seems to be part of stdlib.

Against your AOLserver 3.0 and RH7 setup, could you re-run gdb
and produce the crash, then type up then list as commands
to gdb once it segfaults?

Send that output.  It may help us.

-- Dossy

--
Dossy Shiobara   mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Sean Redmond

(gdb) up
#1  0x40291659 in virtual_file_ex (state=0x403ac164,
 path=0x833a694 ../src/load_prefs.php, verify_path=0)
 at tsrm_virtual_cwd.c:299
299 if (realpath(tmp, resolved_path)) {
(gdb) list
294 ptr += state-cwd_length;
295 *ptr++ = DEFAULT_SLASH;
296 memcpy(ptr, path, path_length);
297 ptr += path_length;
298 *ptr = '\0';
299 if (realpath(tmp, resolved_path)) {
300 path = resolved_path;
301 path_length = strlen(path);
302 }
303 free(tmp);


At 02:10 PM 11/27/2001 -0500, Dossy wrote:
Against your AOLserver 3.0 and RH7 setup, could you re-run gdb
and produce the crash, then type up then list as commands
to gdb once it segfaults?

Send that output.  It may help us.

-- Dossy

Sean Redmond
Brooklyn Museum of Art



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Dossy

Okay.  Could you provide the source for the entire virtual_file_ex()
function from tsrm_virtual_cwd.c file?

-- Dossy

On 2001.11.27, Sean Redmond [EMAIL PROTECTED] wrote:
 (gdb) up
 #1  0x40291659 in virtual_file_ex (state=0x403ac164,
 path=0x833a694 ../src/load_prefs.php, verify_path=0)
 at tsrm_virtual_cwd.c:299
 299 if (realpath(tmp, resolved_path)) {
 (gdb) list
 294 ptr += state-cwd_length;
 295 *ptr++ = DEFAULT_SLASH;
 296 memcpy(ptr, path, path_length);
 297 ptr += path_length;
 298 *ptr = '\0';
 299 if (realpath(tmp, resolved_path)) {
 300 path = resolved_path;
 301 path_length = strlen(path);
 302 }
 303 free(tmp);


 At 02:10 PM 11/27/2001 -0500, Dossy wrote:
 Against your AOLserver 3.0 and RH7 setup, could you re-run gdb
 and produce the crash, then type up then list as commands
 to gdb once it segfaults?
 
 Send that output.  It may help us.
 
 -- Dossy

 Sean Redmond
 Brooklyn Museum of Art

--
Dossy Shiobara   mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
  He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on. (p. 70)



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-27 Thread Dossy

My next suggestion will require learning a bit of gdb, but
I'd try setting a breakpoint on line 298, and when it stops
I'd inspect what's actually contained in *tmp.

Why they built *ptr (and thus, *tmp) the way they did
baffles me, too.

One suggestion, delete line 287 (I think) which I'm marking
with *** :

} else { /* Concat current directory with relative path and then run 
realpath() on it */
char *tmp;
char *ptr;   *** THIS LINE ***

The locally scoped *ptr masks the *ptr defined at the
function scope (char *ptr, *path_copy;) ... I don't
think this is the culprit, but who knows.  Removing line
287's definition shouldn't cause any additional problems
after reading the code.

Try making this small change, and recompiling the PHP
module, and see what happens.

-- Dossy


On 2001.11.27, Sean Redmond [EMAIL PROTECTED] wrote:
 Here it is (marked line 299 with )

 /* Resolve path relatively to state and put the real path into state */
 /* returns 0 for ok, 1 for error */
 CWD_API int virtual_file_ex(cwd_state *state, const char *path,
 verify_path_func verify_path)
 {
 int path_length = strlen(path);
 char *ptr, *path_copy;
 char *tok = NULL;
 int ptr_length;
 cwd_state *old_state;
 int ret = 0;
 int copy_amount = -1;
 char *free_path;
 unsigned char is_absolute = 0;
 #ifndef TSRM_WIN32
 char resolved_path[MAXPATHLEN];
 #endif

 if (path_length == 0)
 return (0);

 #if !defined(TSRM_WIN32)  !defined(__BEOS__)
 if (IS_ABSOLUTE_PATH(path, path_length)) {
 if (realpath(path, resolved_path)) {
 path = resolved_path;
 path_length = strlen(path);
 }
 } else { /* Concat current directory with relative path and then
 run realpath() on it */
 char *tmp;
 char *ptr;

 ptr = tmp = (char *)
 malloc(state-cwd_length+path_length+sizeof(/));
 if (!tmp) {
 return 1;
 }
 memcpy(ptr, state-cwd, state-cwd_length);
 ptr += state-cwd_length;
 *ptr++ = DEFAULT_SLASH;
 memcpy(ptr, path, path_length);
 ptr += path_length;
 *ptr = '\0';
 if (realpath(tmp, resolved_path)) { // 
 path = resolved_path;
 path_length = strlen(path);
 }
 free(tmp);
 }
 #endif
 free_path = path_copy = tsrm_strndup(path, path_length);

 old_state = (cwd_state *) malloc(sizeof(cwd_state));
 CWD_STATE_COPY(old_state, state);
 #if VIRTUAL_CWD_DEBUG
 fprintf(stderr,cwd = %s path = %s\n, state-cwd, path);
 #endif
 if (IS_ABSOLUTE_PATH(path_copy, path_length)) {
 copy_amount = COPY_WHEN_ABSOLUTE;
 is_absolute = 1;
 #ifdef TSRM_WIN32
 } else if (IS_UNC_PATH(path_copy, path_length)) {
 copy_amount = 1;
 is_absolute = 1;
 } else if (IS_SLASH(path_copy[0])) {
 copy_amount = 2;
 #endif
 }

 if (copy_amount != -1) {
 state-cwd = (char *) realloc(state-cwd, copy_amount + 1);
 if (copy_amount) {
 if (is_absolute) {
 memcpy(state-cwd, path_copy, copy_amount);
 path_copy += copy_amount;
 } else {
 memcpy(state-cwd, old_state-cwd,
 copy_amount);
 }
 }
 state-cwd[copy_amount] = '\0';
 state-cwd_length = copy_amount;
 }


 ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, tok);
 while (ptr) {
 ptr_length = strlen(ptr);

 if (IS_DIRECTORY_UP(ptr, ptr_length)) {
 char save;

 save = DEFAULT_SLASH;

 #define PREVIOUS state-cwd[state-cwd_length - 1]

 while (IS_ABSOLUTE_PATH(state-cwd,
 state-cwd_length) 
 !IS_SLASH(PREVIOUS)) {
 save = PREVIOUS;
 PREVIOUS = '\0';
 state-cwd_length--;
 }

 if (!IS_ABSOLUTE_PATH(state-cwd,
 state-cwd_length)) {
 state-cwd[state-cwd_length++] = save;
 state-cwd[state-cwd_length] = '\0';
 } else {
 PREVIOUS = '\0';
 state-cwd_length--;
 }
 } else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) {
 

Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-26 Thread Sean Redmond

At 03:27 PM 11/26/2001 -0500, you wrote:
Hi Sean,

have you run AOLserver under GDB yet to find out where it is segfaulting?
Here's an example of how to do that.

Thanks. It is happening when in the PHP statement

 include ../src/load_prefs.php;

The relative path is expanded to

 
/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/../src/load_prefs.php

instead of:

 
/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/load_prefs.php

I.e the .. is not treated correctly. It seems to be PHP's fault.

here is the relevant output of gdb:

[New Thread 6151 (LWP 26839)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 6151 (LWP 26839)]
0x400afdd3 in canonicalize (
 name=0x4083b278
/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/../src/load_prefs.php,
resolved=0x4053414c )
 at canonicalize.c:88
88  canonicalize.c: No such file or directory.
 in canonicalize.c
(gdb) bt
#0  0x400afdd3 in canonicalize (
 name=0x4083b278
/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/../src/load_prefs.php,
resolved=0x4053414c )
 at canonicalize.c:88
#1  0x402be679 in virtual_file_ex (state=0x40535184,
 path=0x40665cd4 ../src/load_prefs.php, verify_path=0)
 at tsrm_virtual_cwd.c:299
#2  0x402423cc in expand_filepath (
 filepath=0x40665cd4 ../src/load_prefs.php, real_path=0x0)
 at fopen_wrappers.c:531
#3  0x40241a3f in php_fopen_and_set_opened_path (
 path=0x40665cd4 ../src/load_prefs.php, mode=0x402d2627 rb,
 opened_path=0x405373b4) at fopen_wrappers.c:237
#4  0x40242059 in php_fopen_with_path (
 filename=0x40665cd4 ../src/load_prefs.php, mode=0x402d2627 rb,
 path=0x8178b38
.:/usr/local/lib/php:/home/aol30/webmail/pages/webmail/src,
opened_path=0x405373b4) at fopen_wrappers.c:391
#5  0x40242288 in php_fopen_url_wrapper (
 path=0x40665cd4 ../src/load_prefs.php, mode=0x402d2627 rb,
 options=1, issock=0x405372d0, socketd=0x405372d4, opened_path=0x405373b4)
 at fopen_wrappers.c:470
#6  0x4023fc81 in php_fopen_wrapper_for_zend (
 filename=0x40665cd4 ../src/load_prefs.php, opened_path=0x405373b4)
 at main.c:477
#7  0x40239074 in open_file_for_scanning (file_handle=0x405373ac,
 compiler_globals=0x40630900) at zend_language_scanner_cc.cc:2899
#8  0x402394ee in compile_file (file_handle=0x405373ac, type=2,
 compiler_globals=0x40630900) at zend_language_scanner_cc.cc:2966
#9  0x4023966b in compile_filename (type=2, filename=0x406d92bc,
 compiler_globals=0x40630900, executor_globals=0x4061f440)
 at zend_language_scanner_cc.cc:3022
#10 0x40224016 in execute (op_array=0x406be8d0, executor_globals=0x4061f440)
 at ./zend_execute.c:2028
#11 0x40221da3 in execute (op_array=0x40774028, executor_globals=0x4061f440)
 at ./zend_execute.c:1544
#12 0x40221da3 in execute (op_array=0x407721a0, executor_globals=0x4061f440)
 at ./zend_execute.c:1544
#13 0x40221da3 in execute (op_array=0x4075b340, executor_globals=0x4061f440)
 at ./zend_execute.c:1544
#14 0x40221da3 in execute (op_array=0x40643c3c, executor_globals=0x4061f440)
 at ./zend_execute.c:1544
#15 0x4023016d in zend_execute_scripts (type=8, compiler_globals=0x40630900,
 executor_globals=0x4061f440, file_count=3) at zend.c:752
#16 0x40241167 in php_execute_script (primary_file=0x405436cc,
 compiler_globals=0x40630900, executor_globals=0x4061f440,
 core_globals=0x4061f740) at main.c:1206
#17 0x4023ef32 in php_ns_module_main (ns_context=0x40625bb0,
 sapi_globals=0x40632968) at aolserver.c:434
#18 0x4023f17f in php_ns_request_handler (context=0x8187c08, conn=0x819dc60)
 at aolserver.c:519
#19 0x08077bb7 in Ns_ConnRunRequest (conn=0x819dc60) at op.c:196
#20 0x0807e2c2 in ConnRun (connPtr=0x819dc60) at serv.c:882
#21 0x0807dc10 in NsConnThread (arg=0x40604300) at serv.c:671
#22 0x0811833b in NsThreadMain (arg=0x40604310) at thread.c:228
#23 0x4002ec6f in pthread_start_thread (arg=0x40543be0) at manager.c:284
#24 0x4002ed5f in pthread_start_thread_event (arg=0x40543be0)
 at manager.c:308


Sean Redmond
Brooklyn Museum of Art



Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-26 Thread Scott S. Goodwin

Hi Sean,

Is this something you can fix on your own? It's possible that the PHP module
for AOLserver is doing this (i.e. it's building a path without checking for
relative paths); I'm not sure as I've never used the module or PHP.

/s.

-+-+-+-+-+-+-+-+-+-+-+-+-
If to err is human, I must be more human than most.

Scott S. Goodwin
u: http://scottg.net
e: [EMAIL PROTECTED]
p: 850.897.6830
aim: scottgnet


- Original Message -
From: Sean Redmond [EMAIL PROTECTED]
To: AOLserver Discussion [EMAIL PROTECTED]
Sent: Monday, November 26, 2001 4:06 PM
Subject: Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail


 At 03:27 PM 11/26/2001 -0500, you wrote:
 Hi Sean,
 
 have you run AOLserver under GDB yet to find out where it is segfaulting?
 Here's an example of how to do that.

 Thanks. It is happening when in the PHP statement

  include ../src/load_prefs.php;

 The relative path is expanded to


/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/
../src/load_prefs.php

 instead of:


/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src/
load_prefs.php

 I.e the .. is not treated correctly. It seems to be PHP's fault.

 here is the relevant output of gdb:

 [New Thread 6151 (LWP 26839)]

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 6151 (LWP 26839)]
 0x400afdd3 in canonicalize (
  name=0x4083b278

/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src
/../src/load_prefs.php,
 resolved=0x4053414c )
  at canonicalize.c:88
 88  canonicalize.c: No such file or directory.
  in canonicalize.c
 (gdb) bt
 #0  0x400afdd3 in canonicalize (
  name=0x4083b278

/usr/local/aolserver-3.4.2/servers/webmail/pages/squirrelmail-1.2.0-rc2/src
/../src/load_prefs.php,
 resolved=0x4053414c )
  at canonicalize.c:88
 #1  0x402be679 in virtual_file_ex (state=0x40535184,
  path=0x40665cd4 ../src/load_prefs.php, verify_path=0)
  at tsrm_virtual_cwd.c:299
 #2  0x402423cc in expand_filepath (
  filepath=0x40665cd4 ../src/load_prefs.php, real_path=0x0)
  at fopen_wrappers.c:531
 #3  0x40241a3f in php_fopen_and_set_opened_path (
  path=0x40665cd4 ../src/load_prefs.php, mode=0x402d2627 rb,
  opened_path=0x405373b4) at fopen_wrappers.c:237
 #4  0x40242059 in php_fopen_with_path (
  filename=0x40665cd4 ../src/load_prefs.php, mode=0x402d2627 rb,
  path=0x8178b38
 .:/usr/local/lib/php:/home/aol30/webmail/pages/webmail/src,
 opened_path=0x405373b4) at fopen_wrappers.c:391
 #5  0x40242288 in php_fopen_url_wrapper (
  path=0x40665cd4 ../src/load_prefs.php, mode=0x402d2627 rb,
  options=1, issock=0x405372d0, socketd=0x405372d4,
opened_path=0x405373b4)
  at fopen_wrappers.c:470
 #6  0x4023fc81 in php_fopen_wrapper_for_zend (
  filename=0x40665cd4 ../src/load_prefs.php, opened_path=0x405373b4)
  at main.c:477
 #7  0x40239074 in open_file_for_scanning (file_handle=0x405373ac,
  compiler_globals=0x40630900) at zend_language_scanner_cc.cc:2899
 #8  0x402394ee in compile_file (file_handle=0x405373ac, type=2,
  compiler_globals=0x40630900) at zend_language_scanner_cc.cc:2966
 #9  0x4023966b in compile_filename (type=2, filename=0x406d92bc,
  compiler_globals=0x40630900, executor_globals=0x4061f440)
  at zend_language_scanner_cc.cc:3022
 #10 0x40224016 in execute (op_array=0x406be8d0,
executor_globals=0x4061f440)
  at ./zend_execute.c:2028
 #11 0x40221da3 in execute (op_array=0x40774028,
executor_globals=0x4061f440)
  at ./zend_execute.c:1544
 #12 0x40221da3 in execute (op_array=0x407721a0,
executor_globals=0x4061f440)
  at ./zend_execute.c:1544
 #13 0x40221da3 in execute (op_array=0x4075b340,
executor_globals=0x4061f440)
  at ./zend_execute.c:1544
 #14 0x40221da3 in execute (op_array=0x40643c3c,
executor_globals=0x4061f440)
  at ./zend_execute.c:1544
 #15 0x4023016d in zend_execute_scripts (type=8,
compiler_globals=0x40630900,
  executor_globals=0x4061f440, file_count=3) at zend.c:752
 #16 0x40241167 in php_execute_script (primary_file=0x405436cc,
  compiler_globals=0x40630900, executor_globals=0x4061f440,
  core_globals=0x4061f740) at main.c:1206
 #17 0x4023ef32 in php_ns_module_main (ns_context=0x40625bb0,
  sapi_globals=0x40632968) at aolserver.c:434
 #18 0x4023f17f in php_ns_request_handler (context=0x8187c08,
conn=0x819dc60)
  at aolserver.c:519
 #19 0x08077bb7 in Ns_ConnRunRequest (conn=0x819dc60) at op.c:196
 #20 0x0807e2c2 in ConnRun (connPtr=0x819dc60) at serv.c:882
 #21 0x0807dc10 in NsConnThread (arg=0x40604300) at serv.c:671
 #22 0x0811833b in NsThreadMain (arg=0x40604310) at thread.c:228
 #23 0x4002ec6f in pthread_start_thread (arg=0x40543be0) at manager.c:284
 #24 0x4002ed5f in pthread_start_thread_event (arg=0x40543be0)
  at manager.c:308


 Sean Redmond
 Brooklyn Museum of Art




Re: [AOLSERVER] Again, Segfault with Aolserver, PHP, SquirrelMail

2001-11-26 Thread Scott Goodwin

Hi Sean,

have you run AOLserver under GDB yet to find out where it is segfaulting?
Here's an example of how to do that.

Put this into a file called gdbinit, substituting the things in parens with
something appropriate and adjusting pathnames:

=== BEGIN : CUT ==
directory /usr/local/src/aolserver
directory /usr/local/src/(other source dir)
directory /usr/local/src/(other source dir)

set args -f -u (user) -g (group) -t /usr/local/aolserver/nsd.tcl -s
(servername)

run
== END : CUT 

then run:

gdb -x gdbinit /usr/local/bin/aolserver/bin/nsd



After the process segfaults, type bt at the GDB prompt (bt = backtrace).

This should give you the function, source code line # etc. of where the
fault is occurring.

/s.



 Hello,

 No one seems to want to touch this, not on the Aolserver list, not on the
 PHP list, not on the SquirrelMail list. However, I'm going to try again.

 On a server running RedHat Linux 7.2, I've got Aolserver 3.4.2 compiled
and
 working fine, and PHP 4.0.6 compiled as a module and working fine except
 when it segfaults. It occurs consistently when loading SquirrelMail's
 (1.2.0-rc2) src/right_main.php, though I think the problem is really in
the
 called function sqi_mailbox_list from functions/imap_mailbox.php. Exactly
 what the server is trying to do when it crashes I haven't yet figured out.

 The PHP source distribution warns about trouble with multi-threaded
 servers, but the suggested workaround, removing a line of code, refers to
a
 line that no longer appears to be in the code anyway.

 Has anyone had a similar problem? Can anyone help me solve this problem or
 debug it more accurately? I currently have Aolserver 3.0, SquirrelMail
 1.0.6, and PHP 4.0.6 running with no problems on another server under
 RedHat 6.2 (I'm trying to migrate our webmail onto a new machine) so this
 is very frustrating.

 Thanks.

 Sean Redmond
 Brooklyn Museum of Art