This is the mail archive of the sid@sources.redhat.com mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

sidcpuutil.h patch: memory poisoning


Hi -

I just committed a patch to sidcpuutil.h which will let one
diagnose earlier the lack of sufficient initialization in the
cpu model classes' constructors and reset functions.  Previously,
especially on Linux, it happened that many bytes of newly allocated
cpu objects were zero.  On other platforms (Cygwin) or in circumstances
(running under dejagnu vs. standalone), this was often not true, and
lead to strange failures.

Now, the utility base class explicitly clobbers all newly allocated
memory for the CPU object.  This way, ports that are forgetful in
initializing especially the CGEN-side this->hardware will show up
as attempts to manipulate registers containing 0xdeadbeef.  Please
check your port after applying this patch, and let me know if it
helps uncover latent problems.

- FChE

PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]