-
Notifications
You must be signed in to change notification settings - Fork 366
Serialize StateToReproduce to JSON #1261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f3352e8
to
a9cd21c
Compare
Why do we convert it to JSON? Can we not just use the Java serialization API? |
Yes. I used JSON for readability, but Java serialization is indeed simpler. I’m fine switching to that. |
- Replaced JSON with Java serialization in StateToReproduce - Removed unused getters from StateToReproduce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@mrigger
Sorry for the delay and thanks for pinging me, @KabilanMA. I think this could be simplified a lot. At a high level, I see what we are adding an additional class |
Yes, we can serialize I added @KabilanMA @mrigger Does this sound good to you? |
We can serialize the Either approach is valid; it ultimately comes down to maintainability. Keeping a separate serializable class provides better clarity and separation of concerns, especially if |
I think we'd add much technical depth by proceeding with having these additional fields and classes. Essentially, we already have all the information we need in the relevant objects. Converting things to a more low-level representation and having fields such as |
Agreed. |
Motivation
To support a standalone reducer in SQLancer, we need a way to serialize the
StateToReproduce
object, which encapsulates all the information needed to reproduce a bug.Solution
StateToReproduce
into a JSON file when a bug is found.statements
,errorType
(EXCEPTION, NOREC, TLP_WHERE),databaseName
,databaseProvider
,reproducerData
,exception
--serialize-reproduce-state
, and serialized.json
files are written tologs/<dbms>/reproduce/
.StateToReproduceSerializor
is introduced to control which fields are included in the output.Example Output