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

Ar.Next() error: strconv.Atoi: parsing \"\": invalid syntax #129

Open
rgmz opened this issue Jun 6, 2024 · 1 comment · May be fixed by #130
Open

Ar.Next() error: strconv.Atoi: parsing \"\": invalid syntax #129

rgmz opened this issue Jun 6, 2024 · 1 comment · May be fixed by #130

Comments

@rgmz
Copy link

rgmz commented Jun 6, 2024

When attempting to read *.a files, an error is occasionally encountered:

strconv.Atoi: parsing \"\": invalid syntax

The source of this is Ar.Read > parseArEntry > toDecimal. It seems that one of the values is empty, resulting in an error.

  1. entry, err := parseArEntry(line)
  2. intValue, err := toDecimal(value)
  3. out, err := strconv.Atoi(stream)

This can be reproduced with the following file: https://github.com/openshift/ci-operator-prowgen/blob/ee31ec067b4670222de32ceecd01184b4eb52db3/vendor/golang.org/x/tools/go/gccgoexportdata/testdata/long.a

@rgmz
Copy link
Author

rgmz commented Jun 6, 2024

Based on my own debugging, the failing line is:

47 47 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 51 50 32 32 32 32 32 32 32 32 96 10

For that line, the OwnerID, GroupID , and Timestamp are all empty space.

Full output:

Reading line: [47 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 49 52 55 56 55 49 51 54 52 50 32 32 48 32 32 32 32 32 48 32 32 32 32 32 48 32 32 32 32 32 32 32 52 32 32 32 32 32 32 32 32 32 96 10]
Reading target: Timestamp, value is: '[49 52 55 56 55 49 51 54 52 50 32 32]', int value: 1478713642
Reading target: OwnerID, value is: '[48 32 32 32 32 32]', int value: 0
Reading target: GroupID, value is: '[48 32 32 32 32 32]', int value: 0
Reading target: Size, value is: '[52 32 32 32 32 32 32 32 32 32]', int value: 4

Reading line: [47 47 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 51 50 32 32 32 32 32 32 32 32 96 10]
Reading target: Size, value is: '[51 50 32 32 32 32 32 32 32 32]', int value: 32
error reading entry: strconv.Atoi: parsing "": invalid syntax

@rgmz rgmz linked a pull request Jun 6, 2024 that will close this issue
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 a pull request may close this issue.

1 participant