I have been trying to find the reason for this issue for days, and can't seem 
to find it. Perhaps something stupidly easy I am simply missing? I don't know.

The problem is, that I am unable to reproduce the error in a small example. I 
only encounter this problem in a bigger project, that I cannot share publicly 
in its entirety.

I encounter more and more problems with funcs and procs, that worked for 6 to 
24 months up until recently. Changing to an older Nim version, did not help, 
though.

The aforementioned funcs and procs are all related to doing String operations. 
For example, adding characters to a string, or transforming the string in 
different ways. I did not see a clear pattern in what is causing the error. The 
only 2 things those operations have in common is that they deal pretty often 
(by far not always) with low-level cstring instances and it's most of the time 
related to strings coming in some shape or form from the Windows API (through 
winim), even though, they are converted to plain old Nim strings. However, the 
cstrings are supposedly not nil, as I can see them most of the time in the log 
through an echo, right before the segmentation fault occurs. To my knowledge, 
according to what Nim is telling me, the string are supposedly properly used 
and converted to Nim types.

Every single segmentation fault is essentially triggered in this exact place: 
<https://github.com/nim-lang/Nim/blob/8d2f6bba3a491bc93677da9590397346e63c2bb2/lib/system/alloc.nim#L716>

No matter what type of string operation is done, whether it's modifying 
something or creating an entirely new string or just copying it or whatever, 
the segmentation fault always happens at this exact line.

It would be highly appreciated, if anyone could give me a hint or lead me in 
the direction of a solution for this big issue. 

Reply via email to