misc: Segmentation Fault during O3PipeView execution
authorAndrea Mondelli <Andrea.Mondelli@ucf.edu>
Mon, 11 Feb 2019 19:53:13 +0000 (14:53 -0500)
committerAndrea Mondelli <Andrea.Mondelli@ucf.edu>
Wed, 27 Feb 2019 18:12:13 +0000 (18:12 +0000)
During the O3PipeView execution, a potential invalid iterator is used to
Update the instruction storeTick field.

If the store_idx iterator is the first() of the StoreQueue, the
corresponding instruction is removed from the queue, leaving the iterator
invalid and not usable in the TRACING_ON block.

This patch uses the store_inst variable to access (and update) the
instruction tick, instead of the (potential) invalid one.

Change-Id: I671052ef282b9048e5239da8629b89e8afa86bf0
Reviewed-on: https://gem5-review.googlesource.com/c/16322
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
src/cpu/o3/lsq_unit_impl.hh

index 2c59d5a9e0d58d4d092dab3d4a6069d25181a6e7..adb24cbc50a7b8a31be77c5fb5375ccf360090c0 100644 (file)
@@ -999,8 +999,8 @@ LSQUnit<Impl>::completeStore(typename StoreQueue::iterator store_idx)
 
 #if TRACING_ON
     if (DTRACE(O3PipeView)) {
-        store_idx->instruction()->storeTick =
-            curTick() - store_idx->instruction()->fetchTick;
+        store_inst->storeTick =
+            curTick() - store_inst->fetchTick;
     }
 #endif