Skip to content

Commit b9b239d

Browse files
committed
Merge branch 'master' of github.com:swoole/swoole-src
2 parents 29be16f + 78a86c8 commit b9b239d

File tree

4 files changed

+49
-23
lines changed

4 files changed

+49
-23
lines changed

.github/ISSUE-CN.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
# 需知
77

8-
当你觉得发现了一个Swoole内核的bug时, 请提出报告.
8+
当你觉得发现了一个Swoole内核的BUG时, 请提出报告.
99
Swoole的内核开发者们或许还不知道问题的存在,
1010
除非你主动提出报告, 否则BUG也许将很难被发现并修复,
1111
你可以在[Github的issue区](https://github.com/swoole/swoole-src/issues)提出错误报告(即点击右上角绿色的`New issue`按钮), 这里的错误报告将会被最优先解决.
12-
请不要在邮件列表或私人信件中发送错误报告, Github的issue区同样可以提出对于Swoole的任何要求与建议.
12+
请不要在邮件列表或私人信件中发送错误报告, GitHub的issue区同样可以提出对于Swoole的任何要求与建议.
1313

1414
在你提交错误报告之前, 请先阅读以下的**如何提交错误报告**.
1515

@@ -42,6 +42,16 @@ Please answer these questions before submitting your issue. Thanks!
4242

4343
其中, 最为关键的是提供**可稳定重现的简单脚本代码**, 否则你必须提供尽可能多的其它信息来帮助开发者判断错误原因
4444

45+
## 内存分析 (强烈推荐)
46+
47+
更多时候, Valgrind比gdb更能发现内存问题, 通过以下指令运行你的程序, 直到触发BUG
48+
49+
```shell
50+
USE_ZEND_ALLOC=0 valgrind --log-file=/tmp/valgrind.log php xxx.php
51+
```
52+
53+
* 当程序发生错误时, 可以通过键入 `ctrl+c` 退出, 然后上传 `/tmp/valgrind.log` 文件以便于开发组定位BUG.
54+
4555
## 关于段错误(核心转储)
4656

4757
此外, 在一种特殊情况下你可以使用调试工具来帮助开发者定位问题
@@ -77,13 +87,3 @@ gdb php /tmp/core.4596
7787
```
7888

7989
将以上信息都贴在issue中
80-
81-
#### 内存分析 (强烈推荐)
82-
83-
更多时候, Valgrind比gdb更能发现内存问题, 通过以下指令运行你的程序, 直到触发BUG
84-
85-
```shell
86-
USE_ZEND_ALLOC=0 valgrind --log-file=/tmp/valgrind.log php xxx.php
87-
```
88-
89-
* 当程序发生错误时, 可以通过键入 `ctrl+c` 退出, 然后上传 `/tmp/valgrind.log` 文件以便于开发组定位BUG.

.github/ISSUE.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ Please answer these questions before submitting your issue. Thanks!
2727
```
2828
The most important thing is to provide a simple script for reproducing the error, otherwise, you must provide as much information as possible.
2929

30+
## Memory detection (recommended)
31+
32+
In addition to using `gdb` analysis, you can use the `valgrind` tool to check if the program is working properly.
33+
34+
```shell
35+
USE_ZEND_ALLOC=0 valgrind --log-file=/tmp/valgrind.log php xxx.php
36+
```
37+
38+
* After the program is executed to the wrong location, `ctrl+c` is interrupted, and upload the `/tmp/valgrind.log` file.
39+
3040
## CoreDump
3141

3242
Besides, In a special case, you can use debugging tools to help developers locate problems
@@ -60,16 +70,7 @@ Use the f command in gdb to view the code segment corresponding to the ID.
6070
```
6171

6272
If there is no function call stack information, it may be that the compiler has removed the debug information. Please manually modify the `Makefile` file in the swoole source directory and modify CFLAGS to
63-
```shell
64-
CFLAGS = -Wall -pthread -g -O0
65-
```
66-
67-
#### Memory detection (recommended)
68-
69-
In addition to using `gdb` analysis, you can use the `valgrind` tool to check if the program is working properly.
7073

7174
```shell
72-
USE_ZEND_ALLOC=0 valgrind --log-file=/tmp/valgrind.log php xxx.php
75+
CFLAGS = -Wall -pthread -g -O0
7376
```
74-
75-
* After the program is executed to the wrong location, `ctrl+c` is interrupted, and upload the `/tmp/valgrind.log` file.

ext-src/swoole_event.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,10 @@ static PHP_FUNCTION(swoole_event_rshutdown) {
735735
if (!sw_reactor()) {
736736
return;
737737
}
738-
php_swoole_fatal_error(E_DEPRECATED, "Event::wait() in shutdown function is deprecated");
738+
// when throw Exception, do not show the info
739+
if (!sw_reactor()->bailout) {
740+
php_swoole_fatal_error(E_DEPRECATED, "Event::wait() in shutdown function is deprecated");
741+
}
739742
php_swoole_event_wait();
740743
}
741744
zend_end_try();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
swoole_event: deprecated_event_wait
3+
--SKIPIF--
4+
<?php
5+
6+
use SebastianBergmann\CodeCoverage\Report\PHP;
7+
8+
use function Swoole\Coroutine\run;
9+
10+
require __DIR__ . '/../include/skipif.inc'; ?>
11+
--FILE--
12+
<?php
13+
require __DIR__ . '/../include/bootstrap.php';
14+
15+
error_reporting(E_ALL & E_DEPRECATED);
16+
17+
run(function () {
18+
throw new Exception("Error Processing Request", 1);
19+
});
20+
21+
?>
22+
--EXPECT--

0 commit comments

Comments
 (0)