I searched for "mysql_query" and "hangs" and don't see anything related...
Zen cart version: 1.3.8a
(on Dreamhost)
We are using the "Cold Steel" template.
Last night, my wife was setting up some products, and then
we couldn't load "http://www.sumscrapper.com/zencart" at all--
because the first $db->Execute call is hanging forever.
The sql query:
'select configuration_key as cfgkey, configuration_value as cfgvalue from zen_sumscrapper_configuration'
If I do it by hand, I get 545 rows back.
To debug this, I copied the php.ini file to my local dir and run php -c to this modified file. I turn on the error reporting.
On dreamhost, I run:
/usr/local/php5/bin/php -c ~/php.ini -f index.php
in gdb (which I had to download and build and install in my home dir myself), and hit cntrl-C when it hangs; I get this output:
about to get configuration and zen_sumscrapper_configuration
Execute!
Execute: zf_cache2
connected: 1
about to do the mysql query. zf_sql is set to: select configuration_key as cfgkey, configuration_value as cfgvalue
from zen_sumscrapper_configuration
Program received signal SIGINT, Interrupt.
[Switching to Thread 0x2b135f19c2d0 (LWP 4926)]
0x00002b135e2e8182 in __read_nocancel () from /lib/libpthread.so.0
(gdb) where
#0 0x00002b135e2e8182 in __read_nocancel () from /lib/libpthread.so.0
#1 0x00002b135e05b968 in vio_read () from /usr/lib/libmysqlclient.so.15
#2 0x00002b135e05b9c3 in vio_read_buff () from /usr/lib/libmysqlclient.so.15
#3 0x00002b135e05cca5 in ?? () from /usr/lib/libmysqlclient.so.15
#4 0x00002b135e05cf99 in my_net_read () from /usr/lib/libmysqlclient.so.15
#5 0x00002b135e057182 in cli_safe_read () from /usr/lib/libmysqlclient.so.15
#6 0x00002b135e057712 in cli_read_rows () from /usr/lib/libmysqlclient.so.15
#7 0x00002b135e05601e in mysql_store_result () from /usr/lib/libmysqlclient.so.15
#8 0x000000000055b2ff in ?? ()
#9 0x000000000055b708 in ?? ()
#10 0x00002b13635af188 in ?? () from /usr/local/dh/apache/template/phpext/zend_optimizer5/ZendOptimizer.so
#11 0x00002b1363609a91 in ?? () from /usr/local/dh/apache/template/phpext/zend_optimizer5/ZendOptimizer.so
#12 0x00002b1363609d41 in ?? () from /usr/local/dh/apache/template/phpext/zend_optimizer5/ZendOptimizer.so
#13 0x00000000006f0762 in ?? ()
#14 0x00000000006f18a3 in execute ()
#15 0x00002b136360a311 in zend_oe () from /usr/local/dh/apache/template/phpext/zend_optimizer5/ZendOptimizer.so
#16 0x0000000000700fa5 in ?? ()
#17 0x00000000006f18a3 in execute ()
#18 0x00002b136360a311 in zend_oe () from /usr/local/dh/apache/template/phpext/zend_optimizer5/ZendOptimizer.so
#19 0x00000000006f5727 in ?? ()
#20 0x00000000006f18a3 in execute ()
#21 0x00002b136360a311 in zend_oe () from /usr/local/dh/apache/template/phpext/zend_optimizer5/ZendOptimizer.so
#22 0x00000000006f4062 in ?? ()
---Type <return> to continue, or q <return> to quit---
#23 0x00000000006f18a3 in execute ()
#24 0x00002b136360a311 in zend_oe () from /usr/local/dh/apache/template/phpext/zend_optimizer5/ZendOptimizer.so
#25 0x00000000006f4062 in ?? ()
#26 0x00000000006f18a3 in execute ()
#27 0x00002b136360a311 in zend_oe () from /usr/local/dh/apache/template/phpext/zend_optimizer5/ZendOptimizer.so
#28 0x00000000006d3803 in zend_execute_scripts ()
#29 0x0000000000693d98 in php_execute_script ()
#30 0x000000000075082b in main ()
(gdb)
( please ignore the debug output I inserted into
the Execute routine in
includes/classes/db/mysql/query_factory.php
and
includes/init_includes/init_db_config_read.php )
We decided to run the database optimization in the admin pages (which was still running fine)...
AND Everything is OK again. Weird.
Just passing this along so if anyone else sees this, they can
avoid wasting several hours trying to track it down. It looks
like an esoteric problem in the mysql interface!
murf-in-wyoming



