SEGFAULT when converting C string to string

DFTW jckj33 at gmail.com
Mon Mar 18 22:41:43 UTC 2019


On Monday, 18 March 2019 at 22:33:21 UTC, H. S. Teoh wrote:
> On Mon, Mar 18, 2019 at 10:20:35PM +0000, DFTW via 
> Digitalmars-d-learn wrote:
>> [...]
> [...]
>
> Most likely explanation: you failed to call rt_init() before 
> using a language feature that requires druntime to be 
> initialized. In this case, a GC allocation by 
> std.conv.to!string.
>
> Call rt_init() immediately after loading the library, and 
> calling
> rt_term() after you're done with it, should fix this problem.
>
>
> T

That's right. From the small code samples I've seen, they had no 
rt_init() usage, so I wasn't aware I've had to call it.
Thanks!


More information about the Digitalmars-d-learn mailing list