[
https://issues.apache.org/jira/browse/ARROW-7040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Anthony Abate updated ARROW-7040:
---------------------------------
Description:
The following code crashes on 8 cores.
{code:java}
public async Task StringArrayBuilder_StressTest()
{
var wait = new List<Task>();
for (int i = 0; i < 30; ++i)
{
var data = Enumerable.Range(0, 1000).Select(x => $"Item {x +
1}").ToArray();
var t = Task.Run(() =>
{
for (int j = 0; j < 10000000; ++j)
{
var builder = new StringArray.Builder();
builder.AppendRange(data);
}
});
wait.Add(t);
}
await Task.WhenAll(wait);
} {code}
It does not happen with the primitive arrays. (ie IntArrayBuilder)
I suspect it is due to the offset array / and all the copy / resizing going on
Update - it seems that the problem is in the underlying *ArrowBuffer.Builder<T>*
{code:java}
public async Task ValueBuffer_StressTest()
{
var wait = new List<Task>();
for (int i = 0; i < 30; ++i)
{
var data = Enumerable.Range(0, 1000).Select(x => $"Item {x +
1}").ToArray();
var t = Task.Run(() =>
{
for (int j = 0; j < 10000000; ++j)
{
ArrowBuffer.Builder<byte> ValueBuffer = new
ArrowBuffer.Builder<byte>();
foreach (var d in data)
{
ValueBuffer.Append(Encoding.UTF8.GetBytes(d));
}
}
});
wait.Add(t);
}
await Task.WhenAll(wait);
}{code}
was:
The following code crashes on 8 cores.
{code:java}
public async Task StringArrayBuilder_StressTest()
{
var wait = new List<Task>();
for (int i = 0; i < 30; ++i)
{
var data = Enumerable.Range(0, 1000).Select(x => $"Item {x +
1}").ToArray();
var t = Task.Run(() =>
{
for (int j = 0; j < 10000000; ++j)
{
var builder = new StringArray.Builder();
builder.AppendRange(data);
}
});
wait.Add(t);
}
await Task.WhenAll(wait);
} {code}
It does not happen with the primitive arrays. (ie IntArrayBuilder)
I suspect it is due to the offset array / and all the copy / resizing going on
Update - it seems that the problem is in the underlying *ArrowBuffer.Builder<T>*
{code:java}
public async Task ValueBuffer_StressTest()
{
var wait = new List<Task>(); for (int i = 0; i < 30; ++i)
{
var data = Enumerable.Range(0, 1000).Select(x => $"Item {x +
1}").ToArray();
var t = Task.Run(() =>
{
for (int j = 0; j < 10000000; ++j)
{
ArrowBuffer.Builder<byte> ValueBuffer = new
ArrowBuffer.Builder<byte>();
foreach (var d in data)
{
ValueBuffer.Append(Encoding.UTF8.GetBytes(d));
}
}
});
wait.Add(t);
}
await Task.WhenAll(wait);
}{code}
> [C#] ArrowBuffer<T>.Append - Crashes
> -------------------------------------
>
> Key: ARROW-7040
> URL: https://issues.apache.org/jira/browse/ARROW-7040
> Project: Apache Arrow
> Issue Type: Bug
> Components: C#
> Affects Versions: 0.14.1, 0.15.0
> Reporter: Anthony Abate
> Priority: Critical
>
> The following code crashes on 8 cores.
> {code:java}
> public async Task StringArrayBuilder_StressTest()
> {
> var wait = new List<Task>();
> for (int i = 0; i < 30; ++i)
> {
> var data = Enumerable.Range(0, 1000).Select(x => $"Item {x +
> 1}").ToArray();
> var t = Task.Run(() =>
> {
> for (int j = 0; j < 10000000; ++j)
> {
> var builder = new StringArray.Builder();
> builder.AppendRange(data);
> }
> });
> wait.Add(t);
> }
> await Task.WhenAll(wait);
> } {code}
>
> It does not happen with the primitive arrays. (ie IntArrayBuilder)
> I suspect it is due to the offset array / and all the copy / resizing going on
>
> Update - it seems that the problem is in the underlying
> *ArrowBuffer.Builder<T>*
> {code:java}
> public async Task ValueBuffer_StressTest()
> {
> var wait = new List<Task>();
> for (int i = 0; i < 30; ++i)
> {
> var data = Enumerable.Range(0, 1000).Select(x => $"Item {x +
> 1}").ToArray();
> var t = Task.Run(() =>
> {
> for (int j = 0; j < 10000000; ++j)
> {
> ArrowBuffer.Builder<byte> ValueBuffer = new
> ArrowBuffer.Builder<byte>();
> foreach (var d in data)
> {
> ValueBuffer.Append(Encoding.UTF8.GetBytes(d));
> }
> }
> });
> wait.Add(t);
> }
> await Task.WhenAll(wait);
> }{code}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)