Skip to content
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

Disable printStructure() 2nd try #180

Merged
merged 10 commits into from
Sep 13, 2018
Merged

Disable printStructure() 2nd try #180

merged 10 commits into from
Sep 13, 2018

Conversation

D4N
Copy link
Member

@D4N D4N commented Nov 26, 2017

Re-submission of #165.

The testsuite should fail now due to the missing output of printStructure() & #134 popped up again.

We should also consider either removing printStructure or marking it deprecated, so that downstream code does not use it.

@piponazo
Copy link
Collaborator

You mentioned that the test failure is expected. What is the plan then ? Do we need to adjust the test suite ?

@piponazo piponazo mentioned this pull request Nov 29, 2017
@D4N
Copy link
Member Author

D4N commented Nov 29, 2017

Yes, we need to do that as the output of exiv2 is changed quite substantially by the removal of printStructure.

However, as the new python test suite will also require a rewrite of the test output files, we can consider merging this in a broken state and only adapt the python test suite (and abandon the old one). However, before we do that #134 must be fixed again in this patch & the python test suite should be ready.

@D4N D4N force-pushed the disable-printStructure branch from 4ece8a0 to 5ca06da Compare January 6, 2018 10:50
@D4N
Copy link
Member Author

D4N commented Jan 6, 2018

Now that the Python test suite is merged, we should start working on this. I am afraid that the first step would be to port all regression tests from the old suite to the new one, then remove printStructure and then adapt the new test suite (which will be a ton easier than with the old one). And of course fix #134 along the way.

@D4N
Copy link
Member Author

D4N commented Jan 10, 2018

I just checked the Travis log and there are further issues. The reproducers for #134, #138, #140 result in the following warning: *** Error in '/home/travis/build/Exiv2/exiv2/build/bin/exiv2': free(): corrupted unsorted chunks: 0xsome_hex_number ***. That might the result of a segfault or something even worse (like a subtle heap corruption).

@clanmills
Copy link
Collaborator

Gentlemen:

I know what's the matter here. Half a line of code! In tiffimage.cpp#199 readMetadata(), I haven't allocated sufficient memory for the ICC profile. The code:

            iccProfile_.alloc(pos->count());

should be:

            iccProfile_.alloc(pos->count()*pos->typeSize());

I attach a patch which contains the removal of calls to printStructure() for several image types. printStructureFixes.txt

When you apply this patch, you will get lots of changes to the output of the test suite. However it should run without crashes or exceptions. To fix the test suite:

$ make bugfixes
$ cp test/tmp/bugfixes-test.out test/data/

And submit that the modified test/data/bugfixes-test.out

@D4N
Copy link
Member Author

D4N commented Jan 22, 2018

I have pushed your changes Robin.

However I don't think we should update the old test suite any more. It will only further increase the size of the repository (which is already very large).

@clanmills
Copy link
Collaborator

Thanks for your work on the test harness and printStructure(). If you're happy that the new test harness embodies the functionality of test/bugfixes-test.sh then I'm happy to remove it.

My understand (from a conversation between you and Luis) is that the binary file test/data/bugfixes-test.out is the culprit. There's another big file: exiv2-bug922a.jpg Is it possible to kill those files and all references so they are no longer in the depot?

A few years ago, Daniel (Kaneider) complained about some EPS and VIDEO test files, so I put them into a different depot and only download them when required. It possible to download a subpart of the depot with git, or do you always have to copy the whole she-bang? We could put those files on the buildserver and pull them down with curl or something.

@D4N
Copy link
Member Author

D4N commented Feb 1, 2018

Yes, the large binary files are the problem. However removing them will not actually solve the problem of the repository size, as the files will be still present in the repos history (they must be present so that you can checkout commits from the past). So not touching them is actually the best approach ;-) (We can of course remove them via git rm).

We were already discussing whether we should move the binary files to another repository running git lfs, but I think we deferred the idea.

@piponazo
Copy link
Collaborator

piponazo commented Apr 1, 2018

Hi guys. I see this PR referenced in few issues and the one that will solve many of them. Can we make a realistic plan to translate the old tests to use the new python framework so that we can finally merge this?

@piponazo
Copy link
Collaborator

piponazo commented Apr 1, 2018

