Bug 11220 - arrays can't store MAXSTRINGLEN strings
Summary: arrays can't store MAXSTRINGLEN strings
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: David Smith
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-25 20:16 UTC by David Smith
Modified: 2010-01-25 21:06 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
test script that demonstrates the problem (195 bytes, text/plain)
2010-01-25 20:18 UTC, David Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2010-01-25 20:16:41 UTC
You can store strings in arrays.  However, on x86_64 f12 (kernel
2.6.31.9-174.fc12.x86_64), you can't store strings that are near MAXSTRINGLEN
(512) in size in an array - the strings seem to get truncated at around 256 bytes.
Comment 1 David Smith 2010-01-25 20:18:55 UTC
Created attachment 4555 [details]
test script that demonstrates the problem

Here's the output from the attached test script:

# stap ../string_array.stp
strings *don't* match!
str:   0:123456789+123456789+123456789+123456789+123456789+123456789 
1:123456789+123456789+123456789+123456789+123456789+123456789 
2:123456789+123456789+123456789+123456789+123456789+123456789 
3:123456789+123456789+123456789+123456789+123456789+123456789 
4:123456789+123456789+123456789+123456789+123456789+123456789 
5:123456789+123456789+123456789+123456789+123456789+123456789 
6:123456789+123456789+123456789+123456789+123456789+123456789 
7:123456789+123456789+123456789+123456789+123456789+123456789
string_array[0]:  
0:123456789+123456789+123456789+123456789+123456789+123456789 
1:123456789+123456789+123456789+123456789+123456789+123456789 
2:123456789+123456789+123456789+123456789+123456789+123456789 
3:123456789+123456789+123456789+123456789+123456789+123456789  4
Comment 2 Frank Ch. Eigler 2010-01-25 20:22:30 UTC
This is because runtime/map.h MAP_STRING_LENGTH is not simply MAXSTRINGLEN,
though it should be.
Comment 3 David Smith 2010-01-25 21:06:05 UTC
Fixed in commit 9f49a98.