#28639 [Com]: imageCreateFromGif infinite loop. max processor

2004-06-15 Thread iridium at beyondunreal dot com
 ID:   28639
 Comment by:   iridium at beyondunreal dot com
 Reported By:  jim at bluedojo dot com
 Status:   Verified
 Bug Type: GD related
 Operating System: Windows XP
 PHP Version:  4.3.7
 New Comment:

I have reproduced this bug using

php -r
"imagecreatefromgif('http://members.tripod.com/~TyroneZero/drstrangelove.gif');"

on both windows xp in PHP 5.0.0rc2
and linux with 4.3.6
(both command line).

The above command causes it to hang. Tracing through the code using a
debugger it does look a lot like an infinate loop, though it could just
be a really long one.

I believe the infinate loop starts at line 155 in gd_gif_in.c at 

for (;;) {

- I think it may just not be reaching an exit condition.

I may investigate more later.

Very strangely, if I download the gif and run the same command without
going to the site at runtime, there is no such problem.

Irid.


Previous Comments:


[2004-06-14 14:02:11] [EMAIL PROTECTED]

It seems this is Windows specific issue caused most probably by
php_gd2.dll.



[2004-06-06 20:04:26] jim at bluedojo dot com

Yes, the images are corrupt.  I believe that is why the function
imageCreateFromGif() is going into an infinite loop.  I need to have
the function just exit and not loop infinitely.

When I run the php page from the command line it goes into an infinite
loop.  When I load the php page from an Apache web server, it causes
Apache to stall infinitely.  My processor maxes out and I have to go to
the Windows Task Menu to cancel the process.

I am running the following:

Windows XP
Apache/1.3.28
PHP/4.3.7 
GD library is turned on in php.ini

Any help would be greatful.  Thanks.



[2004-06-06 18:32:07] [EMAIL PROTECTED]

The 2 gif images you've offered are corrupt, and I cannot 
replicate the cpu usage you are reporting.  



[2004-06-05 20:00:26] jim at bluedojo dot com

This picture also causes processor to max out:

http://www.geocities.com/Tokyo/Palace/5677/riiya1.gif



[2004-06-05 05:55:24] jim at bluedojo dot com

Description:

For some reason, this gif causes the processor to max out at 100% when
imageCreateFromGif() function is used.




Reproduce code:
---
http://members.tripod.com/~TyroneZero/drstrangelove.gif";);

?>

Expected result:

Creates a GD image

Actual result:
--
Infinite Loop.  Maxes out processor.  Causes operating system to stall.





-- 
Edit this bug report at http://bugs.php.net/?id=28639&edit=1


#24192 [NEW]: Unloading GD resource created with custom module causes crash

2003-06-15 Thread iridium at beyondunreal dot com
From: iridium at beyondunreal dot com
Operating system: Windows XP sp1
PHP version:  4.3.2
PHP Bug Type: Zend Engine 2 problem
Bug description:  Unloading GD resource created with custom module causes crash

Description:

Apache Version: 1.3.27
Operating System: Windows XP SP1
PHP Version: 4.3.2

PHP runs as a module for apache.

Basically, I've created my own module for reading bitmaps under windows.
The module creates a gd object, and reads the pixels from a bitmap to the
gd object.

This module worked fine before PHP4.3.2 (at least it worked in 4.3.2's
RCs), but it seems to have stopped working in PHP4.3.2's release.

What I did was I removed all of the code for creating the bitmap itself,
and was left with the image creating code.

What I found was, that when the image was either destroyed, or unloaded,
Apache Crashed ( presumably segmentation fault ).

As far as I can tell, I use exactly the same code as the gd module for
creating an image.

I have included the code I use for my readbitmap function. I have tested
le_gd and it is the correct value.

I'm afraid I cannot provide a backtrace because this is a windows system,
and I am unfamilier with generating a backtrace on a windows system, and I
could not see instruction on how to do it.

I tried compiling my module in debug mode, but when given the chance to
debug when it crashed - I was given the ASM for apache, seeing as it was
apache.exe that actually crashed, and apache was not compiled in debug
mode.

I have also tried gdImageDestroy'ing (im) as soon as it is created and
returning false. This does not cause any problems.

In the source below you can see im = readbitmaptogdimage(). This is the
function that reads the bitmap, but it turns out that if I just use
gdImageCreateTrueColor, when that is unloaded, apache crashes.

If you can think of anything that might cause it, or any way around the
problem, it would be appreciated.

An alternative would be to write one function to get the size from a
bitmap, create the image using php, and use another function to copy a
bitmap to the image. If I try that, I'll reply to this bug report, but
that should work, because the problem seems to be related to unloading
resources created with a module.

I've written other modules that just manipulate gd resources (no resource
creation), and they still work fine for PHP4.3.2.

