Forum: Building VoltDB Applications

Post: Problem using PHP driver in Linux

Problem using PHP driver in Linux
hchen
Dec 5, 2012
I followed the instruction to install voltdb-client-php-extension-2.8 on my mac laptop, everything works fine. However, I did have problem when I install on linux, I always see errors like below. Appreciate for any help and comments.

Thanks

Here are some system info.
PHP Version => 5.3.10-1ubuntu3.4
System => Linux analytics-stage03 3.2.0-32-generic #51-Ubuntu SMP x86_64

*** glibc detected *** php: munmap_chunk(): invalid pointer: 0x000000000141f560 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f42e8a51b96]
/usr/lib/php5/libexec/voltdb.so(_ZN6voltdb18InvocationResponseC1EN5boost12shared_arrayIcEEi+0x7c9)[0x7f42e7f8c829]
/usr/lib/php5/libexec/voltdb.so(_ZN6voltdb10ClientImpl19regularReadCallbackEP11bufferevent+0x269)[0x7f42e7f85d39]
/usr/lib/php5/libexec/voltdb.so(+0x43ab2)[0x7f42e7fa5ab2]
/usr/lib/php5/libexec/voltdb.so(event_base_loop+0x50d)[0x7f42e7f9d9cd]
/usr/lib/php5/libexec/voltdb.so(_ZN6voltdb10ClientImpl6invokeERiRNS_9ProcedureE+0xa9d)[0x7f42e7f8864d]
/usr/lib/php5/libexec/voltdb.so(_ZN6voltdb6Client6invokeERiRNS_9ProcedureE+0x11)[0x7f42e7f83811]
/usr/lib/php5/libexec/voltdb.so(_Z21zim_VoltClient_invokeiP12_zval_structPS0_S0_i+0x73)[0x7f42e7f7a8f3]
php[0x70f7fd]
php(execute+0x1fb)[0x6c036b]
php(zend_execute_scripts+0x130)[0x69b8d0]
php(php_execute_script+0x1d3)[0x647f43]
php[0x42c797]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f42e89f476d]
php[0x42c7e5]
======= Memory map: ========
00400000-00b48000 r-xp 00000000 08:06 52434183 /usr/bin/php5
00d47000-00dad000 r--p 00747000 08:06 52434183 /usr/bin/php5
00dad000-00db9000 rw-p 007ad000 08:06 52434183 /usr/bin/php5
00db9000-00dd5000 rw-p 00000000 00:00 0
011c8000-0143c000 rw-p 00000000 00:00 0 [heap]
7f42e0000000-7f42e0021000 rw-p 00000000 00:00 0
7f42e0021000-7f42e4000000 ---p 00000000 00:00 0
7f42e5e80000-7f42e5e87000 r-xp 00000000 08:06 53481029 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7f42e5e87000-7f42e6086000 ---p 00007000 08:06 53481029 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7f42e6086000-7f42e6087000 r--p 00006000 08:06 53481029 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7f42e6087000-7f42e6088000 rw-p 00007000 08:06 53481029 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7f42e6088000-7f42e6089000 ---p 00000000 00:00 0
7f42e6089000-7f42e6889000 rw-p 00000000 00:00 0
7f42e6889000-7f42e6895000 r-xp 00000000 08:06 53481022 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f42e6895000-7f42e6a94000 ---p 0000c000 08:06 53481022 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f42e6a94000-7f42e6a95000 r--p 0000b000 08:06 53481022 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f42e6a95000-7f42e6a96000 rw-p 0000c000 08:06 53481022 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f42e6a96000-7f42e6a9d000 r-xp 00000000 08:06 52827502 /usr/lib/php5/20090626/pdo_mysql.so
7f42e6a9d000-7f42e6c9c000 ---p 00007000 08:06 52827502 /usr/lib/php5/20090626/pdo_mysql.so
7f42e6c9c000-7f42e6c9d000 r--p 00006000 08:06 52827502 /usr/lib/php5/20090626/pdo_mysql.so
7f42e6c9d000-7f42e6c9e000 rw-p 00007000 08:06 52827502 /usr/lib/php5/20090626/pdo_mysql.so
7f42e6c9e000-7f42e6cb4000 r-xp 00000000 08:06 52823897 /usr/lib/php5/20090626/pdo.so
7f42e6cb4000-7f42e6eb4000 ---p 00016000 08:06 52823897 /usr/lib/php5/20090626/pdo.so
7f42e6eb4000-7f42e6eb7000 r--p 00016000 08:06 52823897 /usr/lib/php5/20090626/pdo.so
7f42e6eb7000-7f42e6eb8000 rw-p 00019000 08:06 52823897 /usr/lib/php5/20090626/pdo.so
7f42e6eb8000-7f42e6ed4000 r-xp 00000000 08:06 52827503 /usr/lib/php5/20090626/mysqli.so
7f42e6ed4000-7f42e70d4000 ---p 0001c000 08:06 52827503 /usr/lib/php5/20090626/mysqli.so
7f42e70d4000-7f42e70d9000 r--p 0001c000 08:06 52827503 /usr/lib/php5/20090626/mysqli.so
7f42e70d9000-7f42e70da000 rw-p 00021000 08:06 52827503 /usr/lib/php5/20090626/mysqli.so
7f42e70da000-7f42e73ac000 r-xp 00000000 08:06 52433091 /usr/lib/libmysqlclient.so.18.0.0
7f42e73ac000-7f42e75ac000 ---p 002d2000 08:06 52433091 /usr/lib/libmysqlclient.so.18.0.0
7f42e75ac000-7f42e75b1000 r--p 002d2000 08:06 52433091 /usr/lib/libmysqlclient.so.18.0.0
7f42e75b1000-7f42e7631000 rw-p 002d7000 08:06 52433091 /usr/lib/libmysqlclient.so.18.0.0
7f42e7631000-7f42e7636000 rw-p 00000000 00:00 0
7f42e7636000-7f42e7641000 r-xp 00000000 08:06 52827504 /usr/lib/php5/20090626/mysql.so
7f42e7641000-7f42e7841000 ---p 0000b000 08:06 52827504 /usr/lib/php5/20090626/mysql.so
7f42e7841000-7f42e7843000 r--p 0000b000 08:06 52827504 /usr/lib/php5/20090626/mysql.so
7f42e7843000-7f42e7844000 rw-p 0000d000 08:06 52827504 /usr/lib/php5/20090626/mysql.so
7f42e7844000-7f42e7859000 r-xp 00000000 08:06 53477420 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f42e7859000-7f42e7a58000 ---p 00015000 08:06 53477420 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f42e7a58000-7f42e7a59000 r--p 00014000 08:06 53477420 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f42e7a59000-7f42e7a5a000 rw-p 00015000 08:06 53477420 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f42e7a5a000-7f42e7b3c000 r-xp 00000000 08:06 52433775 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f42e7b3c000-7f42e7d3b000 ---p 000e2000 08:06 52433775 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f42e7d3b000-7f42e7d43000 r--p 000e1000 08:06 52433775 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f42e7d43000-7f42e7d45000 rw-p 000e9000 08:06 52433775 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f42e7d45000-7f42e7d5a000 rw-p 00000000 00:00 0
7f42e7d5a000-7f42e7d61000 r-xp 00000000 08:06 53481016 /lib/x86_64-linux-gnu/librt-2.15.so
7f42e7d61000-7f42e7f60000 ---p 00007000 08:06 53481016 /lib/x86_64-linux-gnu/librt-2.15.so
7f42e7f60000-7f42e7f61000 r--p 00006000 08:06 53481016 /lib/x86_64-linux-gnu/librt-2.15.so
7f42e7f61000-7f42e7f62000 rw-p 00007000 08:06 53481016 /lib/x86_64-linux-gnu/librt-2.15.so
7f42e7f62000-7f42e7fbb000 r-xp 00000000 08:06 52827505 /usr/lib/php5/libexec/voltdb.so
7f42e7fbb000-7f42e81ba000 ---p 00059000 08:06 52827505 /usr/lib/php5/libexec/voltdb.so
7f42e81ba000-7f42e81bc000 r--p 00058000 08:06 52827505 /usr/lib/php5/libexec/voltdb.so
7f42e81bc000-7f42e81bd000 rw-p 0005a000 08:06 52827505 /usr/lib/php5/libexec/voltdb.so
Turn off compiler optimization
nshi
Dec 6, 2012
Hi,

Compiler optimization has to be turned off or PHP will be unhappy on some systems. The error you saw on Linux could be caused by that.

To turn off compiler optimization when compiling the C++ client, please remove "-O3" on line 2 of the makefile in the voltdb-client-cpp directory, and recompile the C++ client followed by recompiling the PHP module.