weird access violation using thrust::reduce_by_key

Hi, I’ve been staring at this code for a while and I do not know why I’m getting an access violation error from the NSIGHT memory checker. I am on the windows platform and am using visual studio 2012 with CUDA7.0. I isolated the issue as much as I can. This is the simplest main function in a fresh CUDA7.0 project that triggers the access violation:

int main()
{
   thrust::device_vector<int> tempvec(10); //input keys
   thrust::device_vector<int> values(10); //input values
   thrust::device_vector<int> key_output(10); //output keys
   thrust::device_vector<int> value_output(10); //output values
   
   thrust::reduce_by_key(tempvec.begin(),tempvec.end(),values.begin(),key_output.begin(),value_output.begin());
   return 0;
}

The exact error I get is as follows:

CUDA module loaded: 03b0e050 X:/CudaTestApp/kernel.cu

CUDA Memory Checker detected 1 threads caused an access violation:
Launch Parameters
CUcontext = 0253d5b0
CUstream = 03a561a0
CUmodule = 03b0e050
CUfunction = 1d9809b0
FunctionName = ZN6thrust6system4cuda6detail5bulkdefaultESU_EEEENS_9null_typeEEEEEEEEEvT0
GridId = 25
gridDim = {1,1,1}
blockDim = {512,1,1}
sharedSize = 24576
Parameters:
__val_paramf = {_b_N6thrust6system4cuda6detail5bulk_6detail9task … _9null_typeEEEEEEE = {…}, block_offset = 5767680}
Parameters (raw):
0xcccccccc 0xcccccccc 0xcccccc00 0xcccccccc
0x00580000 0x0000000b 0x00580028 0x0000000b
0x00580200 0x0000000b 0x00580400 0x0000000b
0x00580600 0x0000000b 0xcccccccc 0xcccccccc
0xcccccccc 0xcccccccc 0x00580800 0x0000000b
0x7fffffff 0x7fffffff 0x00005fd0 0x00000001
0x7fffffff 0xcccccccc 0x00000000 0xcccccccc
GPU State:
Address Size Type Mem Block Thread blockIdx threadIdx PC Source

b00580028 4 adr ld g 0 0 {0,0,0} {0,0,0} ZZN6thrust6system4cuda6detail61_GLOBAL__N__41 … device_pathERNSC_IS5_EES7_+000308
c:\program files\nvidia gpu computing toolkit\cuda\v7.0\include\thrust\system\cuda\detail\get_value.h:65

Summary of access violations:
c:\program files\nvidia gpu computing toolkit\cuda\v7.0\include\thrust\system\cuda\detail\get_value.h(65): error MemoryChecker: #misaligned=0 #invalidAddress=1

Memory Checker detected 1 access violations.
error = access violation on load (global memory)
gridid = 25
blockIdx = {0,0,0}
threadIdx = {0,0,0}
address = 0xb00580028
accessSize = 4

This is the function from get_value.h where the issue occurs:

__device__ inline static result_type device_path(execution_policy<DerivedPolicy> &, Pointer ptr)
    {
      // when called from device code, just do simple deref
      return *thrust::raw_pointer_cast(ptr);
    }

In my mind the minimal example code above nearly exactly reproduces the example in the thrust docs, at a loss why it gives me this issue. Any help or insight would be greatly appreciated.

“nearly exactly”

so, what is an “access violation”

if by access violation it is meant: “#misaligned=0 #invalidAddress=1”

what is an invalidAddress?

memory not allocated, as expected?

what sets up execution_policy &, Pointer ptr …?