genotrance / nimarchive

libarchive wrapper for Nim
MIT License
17 stars 3 forks source link

SIGSEGV Nim 1.2+ #10

Closed juancarlospaco closed 4 years ago

juancarlospaco commented 4 years ago
$ cmake --version
cmake version 3.16.4

$ nimble uninstall nimarchive
$ nimble install nimarchive
$ echo "import nimarchive" > example.nim
$ nim c -f example.nim

...
proc archive_entry_sparse_count*(a1: ptr archive_entry): cint {.imparchiveC.}
proc archive_entry_sparse_reset*(a1: ptr archive_entry): cint {.imparchiveC.}
proc archive_entry_sparse_next*(a1: ptr archive_entry, a2: ptr la_int64_t, a3: ptr la_int64_t): cint {.imparchiveC.}
proc archive_entry_linkresolver_new*(): ptr archive_entry_linkresolver {.imparchiveC.}
proc archive_entry_linkresolver_set_strategy*(a1: ptr archive_entry_linkresolver, a2: cint) {.imparchiveC.}
proc archive_entry_linkresolver_free*(a1: ptr archive_entry_linkresolver) {.imparchiveC.}
proc archive_entry_linkify*(a1: ptr archive_entry_linkresolver, a2: ptr ptr archive_entry, a3: ptr ptr archive_entry) {.imparchiveC.}
proc archive_entry_partial_links*(res: ptr archive_entry_linkresolver, links: ptr cuint): ptr archive_entry {.imparchiveC.}

No stack traceback available
SIGSEGV: Illegal storage access. (Attempt to read from nil?) [AssertionError]
genotrance commented 4 years ago

Can you post nimbug output? :smile:

Also need nimterop version and OS.

genotrance commented 4 years ago

Nevermind - reproduced this on Linux.

This works fine on 1.0.6 but fails on devel and 1.2. I thought I had devel tests in place.

cc @narimiran @Araq