Thanks in Advance for any help. Sorry I can't provide a backtrace..


Reproduce code:
---
PHP_FUNCTION(readbitmap)
{
gdImagePtr im;
zval **file;

if ( zend_get_parameters_ex( 1, &file ) == FAILURE ) 
ZEND_WRONG_PARAM_COUNT();

convert_to_string_ex(file);
//im = readbitmaptogdimage( Z_STRVAL_PP(file) );

im = gdImageCreateTrueColor( 100, 100 );

if ( !im ) RETURN_FALSE;

ZEND_REGISTER_RESOURCE( return_value, im, le_gd );
}

Expected result:

A GD object to be created and registered as a resource

Actual result:
--
A GD object is created, but when an attempt is made to unload it (or when
PHP finishes executing and does its resource cleanup), it crashes.

I cannot provide a backtrace at this time.

-- 
Edit bug report at http://bugs.php.net/?id=24192&edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24192&r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=24192&r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=24192&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24192&r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=24192&r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=24192&r=support
Expected behavior:  http://bugs.php.net/fix.php?id=24192&r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=24192&r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=24192&r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=24192&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24192&r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=24192&r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=24192&r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=24192&r=gnused



#23861 [Com]: php_gd2.dll - The Specified procedure cannot be found

2003-06-12 Thread iridium at beyondunreal dot com
 ID:   23861
 Comment by:   iridium at beyondunreal dot com
 Reported By:  steve at enerds dot ca
 Status:   Bogus
 Bug Type: Dynamic loading
 Operating System: Windows
 PHP Version:  4.3.2RC4
 New Comment:

I am a stupid idiot/dolt person.

Gahh.

I found that there were php4ts.dll/php4apache.dlls in my apache
executable directory that were out of date.

Updated them and the the problem disappeared.

Let this be a lesson.. search for *.dll!


Previous Comments:


[2003-06-12 19:39:50] iridium at beyondunreal dot com

I am getting this bug as well, I am aware this one has been declared
bogus, but I am curious.

I have found that php_gd2.dll and php_sockets.dll will not load at all
in the latest version of PHP (4.3.2), but if I take the modules from
PHP 4.3.0, they will both load using PHP 4.3.2.

I have made sure these are the only copies avaliable in the path, and I
have tried as many locations to put these DLLs as you care to think of,
but they still won't load.

Since the problem only seems to occour when I try to use the latest
DLLs, doens't that mean something is wrong with the DLLs? 

To my knowledge, I have followed the install instructions quite
carefully, and I am certain that all of the relevent (PHP) DLLs have
been updated on my system to version 4.3.2. I have spent quite a while
puzzling over this.

I'm running Apache 1.3.7 and PHP 4.3.2 on Windows XP Pro Sp1.

A friend of mine found that PHP wouldn't load on his system either if
he tried to use the most recent gd2.dll.



[2003-05-29 22:45:02] steve at enerds dot ca

*puts head down with sheepish grin*

For some reason or another our sysadmin had a copy of the dll's in
c:\windows and c:\windows\system32.Once I deleted those from
c:\windows and updated those in c:\windows\system32
all was well.

Sorry for the inconvenience, appreciate the support
~Steve



[2003-05-29 20:57:17] steve at enerds dot ca

