summaryrefslogtreecommitdiffstats
path: root/tests/017/glob-carray.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-01-08 00:49:00 +0000
committerKaz Kylheku <kaz@kylheku.com>2020-01-08 00:49:00 +0000
commit12fd1d7637c2fe5a4a6361aeb0f23997880cf1e2 (patch)
tree4729e3c6e2756d30cb145ccea6ff91bec97c8a26 /tests/017/glob-carray.tl
parente9ddfed55490cc9f41f700fb98340fa6a9536aaa (diff)
downloadtxr-12fd1d7637c2fe5a4a6361aeb0f23997880cf1e2.tar.gz
txr-12fd1d7637c2fe5a4a6361aeb0f23997880cf1e2.tar.bz2
txr-12fd1d7637c2fe5a4a6361aeb0f23997880cf1e2.zip
tests: broken glob test cases crash under musl.
Among several issues, the main one is that these test cases use the str-d FFI type for strings. This type means that TXR will take ownership of the memory; it creates the Lisp strings for the Lisp array, and then assuming that it has owership of the C strings, it will free them. On musl, this causes an instant crash, probably because the strings might not be individually coming from malloc. The only documented interface for freing glob resources is globfree; programs cannot assume that the strings can be freed. * tests/017/glob-carray.expected: Updated. * tests/017/glob-carray.tl (glob-t): Add missing flags member of type int. Change the array element string type from str-d to str. * tests/017/glob-zarray.tl: Likewise, and also add a comment to explain why we are not calling globfree in this test case.
Diffstat (limited to 'tests/017/glob-carray.tl')
-rw-r--r--tests/017/glob-carray.tl7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/017/glob-carray.tl b/tests/017/glob-carray.tl
index d40dfdad..99660576 100644
--- a/tests/017/glob-carray.tl
+++ b/tests/017/glob-carray.tl
@@ -10,7 +10,7 @@
(nil int)
(nil size-t)
(nil int)
- (pathv (carray str-d))
+ (pathv (carray str))
(nil (array 4 cptr)))))
((:cygnal :cygwin)
(deffi-type glob-t (struct glob-t
@@ -18,12 +18,13 @@
(nil size-t)
(nil size-t)
(nil int)
- (pathv (carray str-d))
+ (pathv (carray str))
(nil (array 6 cptr)))))
(t (deffi-type glob-t (struct glob-t
(pathc size-t)
- (pathv (carray str-d))
+ (pathv (carray str))
(reserve size-t)
+ (nil int)
(nil (array 5 cptr))))))
(with-dyn-lib (libc)