Strange 'memset' error when using std.range.repeat and std.array.array

Marc Schütz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 4 06:25:30 PST 2016


On Monday, 4 January 2016 at 12:20:09 UTC, Ur at nuz wrote:
> On Monday, 4 January 2016 at 12:00:32 UTC, tcak wrote:
>> On Monday, 4 January 2016 at 10:50:17 UTC, Ur at nuz wrote:
>>> Sorry, the actual code is:
>>> ...
>>>
>>> lines ~= ' '.repeat.take(newIndentCount).array;
>>>
>>> ...with character quotes. But it still fails with error 
>>> described in stack trace in Gcx.bigAlloc()
>>
>> What's your OS? On Linux x64, it works without any error.
>
> Yes. It's Ubuntu 14. It works when it's in the separate 
> example, but not working inside my project. The strange thing 
> is that it working in another place inside the same 
> application. So I don't know what to think about it. Maybe this 
> problem occurs only when some amount of memori is being 
> allocated or something..

What is the value of `newIndentCount` when this happens? Could it 
be it is too big, or negative?

If not, you could try reducing your program using dustmite:
https://github.com/CyberShadow/DustMite/wiki/Detecting-a-specific-segfault


More information about the Digitalmars-d-learn mailing list