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: parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 1, column 65 #373

Open
vt-alt opened this issue Dec 8, 2024 · 3 comments · May be fixed by #374
Assignees
Labels
bug Something isn't working

Comments

@vt-alt
Copy link

vt-alt commented Dec 8, 2024

Perhaps misformatted json output:

cpu_features-0.9.0$ /usr/bin/list_cpu_features --json | jq .
jq: parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 1, column 65
cpu_features-0.9.0$ /usr/bin/list_cpu_features --json | head -c66 | xxd
00000000: 7b22 6172 6368 223a 2278 3836 222c 2262  {"arch":"x86","b
00000010: 7261 6e64 223a 2249 6e74 656c 2852 2920  rand":"Intel(R)
00000020: 436f 7265 2854 4d29 2069 392d 3130 3930  Core(TM) i9-1090
00000030: 3020 4350 5520 4020 322e 3830 4748 7a06  0 CPU @ 2.80GHz.
00000040: 222c                                     ",

This is ^F (0x06) char in brand string.

@Mizux Mizux added the bug Something isn't working label Dec 9, 2024
@gchatelet gchatelet self-assigned this Dec 9, 2024
@gchatelet
Copy link
Collaborator

@vt-alt would you be able to run cpuid -1 -r and send us the resulting data?

@vt-alt
Copy link
Author

vt-alt commented Dec 9, 2024

$ cpuid -1 -r
CPU:
   0x00000000 0x00: eax=0x00000016 ebx=0x756e6547 ecx=0x6c65746e edx=0x49656e69
   0x00000001 0x00: eax=0x000a0655 ebx=0x0d200800 ecx=0x7ffafbff edx=0xbfebfbff
   0x00000002 0x00: eax=0x76036301 ebx=0x00f0b5ff ecx=0x00000000 edx=0x00c30000
   0x00000003 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000004 0x00: eax=0x3c004121 ebx=0x01c0003f ecx=0x0000003f edx=0x00000000
   0x00000004 0x01: eax=0x3c004122 ebx=0x01c0003f ecx=0x0000003f edx=0x00000000
   0x00000004 0x02: eax=0x3c004143 ebx=0x00c0003f ecx=0x000003ff edx=0x00000000
   0x00000004 0x03: eax=0x3c07c163 ebx=0x03c0003f ecx=0x00004fff edx=0x00000006
   0x00000004 0x04: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000005 0x00: eax=0x00000040 ebx=0x00000040 ecx=0x00000003 edx=0x11142120
   0x00000006 0x00: eax=0x000027f7 ebx=0x00000002 ecx=0x00000009 edx=0x00000000
   0x00000007 0x00: eax=0x00000000 ebx=0x029c67af ecx=0x40000018 edx=0xbc000600
   0x00000008 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000009 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x0000000a 0x00: eax=0x07300404 ebx=0x00000000 ecx=0x00000000 edx=0x00000603
   0x0000000b 0x00: eax=0x00000001 ebx=0x00000002 ecx=0x00000100 edx=0x0000000d
   0x0000000b 0x01: eax=0x00000005 ebx=0x00000014 ecx=0x00000201 edx=0x0000000d
   0x0000000b 0x02: eax=0x00000000 ebx=0x00000000 ecx=0x00000002 edx=0x0000000d
   0x0000000c 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x0000000d 0x00: eax=0x0000021f ebx=0x00000a88 ecx=0x00000a88 edx=0x00000000
   0x0000000d 0x01: eax=0x0000000f ebx=0x000003c8 ecx=0x00000100 edx=0x00000000
   0x0000000d 0x02: eax=0x00000100 ebx=0x00000240 ecx=0x00000000 edx=0x00000000
   0x0000000d 0x03: eax=0x00000040 ebx=0x000003c0 ecx=0x00000000 edx=0x00000000
   0x0000000d 0x04: eax=0x00000040 ebx=0x00000400 ecx=0x00000000 edx=0x00000000
   0x0000000d 0x08: eax=0x00000080 ebx=0x00000000 ecx=0x00000001 edx=0x00000000
   0x0000000d 0x09: eax=0x00000008 ebx=0x00000a80 ecx=0x00000000 edx=0x00000000
   0x0000000e 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x0000000f 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000010 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000011 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000012 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000012 0x01: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000012 0x02: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000013 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x00000014 0x00: eax=0x00000001 ebx=0x0000000f ecx=0x00000007 edx=0x00000000
   0x00000014 0x01: eax=0x02490002 ebx=0x003f3fff ecx=0x00000000 edx=0x00000000
   0x00000015 0x00: eax=0x00000002 ebx=0x000000ea ecx=0x00000000 edx=0x00000000
   0x00000016 0x00: eax=0x00000af0 ebx=0x00001450 ecx=0x00000064 edx=0x00000000
   0x20000000 0x00: eax=0x00000af0 ebx=0x00001450 ecx=0x00000064 edx=0x00000000
   0x80000000 0x00: eax=0x80000008 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x80000001 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000121 edx=0x2c100800
   0x80000002 0x00: eax=0x65746e49 ebx=0x2952286c ecx=0x726f4320 edx=0x4d542865
   0x80000003 0x00: eax=0x39692029 ebx=0x3930312d ecx=0x43203030 edx=0x40205550
   0x80000004 0x00: eax=0x382e3220 ebx=0x7a484730 ecx=0x00000000 edx=0x00000000
   0x80000005 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x80000006 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x01006040 edx=0x00000000
   0x80000007 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000100
   0x80000008 0x00: eax=0x00003027 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
   0x80860000 0x00: eax=0x00000af0 ebx=0x00001450 ecx=0x00000064 edx=0x00000000
   0xc0000000 0x00: eax=0x00000af0 ebx=0x00001450 ecx=0x00000064 edx=0x00000000

@gchatelet
Copy link
Collaborator

Ok so Brand String is stored in

   0x80000002 0x00: eax=0x65746e49 ebx=0x2952286c ecx=0x726f4320 edx=0x4d542865
   0x80000003 0x00: eax=0x39692029 ebx=0x3930312d ecx=0x43203030 edx=0x40205550
   0x80000004 0x00: eax=0x382e3220 ebx=0x7a484730 ecx=0x00000000 edx=0x00000000

Because Little Endian we have to swap integers in each register which gives the following hex sequence

496e7465 6c285229 20436f72 6528544d 29206939 2d313039 30302043 50552040 20322e38 3047487a 00000000 00000000

0x06 is clearly not ending this sequence so this is a bug for sure.
Let me dig into this.

gchatelet added a commit that referenced this issue Dec 10, 2024
@gchatelet gchatelet linked a pull request Dec 10, 2024 that will close this issue
gchatelet added a commit that referenced this issue Dec 10, 2024
gchatelet added a commit that referenced this issue Dec 10, 2024
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 a pull request may close this issue.

3 participants