setproctitle php,setproctitle

这篇博客指出PHP的一个扩展存在bug,可能导致内存腐败问题。特别是在Linux操作系统中,由于扩展对argv[0]大小的错误假设,可能会覆盖argv[1]、argv[2]等,从而对运行中的程序造成破坏性影响。建议谨慎使用。
摘要由CSDN通过智能技术生成

[#2]

zodbd421 at gmail dot com [2013-04-21 05:16:02]

Note that this extension is considered buggy.  See https://wiki.php.net/rfc/cli_process_title, which says:

"...but it is incomplete and might lead to memory corruption on Linux (or any OS which does not support setproctitle.

The reason is the extension only has access to original argv[0] (that comes from main()). argv and environ(7) are in contiguous memory space on Linux. The extension presumes that argv[0] can accomodate 128 characters, but usually that is not possible because argv[0] is ??php??. When this happens, the extension will scribble on argv[1], argv[2], etc., and maybe even environ and this can have destructive side effects on the running program."

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值