-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8989 from bradcray/bug-assoc-of-remote-strings
File a bug against accessing associative domains with remote strings [trivial, not reviewed]
- Loading branch information
Showing
5 changed files
with
102 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// This program sometimes fails on two or more locales, either getting | ||
// an out-of-bounds error or a segfault. For a single locale, there | ||
// is no error. If the strings are changed to integers, it doesn't | ||
// seem to get an error either, suggesting that something about using | ||
// strings across multiple locales may be the issue. Running with a | ||
// smaller number of entries doesn't seem to solve the problem either | ||
// (I wondered for awhile whether the array resizing was causing | ||
// problems, but see failures with 3 entries where no resizing should | ||
// be done). | ||
// | ||
|
||
config const ENTRIES = 15, | ||
debug = false; | ||
|
||
var keys: [0..#ENTRIES] string; | ||
for i in 0..#ENTRIES { | ||
keys[i] = "%04i".format(i); | ||
writeln(keys); | ||
} | ||
|
||
on Locales [numLocales-1] { | ||
var D: domain(string); | ||
var array: [D] uint(64); | ||
|
||
if debug then | ||
writeln("D is ", D.locale, ", array is ", array.locale); | ||
|
||
for i in 0..#ENTRIES { | ||
writeln("assign array [\"%s\"] = 12345".format(keys[i])); | ||
|
||
array[keys[i]] = 12345; | ||
} | ||
|
||
if debug { | ||
writeln(D); | ||
for a in array do | ||
writeln(a); | ||
writeln(array); | ||
} | ||
|
||
for i in 0..#ENTRIES { | ||
writeln("get array[\"%s\"]: %i".format(keys[i], array[keys[i]])); | ||
} | ||
} |
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,11 @@ | ||
associative-of-strings fails on non-zero locales | ||
|
||
This test gets either an OOB error or a segfault when running on 2+ | ||
locales. I believe that the issue relates to using string keys that | ||
are allocated on locale 0 and then used w.r.t. an associative array on | ||
locale 1. Specifically, changing from string keys/values to integers | ||
makes the error go away, as does storing the `keys` array on the same | ||
locale as the associtaive domain, as does changing the intents on the | ||
default associative's dsiAccess() routines to 'const in'. That said, | ||
I'm still not quite sure where the blame lies here. | ||
|
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,45 @@ | ||
0000 | ||
0000 0001 | ||
0000 0001 0002 | ||
0000 0001 0002 0003 | ||
0000 0001 0002 0003 0004 | ||
0000 0001 0002 0003 0004 0005 | ||
0000 0001 0002 0003 0004 0005 0006 | ||
0000 0001 0002 0003 0004 0005 0006 0007 | ||
0000 0001 0002 0003 0004 0005 0006 0007 0008 | ||
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 | ||
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 | ||
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 | ||
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 | ||
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 | ||
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 | ||
assign array ["0000"] = 12345 | ||
assign array ["0001"] = 12345 | ||
assign array ["0002"] = 12345 | ||
assign array ["0003"] = 12345 | ||
assign array ["0004"] = 12345 | ||
assign array ["0005"] = 12345 | ||
assign array ["0006"] = 12345 | ||
assign array ["0007"] = 12345 | ||
assign array ["0008"] = 12345 | ||
assign array ["0009"] = 12345 | ||
assign array ["0010"] = 12345 | ||
assign array ["0011"] = 12345 | ||
assign array ["0012"] = 12345 | ||
assign array ["0013"] = 12345 | ||
assign array ["0014"] = 12345 | ||
get array["0000"]: 12345 | ||
get array["0001"]: 12345 | ||
get array["0002"]: 12345 | ||
get array["0003"]: 12345 | ||
get array["0004"]: 12345 | ||
get array["0005"]: 12345 | ||
get array["0006"]: 12345 | ||
get array["0007"]: 12345 | ||
get array["0008"]: 12345 | ||
get array["0009"]: 12345 | ||
get array["0010"]: 12345 | ||
get array["0011"]: 12345 | ||
get array["0012"]: 12345 | ||
get array["0013"]: 12345 | ||
get array["0014"]: 12345 |
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 @@ | ||
2 |
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 @@ | ||
CHPL_COMM==none |