[
https://issues.apache.org/jira/browse/TS-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14622792#comment-14622792
]
Bryan Call commented on TS-2150:
--------------------------------
Getting overflow error when compiling with asan and running regression:
{code}
[bcall@homer trafficserver]$ sudo /usr/local/bin/traffic_server -R 1
traffic_server: using root directory '/usr/local'
=================================================================
==29966==ERROR: AddressSanitizer: global-buffer-overflow on address
0x000000d98e36 at pc 0x7f50e1c7cbe0 bp 0x7ffeace7e960 sp 0x7ffeace7e108
READ of size 26 at 0x000000d98e36 thread T0
#0 0x7f50e1c7cbdf in memcmp (/lib64/libasan.so.2+0x77bdf)
#1 0x8a75d1 in cmp_str::operator()(ts::ConstBuffer, ts::ConstBuffer) const
/home/bcall/dev/apache/trafficserver/proxy/logging/LogField.cc:123
#2 0x8a75d1 in std::_Rb_tree<ts::ConstBuffer, std::pair<ts::ConstBuffer
const, TSMilestonesType>, std::_Select1st<std::pair<ts::ConstBuffer const,
TSMilestonesType> >, cmp_str, std::allocator<std::pair<ts::ConstBuffer const,
TSMilestonesType> > >::_M_get_insert_unique_pos(ts::ConstBuffer const&)
/usr/include/c++/5.1.1/bits/stl_tree.h:1810
#3 0x8a75d1 in std::pair<std::_Rb_tree_iterator<std::pair<ts::ConstBuffer
const, TSMilestonesType> >, bool> std::_Rb_tree<ts::ConstBuffer,
std::pair<ts::ConstBuffer const, TSMilestonesType>,
std::_Select1st<std::pair<ts::ConstBuffer const, TSMilestonesType> >, cmp_str,
std::allocator<std::pair<ts::ConstBuffer const, TSMilestonesType> >
>::_M_insert_unique<std::pair<ts::ConstBuffer, TSMilestonesType>
>(std::pair<ts::ConstBuffer, TSMilestonesType>&&)
/usr/include/c++/5.1.1/bits/stl_tree.h:1863
#4 0x8a75d1 in std::pair<std::_Rb_tree_iterator<std::pair<ts::ConstBuffer
const, TSMilestonesType> >, bool> std::map<ts::ConstBuffer, TSMilestonesType,
cmp_str, std::allocator<std::pair<ts::ConstBuffer const, TSMilestonesType> >
>::insert<std::pair<ts::ConstBuffer, TSMilestonesType>,
void>(std::pair<ts::ConstBuffer, TSMilestonesType>&&)
/usr/include/c++/5.1.1/bits/stl_map.h:618
#5 0x8a75d1 in LogField::init_milestone_container()
/home/bcall/dev/apache/trafficserver/proxy/logging/LogField.cc:165
#6 0x882624 in Log::init_fields()
/home/bcall/dev/apache/trafficserver/proxy/logging/Log.cc:325
#7 0x885ecf in Log::init_when_enabled()
/home/bcall/dev/apache/trafficserver/proxy/logging/Log.cc:873
#8 0x886b34 in Log::init(int)
/home/bcall/dev/apache/trafficserver/proxy/logging/Log.cc:862
#9 0x495285 in main /home/bcall/dev/apache/trafficserver/proxy/Main.cc:1685
#10 0x7f50dec6378f in __libc_start_main (/lib64/libc.so.6+0x2078f)
#11 0x4a6908 in _start (/usr/local/bin/traffic_server+0x4a6908)
0x000000d98e36 is located 42 bytes to the left of global variable '*.LC89'
defined in 'LogField.cc' (0xd98e60) of size 27
'*.LC89' is ascii string 'TS_MILESTONE_UA_FIRST_READ'
0x000000d98e36 is located 0 bytes to the right of global variable '*.LC88'
defined in 'LogField.cc' (0xd98e20) of size 22
'*.LC88' is ascii string 'TS_MILESTONE_UA_BEGIN'
SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 memcmp
Shadow bytes around the buggy address:
0x0000801ab170: 00 00 00 00 00 07 f9 f9 f9 f9 f9 f9 00 00 01 f9
0x0000801ab180: f9 f9 f9 f9 00 00 01 f9 f9 f9 f9 f9 05 f9 f9 f9
0x0000801ab190: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
0x0000801ab1a0: f9 f9 f9 f9 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
0x0000801ab1b0: f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 00 01 f9 f9
=>0x0000801ab1c0: f9 f9 f9 f9 00 00[06]f9 f9 f9 f9 f9 00 00 00 03
0x0000801ab1d0: f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9
0x0000801ab1e0: 00 00 00 04 f9 f9 f9 f9 00 00 06 f9 f9 f9 f9 f9
0x0000801ab1f0: 00 00 00 00 02 f9 f9 f9 f9 f9 f9 f9 00 00 00 04
0x0000801ab200: f9 f9 f9 f9 00 00 00 00 f9 f9 f9 f9 00 00 00 00
0x0000801ab210: f9 f9 f9 f9 00 00 00 07 f9 f9 f9 f9 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
==29966==ABORTING
{code}
> Add Milestone log tags
> ----------------------
>
> Key: TS-2150
> URL: https://issues.apache.org/jira/browse/TS-2150
> Project: Traffic Server
> Issue Type: New Feature
> Components: Logging
> Reporter: Leif Hedstrom
> Assignee: François Pesce
> Labels: yahoo
> Fix For: 6.1.0
>
>
> We have a notion of milestones in the core, and plugin APIs
> (TSHttpTxnMilestoneGet() ). It'd be useful to expose these milestone timers
> as a log tag, something like:
> {code}
> %<{UA_BEGIN}mtms>
> {code}
> mtms is just an example / suggestion, "MilestoneTimeMilliSecond", we can make
> it whatever we like.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)