This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Cannot read 0x00000000: data is not present

When I debug program, I encounter a problem which is as follows:

Three pictures above are results after consistent  three steps. As we can see, the storing  location of variable *pnta becomes 0x00000000, the error is : Cannot read 0x00000000: data is not present. I don't know the reason,is it memory lacking? 

  • Are you running the default NDK example (helloworld) ?
    Which board and DSP are you using ?
    Custom or EVM ?
    Any problem are you getting and not able to get expected behavior when you run the example ?
  • Yes, I'm running a ndk example(helloWorld). Now I want to make a dhcp server, so I initiate paraments(static DHCPSRV *pds; static NTARGS *pnta; static NTPARAM_DHCPS *pntp;) in the NetworkOpen(). However, it shows that I can't initiate *pnta and *pntp. (Cannot read 0x00000000: data is not present). My board is EVMK2E. My codes are as follows:

    static DHCPSRV *pds;
    static NTARGS *pnta;
    static NTPARAM_DHCPS *pntp;

    //
    // NetworkOpen
    //
    // This function is called after the configuration has booted

    static void NetworkOpen()
    {
    bzero( &pnta, sizeof(pnta));
    pnta->CallMode = NT_MODE_IFIDX;
    pnta->IPAddr = inet_addr("192.168.2.11");//LocalIPAddr
    pnta->IfIdx = 1;
    //pNTA->hCallback = &ServiceReport;
    //pNTA->pCb = &ServiceReport;
    bzero( &pntp, sizeof(pntp) );
    pntp->Flags = DHCPS_FLG_LOCALDNS;
    pntp->PoolBase = inet_addr("192.168.2.1");//BaseIP
    pntp->PoolCount = 100;


    pds=DHCPSOpen_1(pnta, pntp); //DHCPOpen_1() is called to be a dhcp server

    IPN iptmp;
    printf("IF is %d\n",pds->IfIdx);
    iptmp= ntohl(pds->IPServer);
    printf("Server IP is %d:%d:%d:%d\n",
    (UINT8)(iptmp>>24)&0xFF,(UINT8)(iptmp>>16)&0xFF,
    (UINT8)(iptmp>>8)&0xFF,(UINT8)iptmp&0xFF );
    }
  • Jiang,

    Which processor core are you trying to run this on? The C66x DSP or which one of the ARM A15s?

    It appears the bzero function is initializing the pointer pnta to 0x00000000 which is the same as NULL. This means you have a NULL pointer, but you have not allocated a physical struct for pnta to point at.

    It is appropriate for the tools to show you are trying to access invalid memory.

    You need to get our supplied examples to work and begin your coding from those. It appears you are writing your own code that is doing the example that you are showing. If I am incorrect, please explain and show what results you get when you use our examples.

    Regards,
    RandyP