Re: [PHP-DEV] Troubles with DL'ed module

2001-04-30 Thread Brian Foddy

Andi Gutmans wrote:
 
 Did you compile with debug on or off?
 Please try without debug in both PHP and your module and let us know if
 something changes.
 Also can you try and load it via php.ini (extension=module.so) and not with
 dl().
 


I rebuilt php 4.0.4p1 with debug off, rebuilt my module with debug off,
and switched from using DL to the extension load in the php.ini.
Unfortunately I still get the same coredump at the same line, just
a different constant.

As before I can step though it with the debugger and the address
it cores in is viewable and has data.

My gut is telling me its a build problem.  Some address not aligned
right or something.  For example shouldn't the -KPIC have been
used in the build argument list to libtool?

But yet, in a seperate install without my new module the
same version of php on the same machine is running in production
very stable. 

Any ideas?
Brian

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Troubles with DL'ed module

2001-04-30 Thread Brian Foddy


One more strange behavior I just saw.

Take this little script:
?
phpinfo ();


$tux = tux_tpalloc (TUX_FML32, , 5000);
print $tux;


tux_tpfree ($tux);
print $tux;

? 


The tux_tpalloc and tux_free are new functions in my module.
If I comment out everything but the phpinfo () and hit
a fresh start of the web server, it will not core.  My module
is loaded because I see it in the phpinfo output.  After that
I can uncomment the rest of the script and it will NOT core.

However if I just run this script right away from a fresh
restart, it will coredump.

Very strange...
Brian

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Troubles with DL'ed module

2001-04-30 Thread Andi Gutmans

Your module is probably causing some memory corruption. The best way to 
debug it is building the module statically into PHP. You need to copy it to 
ext/your_module/ (assuming you have a standard config.m4).
Then in php4/ run ./buildconf and you should see your module when you do 
./configure --help.
./configure and compile PHP with your module statically (best is even as a 
CGI) and then you can really debug it and see if it's a problem with the 
build as a shared library or if you have some bugs.

Andi

At 11:01 AM 4/30/2001 -0500, Brian Foddy wrote:
Andi Gutmans wrote:
 
  Did you compile with debug on or off?
  Please try without debug in both PHP and your module and let us know if
  something changes.
  Also can you try and load it via php.ini (extension=module.so) and not with
  dl().
 


I rebuilt php 4.0.4p1 with debug off, rebuilt my module with debug off,
and switched from using DL to the extension load in the php.ini.
Unfortunately I still get the same coredump at the same line, just
a different constant.

As before I can step though it with the debugger and the address
it cores in is viewable and has data.

My gut is telling me its a build problem.  Some address not aligned
right or something.  For example shouldn't the -KPIC have been
used in the build argument list to libtool?

But yet, in a seperate install without my new module the
same version of php on the same machine is running in production
very stable.

Any ideas?
Brian

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Troubles with DL'ed module

2001-04-30 Thread Sterling Hughes

On Mon, 30 Apr 2001, Andi Gutmans wrote:

 Your module is probably causing some memory corruption. The best way to
 debug it is building the module statically into PHP. You need to copy it to
 ext/your_module/ (assuming you have a standard config.m4).
 Then in php4/ run ./buildconf and you should see your module when you do
 ./configure --help.
 ./configure and compile PHP with your module statically (best is even as a
 CGI) and then you can really debug it and see if it's a problem with the
 build as a shared library or if you have some bugs.


also, configuring with --enable-debug often helps...

