You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by jacksontj <gi...@git.apache.org> on 2016/10/14 00:24:50 UTC

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

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 <ja...@gmail.com>
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1108: TS-4970: Crash in INKVConnInternal when handle_ev...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1108
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1008/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by jacksontj <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by igalic <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1108: TS-4970: Crash in INKVConnInternal when handle_ev...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1108
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/928/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by shinrich <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1108: TS-4970: Crash in INKVConnInternal when handle_ev...

Posted by jacksontj <gi...@git.apache.org>.
Github user jacksontj commented on the issue:

    https://github.com/apache/trafficserver/pull/1108
  
    Closing the PR-- as we'll take care of this in Jira.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1108: TS-4970: Crash in INKVConnInternal when handle_ev...

Posted by jacksontj <gi...@git.apache.org>.
Github user jacksontj commented on the issue:

    https://github.com/apache/trafficserver/pull/1108
  
    @jpeach The issue is that an event shows up after the object was destroyed() the destroy() mechanism sets the deleted flag-- previously what was happening is that if an event showed up after it was `destroy()`d then it would attempt to re-destroy it. This change is simply to not re-destroy it, but rather do nothing.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1108: TS-4970: Crash in INKVConnInternal when handle_ev...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the issue:

    https://github.com/apache/trafficserver/pull/1108
  
    Wait, this it for 5.2.x?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1108: TS-4970: Crash in INKVConnInternal when handle_ev...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1108
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/900/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by jacksontj <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1108: TS-4970: Crash in INKVConnInternal when handle_ev...

Posted by jacksontj <gi...@git.apache.org>.
Github user jacksontj commented on the issue:

    https://github.com/apache/trafficserver/pull/1108
  
    @jpeach yes, although since 5.2.x drops support in the next month-- its probably not work backporting to the 5.2.x branch-- there is another PR for 6.2.x.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1108: TS-4970: Crash in INKVConnInternal when handle_ev...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1108
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1036/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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

Posted by jacksontj <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---