s2e icon indicating copy to clipboard operation
s2e copied to clipboard

libs2ecore: remove pinned states from child instance

Open gkso opened this issue 3 years ago • 5 comments

The pinned states should only be kept in the parent instance, therefore we kill them in the child instance after forking.

Signed-off-by: Zhongjie Wang [email protected]

gkso avatar Apr 01 '21 20:04 gkso

Are you working on state merging by any chance? That's the only place where this feature is used. I think that it would be better to remove the pinned property from S2EExecutionState and instead let plugins decide what they want to do with the states. The isPinned() feature could be implemented by subscribing to the onStatesSplit event and moving the state from the child set to the parent set [1].

[1] https://github.com/S2E/s2e/blob/bebe76f6ffd2c8bc3ac2b3d800d7bc05826b9dfe/libs2ecore/src/S2EExecutor.cpp#L702

vitalych avatar Apr 02 '21 18:04 vitalych

Yes, I'm using the MergingSearcher so that's why I came across this problem. :) That sounds good. I think using onStateSplit would be a better idea, since it can achieve the same results as using isPinned() :+1:

gkso avatar Apr 02 '21 19:04 gkso

Any progress on this? I'll apply the patch after you address the feedback.

vitalych avatar May 24 '21 10:05 vitalych

Sorry about the late reply. Because the current MergingSearcher still has some other issues, for example, the ones mentioned in S2E/s2e-env#434. Besides, I've encounter other issues, such as packet receiving during merging will invoke direct memory write (transferRam) into the guest memory and cause troubles. So I need to disable packet receiving with some ugly hacks in qemu. I don't think they are ideal solutions. So fixing the "pinned state" issue alone will not make MergingSearcvher work. You may close this pull request for now if you want.

gkso avatar Jun 16 '21 16:06 gkso

Hi! No worries, any incremental improvements are welcome.

vitalych avatar Jun 16 '21 20:06 vitalych

Closing stale pr.

vitalych avatar Mar 12 '23 00:03 vitalych