I am still having the problem with multiple Windows machine, with
different configurations.   In all cases, the gd2.dll loads with php
4.3.1, however when I upgrade to the RC 4.3.2 gd2 cannot load.  

Please advise.
Thanks in advance



[2003-05-28 21:57:53] steve at enerds dot ca

This is *NOT* a configuration problem.   Using 4.3.1, without changing
my configuration file, paths, or anything else (just the appropriate
dll's), it works - gd2 extension loads.   When I change to the 4.3.2
RC4 code, it does not work.  This is using the exact same machine, web
server, configuration, etc.



[2003-05-28 19:50:31] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


This issue has come up over and over again. It's NOT a bug.
You've just installed PHP improperly. Ask further support
questions on the appropriate mailing list.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23861

-- 
Edit this bug report at http://bugs.php.net/?id=23861&edit=1



#23861 [Com]: php_gd2.dll - The Specified procedure cannot be found

2003-06-12 Thread iridium at beyondunreal dot com
 ID:   23861
 Comment by:   iridium at beyondunreal dot com
 Reported By:  steve at enerds dot ca
 Status:   Bogus
 Bug Type: Dynamic loading
 Operating System: Windows
 PHP Version:  4.3.2RC4
 New Comment:

I am getting this bug as well, I am aware this one has been declared
bogus, but I am curious.

I have found that php_gd2.dll and php_sockets.dll will not load at all
in the latest version of PHP (4.3.2), but if I take the modules from
PHP 4.3.0, they will both load using PHP 4.3.2.

I have made sure these are the only copies avaliable in the path, and I
have tried as many locations to put these DLLs as you care to think of,
but they still won't load.

Since the problem only seems to occour when I try to use the latest
DLLs, doens't that mean something is wrong with the DLLs? 

To my knowledge, I have followed the install instructions quite
carefully, and I am certain that all of the relevent (PHP) DLLs have
been updated on my system to version 4.3.2. I have spent quite a while
puzzling over this.

I'm running Apache 1.3.7 and PHP 4.3.2 on Windows XP Pro Sp1.

A friend of mine found that PHP wouldn't load on his system either if
he tried to use the most recent gd2.dll.


Previous Comments:


[2003-05-29 22:45:02] steve at enerds dot ca

*puts head down with sheepish grin*

For some reason or another our sysadmin had a copy of the dll's in
c:\windows and c:\windows\system32.Once I deleted those from
c:\windows and updated those in c:\windows\system32
all was well.

Sorry for the inconvenience, appreciate the support
~Steve



[2003-05-29 20:57:17] steve at enerds dot ca

I am still having the problem with multiple Windows machine, with
different configurations.   In all cases, the gd2.dll loads with php
4.3.1, however when I upgrade to the RC 4.3.2 gd2 cannot load.  

Please advise.
Thanks in advance



[2003-05-28 21:57:53] steve at enerds dot ca

This is *NOT* a configuration problem.   Using 4.3.1, without changing
my configuration file, paths, or anything else (just the appropriate
dll's), it works - gd2 extension loads.   When I change to the 4.3.2
RC4 code, it does not work.  This is using the exact same machine, web
server, configuration, etc.



[2003-05-28 19:50:31] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


This issue has come up over and over again. It's NOT a bug.
You've just installed PHP improperly. Ask further support
questions on the appropriate mailing list.




[2003-05-28 13:48:42] steve at enerds dot ca

OS: Windows XP Professional, Sp1
Web Server: Apache 2.0.45 Win 32


In trying the new 4.3.2 RC4, I am trying to load the gd2 library
without success.  When I modify my php.ini and un-comment the line:

extension=php_gd2.dll

I get the following error.  

Unknown(): Unable to load dynamic library
'c:\php\extensions\php_gd2.dll' - The specified procedure cannot be
found

The dll does exist at that path, and I have verified it is actually
being able to find it.   In changing the dll name to php_test.dll  the
error message changes to the appropriate:

"The specified module cannot be found"


Regards,

~Steve




-- 
Edit this bug report at http://bugs.php.net/?id=23861&edit=1