Skip to content

FIX: for assertion error and add unit tests #543

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

Open
2 tasks
Treesarj opened this issue May 26, 2023 · 1 comment
Open
2 tasks

FIX: for assertion error and add unit tests #543

Treesarj opened this issue May 26, 2023 · 1 comment

Comments

@Treesarj
Copy link
Collaborator

in PR: #541
which was a temporary fix for the assertion error: python: /project/src/dlite-json.c:306: dlite_json_asprint: Assertion `0 <= m && m < (int)*size' failed.
Added one more byte to the allocated buffer than expected, which seems to fix the assertion. Requiring this extra byte is unexpected. It seems to be caused by dlite_json_sprint() reporting one byte too little when called with size=0 for a collection with relations!

  • Create a proper fix for this issue!
  • add unit tests
jesper-friis added a commit that referenced this issue Sep 13, 2023
Still not able to reproduce the issue...
@jesper-friis
Copy link
Collaborator

PR #649 checks that dlite_json_sprintf() returns the correct number of bytes needed for serialising a collection with relations. Seems that the hypothesis that this issue is "caused by dlite_json_sprint() reporting one byte too little when called with size=0 for a collection with relations" may be wrong.

It would be great to get an example that consistently reproduces this issue.

jesper-friis added a commit that referenced this issue Sep 29, 2023
# Description
Added new test for issue #543. It check whether there is an issue with
dlite_json_sprint() reporting one byte too little when writing a
collection with relations. The new does not reproduce the issue...

## Type of change
- [ ] Bug fix & code cleanup
- [ ] New feature
- [ ] Documentation update
- [x] Test update

## Checklist for the reviewer
This checklist should be used as a help for the reviewer.

- [ ] Is the change limited to one issue?
- [ ] Does this PR close the issue?
- [ ] Is the code easy to read and understand?
- [ ] Do all new feature have an accompanying new test?
- [ ] Has the documentation been updated as necessary?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants