storj/lib/uplinkc/testdata
Jeff Wendling e22c0bff94 lib/uplinkc: fix flaky download test (#2791)
The download driver code loops through the downloaded_data buffer
but doesn't ensure that it always passes a valid pointer to the
Go side. In particular, if the malloc'd memory ends against an
unmapped page, and the test passes a pointer one past the end
of the memory region, and since the Go side always dereferences
the pointer when creating a slice, it will attempt to read
unmapped memory, causing a segfault.

This bug doesn't always present. Indeed, it depends on the details
of your system's memory allocator. I validated that this could be
a cause of observed crashes on OS X by using mmap and mprotect
to do the allocations ensuring that the page directly after the
memory we use was unmapped/protected. The crash happened exactly
as seen, and was fixed by changing this condition in the while
loop.

Change-Id: I685dac07ff9b904097375dbf850f387450858753
2019-08-15 11:32:29 +03:00
..
apikey_test.c Uplink C bindings part 3 (#2258) 2019-06-21 08:24:06 -04:00
bucket_test.c lib/uplink: encryption context (#2349) 2019-06-27 17:36:51 +00:00
helpers.h Re-implement libstorj API (V2) using libuplink (V3) (#2573) 2019-07-30 13:40:05 +02:00
object_test.c lib/uplinkc: fix flaky download test (#2791) 2019-08-15 11:32:29 +03:00
project_test.c Don't require encryption keys for project or bucket management (#2291) 2019-06-23 22:06:14 -04:00
require.h add new line to end of require macro print statements (#2710) 2019-08-05 08:02:10 -04:00