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

jq-win32.exe 1.5 crashes with 38+ chars filenames #1205

Closed
dolmen opened this issue Aug 11, 2016 · 11 comments
Closed

jq-win32.exe 1.5 crashes with 38+ chars filenames #1205

dolmen opened this issue Aug 11, 2016 · 11 comments

Comments

@dolmen
Copy link

dolmen commented Aug 11, 2016

With jq-win32.exe 1.5 on Windows 10 64 bits, jq crashes when the path to a jq script given with the -f option is at 62 characters or more (may be also if a bit less longer, I've not yet strictly tested the limit). If the path is somewhat shorter, everything is fine.

Update: the practical limit is discovered: maximum 37 chars

@dolmen dolmen changed the title jq-win32.exe 1.5 crashes with 62 chars filename given with -f jq-win32.exe 1.5 crashes with 62+ chars filenames Aug 11, 2016
@dolmen
Copy link
Author

dolmen commented Aug 11, 2016

The crash also occurs for "long" input file paths.
This seems to be a general very low limit on file paths.

@dolmen
Copy link
Author

dolmen commented Aug 11, 2016

Here is the simple command to reproduce the issue:

jq-win32 . abcdefghijklmnopqrstuvwxyz012345678901

The crash does not happen when I remove the last '1'. So the maximum allowed length for a file path is 37 chars. Really short, isn't it?

@dolmen dolmen changed the title jq-win32.exe 1.5 crashes with 62+ chars filenames jq-win32.exe 1.5 crashes with 38 chars filenames Aug 11, 2016
@dolmen dolmen changed the title jq-win32.exe 1.5 crashes with 38 chars filenames jq-win32.exe 1.5 crashes with 38+ chars filenames Aug 11, 2016
@Coolthulhu
Copy link

Same thing seems to happen to 64 bit version, on Windows 7:

jq-win64.exe . abcdefghijklmnopqrstuvwxyz0123456789
Segmentation fault

@mmendelson222
Copy link

Seems to still be a problem on Win 64 (ver. 1.5).

@Hrxn
Copy link

Hrxn commented Feb 14, 2017

Yes, same here.

@nicowilliams
Copy link
Contributor

Can you try master?

@Hrxn
Copy link

Hrxn commented Feb 22, 2017

Didn't try git master, pulled a build from here:
https://ci.appveyor.com/project/stedolan/jq/build/1.0.88

This one actually works, no crash with really long filenames anymore..
(x64 build)

@adam-c-anderson
Copy link

I just installed jq today from Chocolatey and had this exact problem. Is the fix not yet published? It's been nearly a year since last activity on this issue.

@pkoppstein
Copy link
Contributor

pkoppstein commented Jan 10, 2018

Is the fix not yet published?

You can obtain a more recent Windows version (compiled) following the directions here:
https://github.com/stedolan/jq/wiki/Installation#windows-using-appveyor

@Alanscut
Copy link
Contributor

hi @dolmen
This bug has been fixed in the mater branch, you can try it again.

jq-version : master

# ./jq/jq.exe . test12345678974add_faq0000000wqweqacffaf
{
  "A": 1
}

@itchyny
Copy link
Contributor

itchyny commented Jun 3, 2023

Looks like fixed in the master branch, closing the issue.

@itchyny itchyny closed this as completed Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants