[
https://issues.apache.org/jira/browse/TS-5096?focusedWorklogId=33555&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-33555
]
ASF GitHub Bot logged work on TS-5096:
--------------------------------------
Author: ASF GitHub Bot
Created on: 14/Dec/16 06:12
Start Date: 14/Dec/16 06:12
Worklog Time Spent: 10m
Work Description: GitHub user jpeach opened a pull request:
https://github.com/apache/trafficserver/pull/1261
TS-5096: Lua metrics crashes if the prefix is missing.
Prevent a traffic_manager crash if someone registers a metric with no
prefix. We can't make that metric available in Lua, but we ough not
to crash.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jpeach/trafficserver TS-5096
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafficserver/pull/1261.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 #1261
----
commit 63dc89511f97b622a1126c8576c274444606a58a
Author: James Peach <[email protected]>
Date: 2016-12-14T06:11:08Z
TS-5096: Lua metrics crashes if the prefix is missing.
Prevent a traffic_manager crash if someone registers a metric with no
prefix. We can't make that metric available in Lua, but we ough not
to crash.
----
Issue Time Tracking
-------------------
Worklog Id: (was: 33555)
Time Spent: 10m
Remaining Estimate: 0h
> Lua metrics crashes if the prefix is missing
> --------------------------------------------
>
> Key: TS-5096
> URL: https://issues.apache.org/jira/browse/TS-5096
> Project: Traffic Server
> Issue Type: Bug
> Components: Lua, Metrics
> Reporter: James Peach
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Using the example from the {{tslua.so}} documentation:
> {noformat}
> local test_stat;
> function __init__(args)
> test_stat = ts.stat_create("test_stat",
> TS_LUA_RECORDDATATYPE_INT,
> TS_LUA_STAT_PERSISTENT,
> TS_LUA_STAT_SYNC_COUNT)
> end
> {noformat}
> {{traffic_manager}} crashes in metrics update:
> {noformat}
> (gdb) where
> #0 0x00007ffff5c964ad in __cxa_throw () from /lib64/libstdc++.so.6
> #1 0x00007ffff5cbfdcf in std::__throw_length_error(char const*) () from
> /lib64/libstdc++.so.6
> #2 0x00007ffff5d2a7ec in std::__cxx11::basic_string<char,
> std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&,
> unsigned long) () from /lib64/libstdc++.so.6
> #3 0x00000000004bbcf4 in std::__cxx11::basic_string<char,
> std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
> (this=0x7fffffffdc10, __beg=0x92ec30 "test_stat", __end=0x0) at
> /usr/include/c++/6.2.1/bits/basic_string.tcc:219
> #4 0x00007ffff5d2d515 in std::__cxx11::basic_string<char,
> std::char_traits<char>, std::allocator<char> >::basic_string(char const*,
> unsigned long, std::allocator<char> const&) () from /lib64/libstdc++.so.6
> #5 0x00000000004bd228 in install_metrics_object (rec_type=RECT_PLUGIN,
> edata=0x7fffffffdcf0, registered=1,
> name=0x92ec30 "test_stat", data_type=1, datum=0x7ffff7f7dc48) at
> metrics.cc:214
> #6 0x00000000004a51a1 in RecDumpRecords (rec_type=46,
> callback=0x4bd1a3 <install_metrics_object(RecT, void*, int, char const*,
> int, RecData*)>, edata=0x7fffffffdcf0)
> at RecCore.cc:1020
> #7 0x00000000004bd2dd in lua_metrics_install (L=0x40000378) at metrics.cc:229
> #8 0x0000000000449209 in update_metrics_namespace (L=0x40000378) at
> metrics.cc:167
> #9 0x0000000000449944 in metrics_binding_evaluate (binding=...) at
> metrics.cc:377
> #10 0x000000000044844d in main (argc=1, argv=0x7fffffffe578) at
> traffic_manager.cc:772
> (gdb)
> #5 0x00000000004bd228 in install_metrics_object (rec_type=RECT_PLUGIN,
> edata=0x7fffffffdcf0, registered=1,
> name=0x92ec30 "test_stat", data_type=1, datum=0x7ffff7f7dc48) at
> metrics.cc:214
> 214 prefixes->insert(std::string(name, len));
> (gdb) p len
> $1 = -9628720
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)