summaryrefslogtreecommitdiffstats
path: root/xdebug-upstream.patch
blob: f319af3d572ce120bced58af458d69ee64fb783a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
From a55460a63144ba32d3817c1e70a091a579c44478 Mon Sep 17 00:00:00 2001
From: Derick Rethans <github@derickrethans.nl>
Date: Sun, 23 Nov 2014 17:53:30 +0000
Subject: [PATCH] Fixed bug #1087: zend_execute_script or zend_eval_string in
 RINIT segfaults.

---
 xdebug.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xdebug.c b/xdebug.c
index 8bd4f61..1b3517c 100644
--- a/xdebug.c
+++ b/xdebug.c
@@ -1588,7 +1588,9 @@ void xdebug_execute_internal(zend_execute_data *current_execute_data, struct _ze
 		}
 	}
 
-	xdebug_llist_remove(XG(stack), XDEBUG_LLIST_TAIL(XG(stack)), xdebug_stack_element_dtor);
+	if (XG(stack)) {
+		xdebug_llist_remove(XG(stack), XDEBUG_LLIST_TAIL(XG(stack)), xdebug_stack_element_dtor);
+	}
 	XG(level)--;
 }
 
From dcb38d5053e9df32506aeabc8eb09d8370e5641f Mon Sep 17 00:00:00 2001
From: Derick Rethans <github@derickrethans.nl>
Date: Sun, 23 Nov 2014 22:51:43 +0000
Subject: [PATCH] Fixed segfaults with ZTS on PHP 5.6

Find through Travis, it's already being useful!
---
 xdebug.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xdebug.c b/xdebug.c
index 1b3517c..b8c9d5a 100644
--- a/xdebug.c
+++ b/xdebug.c
@@ -314,6 +314,8 @@ static void php_xdebug_init_globals (zend_xdebug_globals *xg TSRMLS_DC)
 	xg->output_is_tty        = OUTPUT_NOT_CHECKED;
 	xg->stdout_mode          = 0;
 	xg->in_at                = 0;
+	xg->active_execute_data  = NULL;
+	xg->active_op_array      = NULL;
 
 	xdebug_llist_init(&xg->server, xdebug_superglobals_dump_dtor);
 	xdebug_llist_init(&xg->get, xdebug_superglobals_dump_dtor);
From 693cfae8345fd1554a15a933c5aaa26e5c70cb93 Mon Sep 17 00:00:00 2001
From: Derick Rethans <github@derickrethans.nl>
Date: Wed, 3 Dec 2014 12:36:10 +0000
Subject: [PATCH] Running scripts in RINIT is really not a good idea guys!

---
 xdebug.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/xdebug.c b/xdebug.c
index 3c1340c..8867507 100644
--- a/xdebug.c
+++ b/xdebug.c
@@ -316,6 +316,18 @@ static void php_xdebug_init_globals (zend_xdebug_globals *xg TSRMLS_DC)
 	xg->in_at                = 0;
 	xg->active_execute_data  = NULL;
 	xg->active_op_array      = NULL;
+	xg->no_exec              = 0;
+	xg->context.program_name = NULL;
+	xg->context.list.last_file = NULL;
+	xg->context.list.last_line = 0;
+	xg->context.do_break     = 0;
+	xg->context.do_step      = 0;
+	xg->context.do_next      = 0;
+	xg->context.do_finish    = 0;
+	xg->in_execution         = 0;
+	xg->remote_enabled       = 0;
+	xg->breakpoints_allowed  = 0;
+	xg->profiler_enabled     = 0;
 
 	xdebug_llist_init(&xg->server, xdebug_superglobals_dump_dtor);
 	xdebug_llist_init(&xg->get, xdebug_superglobals_dump_dtor);
@@ -1392,7 +1404,7 @@ void xdebug_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
 #endif
 	fse->This = EG(This);
 
-	if (XG(remote_enabled) || XG(collect_vars) || XG(show_local_vars)) {
+	if (XG(stack) && (XG(remote_enabled) || XG(collect_vars) || XG(show_local_vars))) {
 		/* Because include/require is treated as a stack level, we have to add used
 		 * variables in include/required files to all the stack levels above, until
 		 * we hit a function or the top level stack.  This is so that the variables