-Sterling

 Andi

 At 11:01 AM 4/30/2001 -0500, Brian Foddy wrote:
 Andi Gutmans wrote:
  
   Did you compile with debug on or off?
   Please try without debug in both PHP and your module and let us know if
   something changes.
   Also can you try and load it via php.ini (extension=module.so) and not with
   dl().
  
 
 
 I rebuilt php 4.0.4p1 with debug off, rebuilt my module with debug off,
 and switched from using DL to the extension load in the php.ini.
 Unfortunately I still get the same coredump at the same line, just
 a different constant.
 
 As before I can step though it with the debugger and the address
 it cores in is viewable and has data.
 
 My gut is telling me its a build problem.  Some address not aligned
 right or something.  For example shouldn't the -KPIC have been
 used in the build argument list to libtool?
 
 But yet, in a seperate install without my new module the
 same version of php on the same machine is running in production
 very stable.
 
 Any ideas?
 Brian
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Troubles with DL'ed module

2001-04-30 Thread Andi Gutmans

Sounds like some kind of memory corruption. With these kind of problems 
even the order of statements can make a difference. Do you want to post 
those two functions and we can take a look at them? Also are your RINIT()  
MINIT() functions doing anything? Maybe they are causing problems?

Andi

At 11:17 AM 4/30/2001 -0500, Brian Foddy wrote:

One more strange behavior I just saw.

Take this little script:
?
phpinfo ();


$tux = tux_tpalloc (TUX_FML32, , 5000);
print $tux;


tux_tpfree ($tux);
print $tux;

?


The tux_tpalloc and tux_free are new functions in my module.
If I comment out everything but the phpinfo () and hit
a fresh start of the web server, it will not core.  My module
is loaded because I see it in the phpinfo output.  After that
I can uncomment the rest of the script and it will NOT core.

However if I just run this script right away from a fresh
restart, it will coredump.

Very strange...
Brian

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Troubles with DL'ed module

2001-04-30 Thread Brian Foddy

I'm going to try and build it statically first.  I don't have
any problem posting the code (its already avail on sourceforge
but you will need some proprietary libraries to build it).

The MINIT and/or RINIT is the constants are initialized.

You've given me some to go on, I'll work with it for
a day or so first.  Thanks,
Brian


Andi Gutmans wrote:
 
 Sounds like some kind of memory corruption. With these kind of problems
 even the order of statements can make a difference. Do you want to post
 those two functions and we can take a look at them? Also are your RINIT() 
 MINIT() functions doing anything? Maybe they are causing problems?
 
 Andi
 
 At 11:17 AM 4/30/2001 -0500, Brian Foddy wrote:
 
 One more strange behavior I just saw.
 
 Take this little script:
 ?
 phpinfo ();
 
 
 $tux = tux_tpalloc (TUX_FML32, , 5000);
 print $tux;
 
 
 tux_tpfree ($tux);
 print $tux;
 
 ?
 
 
 The tux_tpalloc and tux_free are new functions in my module.
 If I comment out everything but the phpinfo () and hit
 a fresh start of the web server, it will not core.  My module
 is loaded because I see it in the phpinfo output.  After that
 I can uncomment the rest of the script and it will NOT core.
 
 However if I just run this script right away from a fresh
 restart, it will coredump.
 
 Very strange...
 Brian
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Troubles with DL'ed module

2001-04-28 Thread Andi Gutmans

At 12:20 AM 4/28/2001 -0500, Brian Foddy wrote:
Both were compiled with debug ON.  I'll try them off.
I'm away for the weekend but will try it Sunday night or Monday.

There is a known bug that if you load a shared library with dl(), compiled 
with debug and it leaks memory that it will crash. Try loading it via 
php.ini and let us know if it helps.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Troubles with DL'ed module

2001-04-27 Thread Brian Foddy

I'm having strange problems with a new DL module I'm trying to write.
The most common problem is PHP will coredump after my
module has executed in the module cleanup routines (the Zend routines,
not my module routines).

For instance it will coredump on cleaning up the
10th constant defined by my module.  It cores at
line 643 of zend_hash.c (the pefree line).  Looking
in the debugger, the address looks valid, but free doesn't
like it.  NOTE:  The constants are defined with 
CONST_CS | CONST_PERSISTENT, but taking the Persistent 
out has no effect (the persistent flag is still set in the struct).

