You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# nim c --gc:arc --debugger:native --cc:clang_cl --debuginfo:on a.nimproccreate(): refint {.dynlib: "b.dll", importc.}
block:
var x =create()
echocast[int](x) # check the pointerecho"here"GC_fullCollect()
# nim c --gc:arc --debugger:native --cc:clang_cl --debuginfo:on --app:lib b.nimproccreate(): refint{.dynlib, exportc.} =newint
Current Output
2317140426832
Traceback (most recent call last)
D:\Temp\nimdll\a.nim(4) a
C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\lib\system\arc.nim(161) nimRawDispose
C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\lib\system\alloc.nim(972) dealloc
C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\lib\system\alloc.nim(857) rawDealloc
C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\lib\system\alloc.nim(518) listRemove
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Expected Output
no output and no crash
Possible Solution
In file xyz there is a call that might be the cause of it.
Additional Information
$ nim -v
Nim Compiler Version 1.4.2 [Windows: amd64]
Compiled at 2020-11-30
Copyright (c) 2006-2020 by Andreas Rumpf
active boot switches: -d:release
The text was updated successfully, but these errors were encountered:
codehz
changed the title
return ref object from dynlib cause crash when orc/arc enabled
return ref RootObj from dynlib cause crash when orc/arc enabled
Dec 24, 2020
codehz
changed the title
return ref RootObj from dynlib cause crash when orc/arc enabled
return gc traced object from dynlib cause crash when orc/arc enabled
Dec 24, 2020
that's hardly a viable workaround in the general case though; also user passed --gc:arc, not --newruntime so docs are either incorrect or imprecise
``useMalloc`` Makes Nim use C's `malloc`:idx: instead of Nim's
own memory manager, albeit prefixing each allocation with
its size to support clearing memory on reallocation.
This only works with ``gc:none`` and
with ``--newruntime``.
Example
Current Output
Expected Output
no output and no crash
Possible Solution
Additional Information
The text was updated successfully, but these errors were encountered: