Comments (13)
这个看起来很奇怪, 代码很简单:
if (*(Z_STRVAL_PP(ppzval) + Z_STRLEN_PP(ppzval) - 1) == DEFAULT_SLASH) {
YAF_G(directory) = estrndup(Z_STRVAL_PP(ppzval), Z_STRLEN_PP(ppzval) - 1); <= 说这行呢
} else {
YAF_G(directory) = estrndup(Z_STRVAL_PP(ppzval), Z_STRLEN_PP(ppzval));
}
你的配置里面application.directory是个啥?
from yaf.
application.directory 写 application 的目录,是绝对地址。
而且是这个情况不是每次请求都会发生的,是fpm运行一段时间后会出现这个情况。
from yaf.
你们的PHP是什么版本? 奇怪了, 这个代码看起来不会有问题啊. 是不是你的二进制文件搞错了, bt显示的不对?
from yaf.
php版本是5.3.10 php5-fpm,ubuntu 12.04 apt-get下来的。应该不会搞错,我是直接在报错的机器上gdb的。
我在怀疑会不会是内存泄漏,php.ini 的 memory_limit 是512M。超过限制。然后就estrndup失败了?
我简单跟了下代码,貌似这一条刚好是请求中第一个申请内存的。
from yaf.
鸟哥,在yaf_application还是在yaf_ dispatcher中之前的确有内存泄露,我找不到之前跟你的聊天记录了
from yaf.
如果estrndup失败, PHP会直接退出的, 不会core的
from yaf.
你gdb看看, 能不能打印出来ppzval的具体内容是啥
from yaf.
(gdb) bt
#0 0x00007f5c6c72b8c9 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x000000000067c2e6 in _estrndup ()
#2 0x00007f5c61d2d235 in yaf_application_parse_option (options=) at /tmp/pear/temp/yaf/yaf_application.c:143
#3 zim_yaf_application___construct (ht=, return_value=0x1aca368, return_value_ptr=, this_ptr=0x1ac6ff0, return_value_used=)
at /tmp/pear/temp/yaf/yaf_application.c:358
#4 0x000000000070f05d in ?? ()
#5 0x00000000006bfbcb in execute ()
#6 0x000000000069b130 in zend_execute_scripts ()
#7 0x00000000006477a3 in php_execute_script ()
#8 0x000000000042b895 in ?? ()
#9 0x00007f5c6c60376d in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#10 0x000000000042c0f5 in _start ()
(gdb) up
#1 0x000000000067c2e6 in _estrndup ()
(gdb) up
#2 0x00007f5c61d2d235 in yaf_application_parse_option (options=) at /tmp/pear/temp/yaf/yaf_application.c:143
143 /tmp/pear/temp/yaf/yaf_application.c: No such file or directory.
(gdb) info locals
conf = 0x1aca1a8
ppzval = 0x1aca138
ppsval =
app = 0x1ac74e8
(gdb) p ppzval
$1 = (zval **) 0x1aca138
(gdb) x/2s 0x1aca138
0x1aca138: "\240o\254\001"
0x1aca13d: ""
这样子么?
from yaf.
恩, 然后你再p **ppzval 看看
thanks
from yaf.
(gdb) p **ppzval
$2 = {value = {lval = 28078616, dval = 1.3872679548368359e-316, str = {val = 0x1ac7218 "", len = 0}, ht = 0x1ac7218, obj = {handle = 28078616, handlers = 0x0}},
refcount__gc = 1, type = 6 '\006', is_ref__gc = 0 '\000'}
from yaf.
哦,最后 len 负一了 0.0
from yaf.
找到代码了。有这样的调用 new Yaf_Application(array("application" => array("directory"=>""))); THX 鸟哥。
from yaf.
holy shit....这个bug不应该...修复之...
from yaf.
Related Issues (20)
- Request::setControllerName 第二个参数format==false时 设置失败 HOT 1
- Yaf_Registry::set 的第二个参数为什么注释为 string 类型 HOT 1
- yaf model 的问题 HOT 2
- 开启公用类库后,无法使用composer HOT 2
- 偶发性问题Uncaught Error: Call to a member function run() on bool in ....../public/index.php HOT 1
- 希望鸟哥能增加一个配置用于控制是否开启默认路由. HOT 1
- yaf routing with namespace is on option HOT 4
- Fatal error: Class 'Yaf' not found HOT 2
- PHP8.2下 安装yaf-3.3.5报错 HOT 5
- Yaf_Config_Ini 造成 Too many open files 问题 HOT 3
- 使用了__get魔术方法后,当action不存在的时候,php进程会被直接终止,无法捕获错误。 HOT 4
- 支持phpstorm的代码查找
- v3.3.5 Yaf_View_Simple __isset bug
- fpm进程中存在多个application.ini文件句柄 HOT 3
- Error: Failed opening controller script
- PHP8.3 install yaf-3.3.5、yaf-3.3.4 extenstion error:make: *** [Makefile:209: yaf.lo] Error 1 HOT 2
- README.md contains outdated references to Travis CI service
- php-ext
- 使用 Yaf_Request_Http 对象的 getRequest(), getPost(), getQuery() 3个方法获取单个参数时候会导致程序中断
- 能否写个php 多线程处理的扩展啊。现在并发需求多。用户访问量大。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yaf.