|
From: Igmar P. <mai...@jd...> - 2003-08-05 14:10:37
|
> char* x = "test";
>
> x[5] = 'x'; // the same as above
>
> printf("%s\n", x ); // causes memory dump
No, it doesn't. The cause is the x[5] = 'x';, since that is a read-only
segment in memory. I never reaches the printf(), which gdb would tell you.
I've already requested this feature, since writing to read-only memory in
threads isn't debuggable by both gdb and valgrind. At least telling me
that the write is to read-only memory would help :)
Igmar
|