From 9a0129dcbf3cc223c88b8c0bc46ac9b375c11abf Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 25 Sep 2015 13:25:34 -0400 Subject: mem: Add PacketInfo to be used for packet probe points This patch fixes a use-after-delete issue in the packet probe points by adding a PacketInfo struct to retain the key fields before passing the packet onwards. We want to probe the packet after it is successfully sent, but by that time the fields may be modified, and the packet may even be deleted. Amazingly enough the issue has gone undetected for months, and only recently popped up in our regressions. --- src/mem/probes/stack_dist.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mem/probes/stack_dist.hh') diff --git a/src/mem/probes/stack_dist.hh b/src/mem/probes/stack_dist.hh index 210800894..8374672da 100644 --- a/src/mem/probes/stack_dist.hh +++ b/src/mem/probes/stack_dist.hh @@ -55,7 +55,8 @@ class StackDistProbe : public BaseMemProbe void regStats() M5_ATTR_OVERRIDE; protected: - void handleRequest(const PacketPtr &pkt) M5_ATTR_OVERRIDE; + void handleRequest(const ProbePoints::PacketInfo &pkt_info) \ + M5_ATTR_OVERRIDE; protected: // Cache line size to simulate -- cgit v1.2.3