Oh ... I just saw #250 . I think this is what we need to solve to finally merge this PR, right ?

@D4N
Copy link
Member Author

D4N commented Apr 2, 2018

Yes, that is correct. However to get this merged, we only need to get the tests from bugfixes-test.sh ported, the other ones are "nice to have" and can be done at some point in the future.

@piponazo
Copy link
Collaborator

piponazo commented Apr 9, 2018

ey @D4N , what do you think about the following approach:

  1. Disable the run of the old bash tests temporarily (bugfixes-test.sh)
  2. Merge this PR
  3. Port the tests from the old suite to the new suite progressively

In that way we could get fix many of the bug-reports that are being reported around this piece of code. I discussed this briefly with @clanmills and he also agreed.

@D4N
Copy link
Member Author

D4N commented Apr 9, 2018

I don't think that's a good idea, as then there will be even less incentive/motivation to port the test suite, since this PR is then gone. Currently it reminds us that we should take care of it.

@piponazo
Copy link
Collaborator

You're right, we will lose motivation to do it. For the moment I have created a new label, so that we can mark all the issues related with the printStructure function until we finish this work.

@clanmills
Copy link
Collaborator

I strongly feel we should do this without further delay. I feel very upset every time I see a bug related to printStructure(). Sure, I'm to blame. The punishment of seeing these issue reports is painful.

I have test/bugfixes-test.sh in the discussion document for May. http://dev.exiv2.org/news/3

I believe we can pull bugfixes-test.sh v0.26 from SVN on demand. So we don't need to port everything in bugfixes-test.sh to the new test suite. After we've discussed this, I'll undertake the tasks we agree to complete bugfixes-test for v0.27.

@D4N D4N force-pushed the disable-printStructure branch from 5b8f955 to 33e89a4 Compare May 27, 2018 23:01
@D4N D4N force-pushed the disable-printStructure branch 4 times, most recently from 4a45302 to 4b92e3c Compare June 11, 2018 21:32
@D4N D4N force-pushed the disable-printStructure branch from 4b92e3c to a0929f3 Compare July 31, 2018 22:19
@D4N
Copy link
Member Author

D4N commented Sep 1, 2018

Very well, I am going to drop the commits removing printStructure completely and make a new branch for that, so that we can proceed forward.

@D4N D4N force-pushed the disable-printStructure branch from 031297f to 09a7d89 Compare September 1, 2018 10:19
@clanmills
Copy link
Collaborator

Are you upset? We can talk on Skype if you like.

@D4N
Copy link
Member Author

D4N commented Sep 1, 2018

No, I am not. I agree that removing printStructure completely is too much for now. Let's get the CI green and this thing merged.

@piponazo piponazo force-pushed the disable-printStructure branch 2 times, most recently from e75df9b to 74afbcf Compare September 10, 2018 10:18
@piponazo piponazo self-requested a review September 10, 2018 11:16
Copy link
Collaborator

@piponazo piponazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding work Dan!

I took the freedom to check what was wrong with some of the CI jobs and I fixed few bugs which arose after removing the printStructure calls.

@D4N D4N force-pushed the disable-printStructure branch from 77e4df1 to ffa39aa Compare September 10, 2018 20:46
@D4N D4N force-pushed the disable-printStructure branch from ffa39aa to 429a942 Compare September 13, 2018 08:28
clanmills and others added 10 commits September 13, 2018 11:18
This function extracts a 2, 4 or 8 byte integer from the image and
swaps it according to the current setting. However, it was implicitly
assuming, that it reads the same amount from the image is is
requested.
If that is not the case, e.g. if 8 bytes are requested but
only 4 are read
=> result is created via byteSwap8() which reads 8 bytes
   !but 4 of those are uninitialized!
Using the actually read size fixes this problem.
@D4N D4N force-pushed the disable-printStructure branch from 429a942 to 19bb57f Compare September 13, 2018 09:18
@D4N D4N merged commit ae0bfa4 into master Sep 13, 2018
@D4N D4N deleted the disable-printStructure branch September 13, 2018 14:30
D4N added a commit to D4N/exiv2 that referenced this pull request Oct 11, 2018
D4N added a commit to D4N/exiv2 that referenced this pull request Oct 11, 2018
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

Successfully merging this pull request may close these issues.

3 participants