[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29943&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29943 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 28/Sep/16 23:05 Start Date: 28/Sep/16 23:05 Worklog Time Spent: 10m Work Description: Github user zwoop commented on the issue: https://github.com/apache/trafficserver/pull/1025 Should we land this? Issue Time Tracking --- Worklog Id: (was: 29943) Time Spent: 2h (was: 1h 50m) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.1.0 > > Time Spent: 2h > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29218&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29218 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 22:12 Start Date: 15/Sep/16 22:12 Worklog Time Spent: 10m Work Description: Github user jpeach closed the pull request at: https://github.com/apache/trafficserver/pull/1025 Issue Time Tracking --- Worklog Id: (was: 29218) Time Spent: 1h 50m (was: 1h 40m) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.1.0 > > Time Spent: 1h 50m > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29217&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29217 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 22:00 Start Date: 15/Sep/16 22:00 Worklog Time Spent: 10m Work Description: Github user PSUdaemon commented on the issue: https://github.com/apache/trafficserver/pull/1025 Ran clang-analyzer locally: > scan-build: No bugs found. Issue Time Tracking --- Worklog Id: (was: 29217) Time Spent: 1h 40m (was: 1.5h) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 1h 40m > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29208&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29208 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 21:19 Start Date: 15/Sep/16 21:19 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/1025 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/714/ for details. Issue Time Tracking --- Worklog Id: (was: 29208) Time Spent: 1.5h (was: 1h 20m) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 1.5h > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29207&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29207 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 21:16 Start Date: 15/Sep/16 21:16 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/1025 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/818/ for details. Issue Time Tracking --- Worklog Id: (was: 29207) Time Spent: 1h 20m (was: 1h 10m) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 1h 20m > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29205&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29205 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 21:04 Start Date: 15/Sep/16 21:04 Worklog Time Spent: 10m Work Description: Github user PSUdaemon commented on the issue: https://github.com/apache/trafficserver/pull/1025 [approve ci] Issue Time Tracking --- Worklog Id: (was: 29205) Time Spent: 1h 10m (was: 1h) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 1h 10m > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29193&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29193 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 19:36 Start Date: 15/Sep/16 19:36 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/1025 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/816/ for details. Issue Time Tracking --- Worklog Id: (was: 29193) Time Spent: 1h (was: 50m) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 1h > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29183&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29183 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 19:29 Start Date: 15/Sep/16 19:29 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/1025 Linux build *failed*! See https://ci.trafficserver.apache.org/job/Github-Linux/712/ for details. Issue Time Tracking --- Worklog Id: (was: 29183) Time Spent: 50m (was: 40m) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 50m > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29179&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29179 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 19:20 Start Date: 15/Sep/16 19:20 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/1025 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/711/ for details. Issue Time Tracking --- Worklog Id: (was: 29179) Time Spent: 40m (was: 0.5h) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 40m > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29178&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29178 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 19:19 Start Date: 15/Sep/16 19:19 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/1025 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/815/ for details. Issue Time Tracking --- Worklog Id: (was: 29178) Time Spent: 0.5h (was: 20m) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 0.5h > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29177&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29177 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 19:18 Start Date: 15/Sep/16 19:18 Worklog Time Spent: 10m Work Description: Github user PSUdaemon commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/1025#discussion_r79040648 --- Diff: proxy/logging/LogObject.cc --- @@ -354,6 +354,38 @@ LogObject::display(FILE *fd) fprintf(fd, "\n"); } +static head_p +increment_pointer_version(volatile head_p *dst) +{ + head_p h; + head_p new_h; + + do { +INK_QUEUE_LD(h, *dst); +SET_FREELIST_POINTER_VERSION(new_h, FREELIST_POINTER(h), FREELIST_VERSION(h) + 1); + } while (ink_atomic_cas(&dst->data, h.data, new_h.data) == false); + + return h; +} + +static bool +write_pointer_value(volatile head_p *dst, head_p old_h, void *ptr) +{ + head_p tmp_h; + + SET_FREELIST_POINTER_VERSION(tmp_h, ptr, 0); + return ink_atomic_cas(&dst->data, old_h.data, tmp_h.data); +} + +static bool +write_pointer_value_vers(volatile head_p *dst, head_p old_h, void *ptr, head_p::version_type vers) +{ + head_p tmp_h; + + SET_FREELIST_POINTER_VERSION(tmp_h, ptr, vers); + return ink_atomic_cas(&dst->data, old_h.data, tmp_h.data); +} --- End diff -- Can these two functions be merged? Seems like `write_pointer_value` can just call `write_pointer_value_vers` with `0` for the version? Issue Time Tracking --- Worklog Id: (was: 29177) Time Spent: 20m (was: 10m) > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 20m > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4872) clang-analyzer: Memory leak LogObject.cc _checkout_write
[ https://issues.apache.org/jira/browse/TS-4872?focusedWorklogId=29171&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29171 ] ASF GitHub Bot logged work on TS-4872: -- Author: ASF GitHub Bot Created on: 15/Sep/16 19:03 Start Date: 15/Sep/16 19:03 Worklog Time Spent: 10m Work Description: GitHub user jpeach opened a pull request: https://github.com/apache/trafficserver/pull/1025 TS-4872: Fix clang-analyzer leak error on LogObject.cc _checkout_write. We could not quite figure out why it reports this (smells almost like a bug in clang-analyzer), but some refactoring that avoids the warning, and cleans up the code overall. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jpeach/trafficserver fix/4872 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/trafficserver/pull/1025.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 #1025 Issue Time Tracking --- Worklog Id: (was: 29171) Time Spent: 10m Remaining Estimate: 0h > clang-analyzer: Memory leak LogObject.cc _checkout_write > > > Key: TS-4872 > URL: https://issues.apache.org/jira/browse/TS-4872 > Project: Traffic Server > Issue Type: Bug > Components: Core >Reporter: Leif Hedstrom >Assignee: James Peach > Labels: clang-analyzer > Fix For: 7.0.0 > > Time Spent: 10m > Remaining Estimate: 0h > > We could not quite figure out why it reports this (smells almost like a bug > in clang-analyzer), but [~jpe...@apache.org] has a refactoring that avoids > the warning, and cleans up the code overall. -- This message was sent by Atlassian JIRA (v6.3.4#6332)