./a.out : segmentation fault

i was trying to convert CSR format to dense format i end up with: segmentation fault

#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>
#include <cusparse.h>
#include <cusparse_v2.h>

#define CHECK_CUDA(func)                                                       \
{                                                                              \
    cudaError_t status = (func);                                               \
    if (status != cudaSuccess) {                                               \
        printf("CUDA API failed with error (%d) at line %d\n",                 \
               status, __LINE__);                                              \
        return EXIT_FAILURE;                                                   \
    }                                                                          \
}
#define CHECK_CUSPARSE(func)                                                   \
{                                                                              \
    cusparseStatus_t status = (func);                                          \
    if (status != CUSPARSE_STATUS_SUCCESS) {                                   \
        printf("CUSPARSE API failed with error (%d) at line %d\n",             \
               status, __LINE__);                                              \
        return EXIT_FAILURE;                                                   \
    }                                                                          \
}
int main() {

    cusparseHandle_t    handle;

    // --- Initialize cuSPARSE
    CHECK_CUSPARSE(cusparseCreate(&handle));

    cusparseMatDescr_t  descrA = 0;

 const int A_num_rows = 4;
    const int A_num_cols = 4;
    const int A_num_nnz  = 9;
    int   hA_csrOffsets[] = { 0, 3, 4, 7, 9 };
    int   hA_columns[]    = { 0, 2, 3, 1, 0, 2, 3, 1, 3 };
    double hA_Values[]     = { 1.0, 2.0, 3.0, 4.0, 5.0,
                              6.0, 7.0, 8.0, 9.0};

int   *dA_csrOffsets, *dA_columns;
    double *dA_values;
     CHECK_CUDA( cudaMalloc((void**) &dA_csrOffsets,(A_num_rows + 1) * sizeof(int)) )
    CHECK_CUDA( cudaMalloc((void**) &dA_columns, A_num_nnz * sizeof(int)) )
    CHECK_CUDA( cudaMalloc((void**) &dA_values, A_num_nnz * sizeof(double)) )

    CHECK_CUDA( cudaMemcpy(dA_csrOffsets, hA_csrOffsets, (A_num_rows + 1) * sizeof(int),   cudaMemcpyHostToDevice) )
    CHECK_CUDA( cudaMemcpy(dA_columns, hA_columns, A_num_nnz * sizeof(int),cudaMemcpyHostToDevice) )
    CHECK_CUDA( cudaMemcpy(dA_values, hA_Values,A_num_nnz * sizeof(double), cudaMemcpyHostToDevice) )

double *d_A_denseReconstructed;
    CHECK_CUDA(cudaMalloc(&d_A_denseReconstructed, A_num_rows * A_num_rows * sizeof(double)));
    CHECK_CUSPARSE(cusparseDcsr2dense(handle, A_num_rows, A_num_cols, descrA, dA_values, dA_csrOffsets, dA_columns,d_A_denseReconstructed, A_num_rows));

}

You can’t just set descrA to zero. Study any cusparse code that uses a sparse matrix descriptor, to learn how to create one.