Sun Studio 12: Debugging a Program With dbx

Write to Read-Only Memory (wro) Error

Problem: Attempt to write to read-only memory.

Possible causes: Writing to a text address, writing to a read-only data section (.rodata), or writing to a page that mmap has made read-only.


{   int *foop = (int *) foo;
    *foop = 0;                /* Write to read-only memory (wro) */