Re: SIGSEGV in new/malloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Karthik,

Sorry, I could not get this to crash...
int main()
{
    typedef unsigned char BYTE;
    int nNewSize = 1;

    void** m_pData = (void**) new BYTE[nNewSize * sizeof(BYTE*)];
}

What compiler flags are you using?

What OS are you using?

Does your program do anything more than the above, or is this the smallest program that reproduces the problem for you?

You could do this, by the way...
void** m_pData = new void*;
...cuts out some array voodoo magic sizing monkey business. But that shouldn't have any impact on your problem. Just a coding style suggestion.


--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux