Re: writing to freed memory--issues



Kasper Dupont
<22187600027978126515@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:

If your program printed the actual address it might be a lot
easier to figure out why it behaves the way it does. Something
like fprintf(stderr,"%08x\n",a); (assuming a 32 bit architecture,
on a 64 bit architecture you'd want 16 digits of the pointer).

Or use %p.

--
Måns Rullgård
mru@xxxxxxxxxxxxx
.



Relevant Pages

  • Re: Why the compiler applies sign extension to unsigned data?
    ... The purist C point of view is that the operation of casting a pointer to ... I just fail to see the need for signed pointers. ... The need originates in the original 2G/2G split between user mode and ... As a matter of fact the x64 architecture explicitly deals ...
    (microsoft.public.development.device.drivers)
  • Re: How much did the AS/400 influence the C standard?
    ... AS/400 is not the only architecture ever envisioned with tagged ... So the '400 isn't even the only IBM platform to ... It also seems to me that the proponents of relaxed rules for pointer ... where illegal pointer subtraction give inconsistent results, ...
    (comp.std.c)
  • Re: Printf("%d")
    ... If the same pointer happened to be on the stack ... in memory -- -13361016 is just a bit too random for that. ... memory addresses happens to be reserved in this architecture. ...
    (comp.lang.c)
  • Re: De-referencing NULL
    ... there are indeed memory-mapped I/O registers in the ... some way incompatible with the architecture, which is a really weird thing. ... is not guaranteed to produce a null pointer. ... I doubt that this would be a good idea on balance, though such a compiler ...
    (comp.lang.c)
  • Re: Memory layout of structs
    ... of comp.os.linux.development.apps, Kasper Dupont wrote: ... memory, depending on the architecture of the CPU, so the two 16-bit ... integers will be placed differently on different platforms. ... endian differences in mind. ...
    (comp.os.linux.development.apps)