Bug Report / Enhancement suggestion

Started by Hank, August 16, 2021, 10:53:11 AM

Previous topic - Next topic

Hank

Hello Phil,

Hope all is well with you and yours. 
I was running a few of the recent versions of Exiftool through the ringer and found a minor bug with the JSON parser.

Exiftool version(s): 12.08 to 12.30
OS: Linux (oddly, the Windows version passes...  ???)
Test file(s) come from from the JSON Parsing Test Suite ( https://github.com/nst/JSONTestSuite ); n_structure_open_array_object.json

Running

Exiftool/Image-ExifTool-12.30/exiftool n_structure_open_array_object.json
Deep recursion on subroutine "Image::ExifTool::Import::ReadJSONObject" at ../Exiftool/Image-ExifTool-12.30/lib/Image/ExifTool/Import.pm line 202.
Deep recursion on subroutine "Image::ExifTool::JSON::ProcessTag" at ../Exiftool/Image-ExifTool-12.30/lib/Image/ExifTool/JSON.pm line 91.
Segmentation fault


Yes this is test data, yes, the priority is low, and this is where the enhancement suggestion does come in; would it be possible to have exiftool continue on errors, and have the option to log the errors details to a file?

The 2> error.txt 1> log.txt that I use, only captures the error, but not the file that is causing the error.

Thank you,

Hank

Phil Harvey

This is not a bug.  There is deep recursion in this file.  The arrays are nested 50000 deep in this file.

The fact that ExifTool gives a run-time error on this file doesn't bother me.  This file was manufactured specifically to do this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Hank

I gathered you'd say that about the test data.

Since I run exiftool in a highly automated setting, when things go south, they go really south and I gotta grab my shovel to find the file(s) that cause the problem.
Begin able to capture the file names that cause errors in the error out would be nice, continuing after an error would be the cherry on top of the ice-cream Sunday.

Thank you

Phil Harvey

The difficulty in figuring out which file caused the problem is because the filenames go to stdout and the warnings go to stderr?  [or the segfault problem, which I just noticed, see below]

I could add a patch for this specific warning, but I can manufacture lots of files that would give different runtime errors, and if I added patches for them all then ExifTool would get significantly more bloated and slower.

Hmmm.  I see you got a segfault.  I didn't notice that earlier.  Mine (MacOS) gives the deep-recursion warning but doesn't segfault.  I think I would need to limit the recursion level myself to be able to avoid this.  Just catching the warning and stuffing it into the Warning tag probably wouldn't be enough.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).