For my old Windows OS GUI application which uses https://github.com/khchen/winim and https://github.com/khchen/wNim I did a test. Some mm modes make
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
if the exe quits.
Thanks
memory | management mode work or not |
---|---|
orc | SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
arc | yes |
refc | yes markAndSweep yes |
Boehm | SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
go | I have not found libgo.dll to run exe |
none | yes |
So bad, my application uses winim to interact with Windows .NET Frameworks during reading Excel files( both xls and xlsx), as a result there is no need to install any Office-like software, for example MS Office, .
I don't know whether there is any other opensource solution, which can be used in Nimlang, for reading Excel files or not. Well, actually, I have not found such a library at all.
BTW1, WSL is not a solution for end-user, never and forever
BTW2, I have bad experience with GTK decade ago, but of cause on Windows OS.
yes, there are some libs to handle xlsx, but what about the old xls format
to be frank, I only know the following excel file( both xlsx and xls ) reading libs which can be used by Nimlang
Let me try again:
Do this mean there is some bug in my code or use libs?
Yes. Potentially in both.
if there are bugs, how to trace, locate and fix the line(s) in source code?
Setup a sanitizer, review your own code, review your used libraries. Under WSL you can use valgrind, but then you're in a Linux environment.
Under Linux you can use WINE and valgrind to run your Windows program. Maybe.
Do this mean there is some bug in my code or use libs?
This means there's some problem associated with pointers, usually a nil-derefercing. The bug can either be in your code or be in the lib. It's hard to tell as we don't know how you're using it. Some code snippets would be helpful. Knowing the version of the compiler you are using would also be helpful, as the bug can even be in the compiler. (There's a similar bug on Nim 1.6.x that affects both ARC and ORC.)
if there are bugs, how to trace, locate and fix the line(s) in source code?
Perform unit tests, focusing on code that uses pointers with FFI or uses GC'ed memory. (Maybe you should mainly focus on the latter as the bug only appears on some particular MM modes.) If you have reduced the code to a basic example and still getting SIGSEGV, then you probably have found the bug. If you are not getting SIGSEGV, run it twice more because that could be a false negative. This is at least what I would do.