If I remove all my constants, or make other alterations
it may core in other but related places inside the cleanup.

I'm doing most of this on Solaris 2.6 (sparc) with the Workshop
compiler (Forte 6.1), but it seems to work ok on Linux and gcc.

I'm not to the point of calling this a Zend bug and
opening a bug report, but I'm hoping to get a few more pointers
of how to proceed.  I haven't tried compiling the module
yet directly into PHP.  I'm rechecking my compile flags,
for example I added -KPIC to the compile but that didn't help.

BTW, the base PHP I'm building against is 4.0.4p2.

Any help would be greatly appreciated...
Brian

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Troubles with DL'ed module

2001-04-27 Thread Andi Gutmans

Did you compile with debug on or off?
Please try without debug in both PHP and your module and let us know if 
something changes.
Also can you try and load it via php.ini (extension=module.so) and not with 
dl().

Andi

At 01:41 PM 4/27/2001 -0500, Brian Foddy wrote:
I'm having strange problems with a new DL module I'm trying to write.
The most common problem is PHP will coredump after my
module has executed in the module cleanup routines (the Zend routines,
not my module routines).

For instance it will coredump on cleaning up the
10th constant defined by my module.  It cores at
line 643 of zend_hash.c (the pefree line).  Looking
in the debugger, the address looks valid, but free doesn't
like it.  NOTE:  The constants are defined with
CONST_CS | CONST_PERSISTENT, but taking the Persistent
out has no effect (the persistent flag is still set in the struct).

If I remove all my constants, or make other alterations
it may core in other but related places inside the cleanup.

I'm doing most of this on Solaris 2.6 (sparc) with the Workshop
compiler (Forte 6.1), but it seems to work ok on Linux and gcc.

I'm not to the point of calling this a Zend bug and
opening a bug report, but I'm hoping to get a few more pointers
of how to proceed.  I haven't tried compiling the module
yet directly into PHP.  I'm rechecking my compile flags,
for example I added -KPIC to the compile but that didn't help.

BTW, the base PHP I'm building against is 4.0.4p2.

Any help would be greatly appreciated...
Brian

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Troubles with DL'ed module

2001-04-27 Thread Brian Foddy

Both were compiled with debug ON.  I'll try them off.
I'm away for the weekend but will try it Sunday night or Monday.

Thanks,
Brian

Andi Gutmans wrote:

 Did you compile with debug on or off?
 Please try without debug in both PHP and your module and let us know if
 something changes.
 Also can you try and load it via php.ini (extension=module.so) and not with
 dl().

 Andi

 At 01:41 PM 4/27/2001 -0500, Brian Foddy wrote:
 I'm having strange problems with a new DL module I'm trying to write.
 The most common problem is PHP will coredump after my
 module has executed in the module cleanup routines (the Zend routines,
 not my module routines).
 
 For instance it will coredump on cleaning up the
 10th constant defined by my module.  It cores at
 line 643 of zend_hash.c (the pefree line).  Looking
 in the debugger, the address looks valid, but free doesn't
 like it.  NOTE:  The constants are defined with
 CONST_CS | CONST_PERSISTENT, but taking the Persistent
 out has no effect (the persistent flag is still set in the struct).
 
 If I remove all my constants, or make other alterations
 it may core in other but related places inside the cleanup.
 
 I'm doing most of this on Solaris 2.6 (sparc) with the Workshop
 compiler (Forte 6.1), but it seems to work ok on Linux and gcc.
 
 I'm not to the point of calling this a Zend bug and
 opening a bug report, but I'm hoping to get a few more pointers
 of how to proceed.  I haven't tried compiling the module
 yet directly into PHP.  I'm rechecking my compile flags,
 for example I added -KPIC to the compile but that didn't help.
 
 BTW, the base PHP I'm building against is 4.0.4p2.
 
 Any help would be greatly appreciated...
 Brian
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]