[GitHub] trafficserver pull request #1108: TS-4970: Crash in INKVConnInternal when ha...

2016-10-26 Thread jacksontj
Github user jacksontj closed the pull request at:

https://github.com/apache/trafficserver/pull/1108


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1108: TS-4970: Crash in INKVConnInternal when ha...

2016-10-14 Thread shinrich
Github user shinrich commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1108#discussion_r83480249
  
--- Diff: proxy/InkAPI.cc ---
@@ -1053,15 +1053,14 @@ int
 INKVConnInternal::handle_event(int event, void *edata)
 {
   handle_event_count(event);
-  if (m_deleted) {
-if (m_deletable) {
-  this->mutex = NULL;
-  m_read_vio.set_continuation(NULL);
-  m_write_vio.set_continuation(NULL);
-  INKVConnAllocator.free(this);
-}
-  } else {
+  // If the VConn isn't deleted, call the handler
+  if (!m_deleted) {
 return m_event_func((TSCont) this, (TSEvent) event, edata);
+  } else {
+// if the VConn is deleted, and we are in DEBUG mode-- we should assert
+// because this means that the VConn was cleaned up before all the 
callbacks
+// (timeouts, etc.) where canceled.
+ink_assert("event on deleted INKVConnInternal");
--- End diff --

Yes warnings would be good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1108: TS-4970: Crash in INKVConnInternal when ha...

2016-10-14 Thread jacksontj
Github user jacksontj commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1108#discussion_r83342298
  
--- Diff: proxy/InkAPI.cc ---
@@ -1053,15 +1053,14 @@ int
 INKVConnInternal::handle_event(int event, void *edata)
 {
   handle_event_count(event);
-  if (m_deleted) {
-if (m_deletable) {
-  this->mutex = NULL;
-  m_read_vio.set_continuation(NULL);
-  m_write_vio.set_continuation(NULL);
-  INKVConnAllocator.free(this);
-}
-  } else {
+  // If the VConn isn't deleted, call the handler
+  if (!m_deleted) {
 return m_event_func((TSCont) this, (TSEvent) event, edata);
+  } else {
+// if the VConn is deleted, and we are in DEBUG mode-- we should assert
+// because this means that the VConn was cleaned up before all the 
callbacks
+// (timeouts, etc.) where canceled.
+ink_assert("event on deleted INKVConnInternal");
--- End diff --

I think it might also be worthwhile to put a log line (warning?) here for 
non-debug builds. Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1108: TS-4970: Crash in INKVConnInternal when ha...

2016-10-14 Thread jacksontj
Github user jacksontj commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1108#discussion_r83455610
  
--- Diff: proxy/InkAPI.cc ---
@@ -1053,15 +1053,14 @@ int
 INKVConnInternal::handle_event(int event, void *edata)
 {
   handle_event_count(event);
-  if (m_deleted) {
-if (m_deletable) {
-  this->mutex = NULL;
-  m_read_vio.set_continuation(NULL);
-  m_write_vio.set_continuation(NULL);
-  INKVConnAllocator.free(this);
-}
-  } else {
+  // If the VConn isn't deleted, call the handler
+  if (!m_deleted) {
 return m_event_func((TSCont) this, (TSEvent) event, edata);
+  } else {
--- End diff --

@igalic This handler shouldn't be called after the VConn was destroyed. The 
else exists soely to get the assert in there (for debug builds)-- because if we 
hit that `else` path there is a bug-- but we don't want ATS to crash on it if 
possible.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1108: TS-4970: Crash in INKVConnInternal when ha...

2016-10-14 Thread igalic
Github user igalic commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1108#discussion_r83423846
  
--- Diff: proxy/InkAPI.cc ---
@@ -1053,15 +1053,14 @@ int
 INKVConnInternal::handle_event(int event, void *edata)
 {
   handle_event_count(event);
-  if (m_deleted) {
-if (m_deletable) {
-  this->mutex = NULL;
-  m_read_vio.set_continuation(NULL);
-  m_write_vio.set_continuation(NULL);
-  INKVConnAllocator.free(this);
-}
-  } else {
+  // If the VConn isn't deleted, call the handler
+  if (!m_deleted) {
 return m_event_func((TSCont) this, (TSEvent) event, edata);
+  } else {
--- End diff --

why is this an `else` if we previously `return`ed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1108: TS-4970: Crash in INKVConnInternal when ha...

2016-10-13 Thread jacksontj
GitHub user jacksontj opened a pull request:

https://github.com/apache/trafficserver/pull/1108

TS-4970: Crash in INKVConnInternal when handle_event is called after 
destroy()



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jacksontj/trafficserver TS-4970_ATS5

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafficserver/pull/1108.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1108


commit 1210ad96278ccb29a0614b3234a2ed3743c3f6f6
Author: Thomas Jackson 
Date:   2016-10-14T00:22:42Z

TS-4970: Crash in INKVConnInternal when handle_event is called after 
destroy()




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---