Skip to content

Fix tracer result value format when saved to disk#18

Open
SackCastellon wants to merge 7 commits intodevfrom
bugfix/tracer-return-value
Open

Fix tracer result value format when saved to disk#18
SackCastellon wants to merge 7 commits intodevfrom
bugfix/tracer-return-value

Conversation

@SackCastellon
Copy link
Collaborator

Description

Fix a bug where when a trace with a result value without a source code representation, i.e. a PID, was saved to disk and then loaded, it would cause CauDEr to crash.

Changes

  • Now all return values saved to a file are encoded using the "Erlang external term format".
  • Updated traces to use the new representation for return values

Checklist

  • Follows styleguide
  • Branch is up to date
  • Passed unit tests

References

This bug was reported via email by @lanese and @gfabbretti8

…sentation would cause a crash when being loaded

Now all result values are saved to a file using the "Erlang external term format".
@SackCastellon SackCastellon added the bug Something isn't working label May 31, 2021
@SackCastellon SackCastellon requested a review from lanese May 31, 2021 16:06
@lanese
Copy link
Collaborator

lanese commented Jun 1, 2021

I checked and indeed it works, however the binary format is not really useful for human beings, and this field is only for human beings. Maybe one can just add " " around the result so that it is taken as a string and it will not generate errors?
Best,

          Ivan

@SackCastellon
Copy link
Collaborator Author

Okey, I'll look into some other way to encode and decore terms while keeping them readable for the user

@SackCastellon
Copy link
Collaborator Author

I revisited this PR and noticed that I had already implemented a solution in one of the paper branches.
There we convert PIDs from the Erlang representation to the CauDEr one before saving them to a file, i.e. <x.y.z> -> y, avoiding the problem altogether when reading terms from a file.

In my opinion, this is a good solution until we add support for propper Erlang PIDs.

# Conflicts:
#	src/cauder_tracer.erl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants