-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix data size for value copy in dt_cg_store_var()
The size of the data to be copied in dt_cg_store_var() was determined wrongly. For strings constants we were copying the size of the string constant even if that might be larger than the maximum string size. The offsets for lvars and gvars was also not taking into account the length prefix to be stored for each string value. Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
- Loading branch information
Showing
8 changed files
with
115 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Oracle Linux DTrace. | ||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. | ||
* Licensed under the Universal Permissive License v 1.0 as shown at | ||
* http://oss.oracle.com/licenses/upl. | ||
*/ | ||
|
||
#pragma D option rawbytes | ||
#pragma D option strsize=6 | ||
#pragma D option quiet | ||
|
||
string x; | ||
|
||
BEGIN | ||
{ | ||
x = "abcdefgh"; | ||
trace(x); | ||
x = "12"; | ||
trace(x); | ||
exit(0); | ||
} | ||
|
||
ERROR | ||
{ | ||
exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef | ||
0: 00 06 61 62 63 64 65 66 00 ..abcdef. | ||
|
||
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef | ||
0: 00 02 31 32 00 00 00 00 00 ..12..... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Oracle Linux DTrace. | ||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. | ||
* Licensed under the Universal Permissive License v 1.0 as shown at | ||
* http://oss.oracle.com/licenses/upl. | ||
*/ | ||
|
||
/* | ||
* ASSERTION: Enough space is allocated for each string variable. | ||
* | ||
* SECTION: Variables/Scalar Variables | ||
*/ | ||
|
||
#pragma D option quiet | ||
#pragma D option strsize=5 | ||
|
||
BEGIN | ||
{ | ||
x = "abcd"; | ||
y = "abcd"; | ||
z = "abcd"; | ||
exit(0); | ||
} | ||
|
||
END { | ||
trace(x); | ||
trace(y); | ||
trace(z); | ||
} | ||
|
||
ERROR | ||
{ | ||
exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abcdabcdabcd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Oracle Linux DTrace. | ||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. | ||
* Licensed under the Universal Permissive License v 1.0 as shown at | ||
* http://oss.oracle.com/licenses/upl. | ||
*/ | ||
|
||
/* | ||
* ASSERTION: Enough space is allocated for each string variable. | ||
* | ||
* SECTION: Variables/Scalar Variables | ||
*/ | ||
|
||
#pragma D option quiet | ||
#pragma D option strsize=5 | ||
|
||
BEGIN | ||
{ | ||
this->x = "abcd"; | ||
this->y = "abcd"; | ||
this->z = "abcd"; | ||
trace(this->x); | ||
trace(this->y); | ||
trace(this->z); | ||
exit(0); | ||
} | ||
|
||
ERROR | ||
{ | ||
exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abcdabcdabcd |