This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
int main(int argc, char **argv) | |
{ | |
if (argc != 3) { | |
printf("Usage: allocate <1:ftruncate, 2:fallocate> <size> \n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pool1=pool_1 | |
pool2=pool_2 | |
port1=8031 | |
port2=8032 | |
nbport1=0 | |
nbport2=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env php | |
<?php | |
if ($argc != 2) { | |
exit(sprintf("Usage : %s <pid>\n", $argv[0])); | |
} | |
if (!file_exists("/proc/1/status")) { | |
exit("/proc/1/status does not exist, what OS are you running ?\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$p = proc_open("/bin/nc -l -p 11111", array (STDIN, array("pipe", "w"), array("file", "/dev/null", 'w')), $pipes); | |
while (1) { | |
$read = array($pipes[1]); | |
$write = $except = null; | |
stream_select($read, $write, $except, 2); | |
echo fgets($pipes[1]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- libmysql in store result mode ---- | |
206 1,035,035,700 24,367,728 24,177,686 190,042 0 | |
99.22% (24,177,686B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc. | |
->88.15% (21,479,147B) 0x52DD010: my_malloc (my_malloc.c:37) | |
| ->88.04% (21,452,640B) 0x52E0583: alloc_root (my_alloc.c:219) | |
| | ->44.60% (10,869,120B) 0x5307A1F: cli_read_rows (client.c:1416) | |
| | | ->44.60% (10,869,120B) 0x5305955: mysql_store_result (client.c:2957) | |
| | | | ->44.60% (10,869,120B) 0x53EF09: zif_mysqli_query (mysqli_nonapi.c:540) | |
| | | | ->44.60% (10,869,120B) 0x70186A: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:320) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ComutoMysqli extends Mysqli | |
{ | |
public function __destruct() | |
{ | |
$stats = $this->get_connection_stats(); | |
$this->close(); | |
if($diff = $stats["rows_fetched_from_server_normal"] - ($stats["rows_fetched_from_client_normal_unbuffered"] + $stats["rows_fetched_from_client_normal_buffered"])) { | |
trigger_error("You didn't use *$diff* selected results, that's wasted!", E_USER_NOTICE); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julien@lapjpauli:/tmp$ valgrind /home/julien/php53mysqlnd/bin/php -dmemory_limit=-1 /home/julien/www/mysqlnd_POC/poc_mysqlnd.php 1000 | |
initial memory ->86480 kB | |
resultSet stored ->229632 kB | |
query result saved ->234016 kB | |
query result freed ->234016 kB | |
resultSet freed ->134816 kB | |
Db closed ->134816 kB | |
==32226== | |
==32226== HEAP SUMMARY: | |
==32226== in use at exit: 0 bytes in 0 blocks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> strace php -r '@unlink("foo.bar");' 2>&1|grep 'foo.bar' | |
execve("/usr/bin/php", ["php", "-r", "@unlink(\"foo.bar\");"], [/* 17 vars */]) = 0 | |
unlink("foo.bar") = -1 ENOENT (No such file or directory) | |
$> strace php -d open_basedir="./" -r '@unlink("foo.bar");' 2>&1|grep 'foo.bar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct _hashtable { | |
uint nTableSize; | |
uint nTableMask; | |
uint nNumOfElements; | |
zend_bool persistent; | |
unsigned char nApplyCount; | |
zend_bool bApplyProtection; | |
ulong nNextFreeElement; | |
Bucket *pInternalPointer; /* Used for element traversal */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/xdebug_var.c b/xdebug_var.c | |
index a59c4f5..c92d114 100644 | |
diff --git a/xdebug_var.c b/xdebug_var.c | |
index a59c4f5..c92d114 100644 | |
--- a/xdebug_var.c | |
+++ b/xdebug_var.c | |
@@ -434,6 +434,7 @@ void xdebug_var_export(zval **struc, xdebug_str *str, int level, int debug_zval, | |
case IS_OBJECT: | |
myht = Z_OBJPROP_PP(struc); |
OlderNewer