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

RangeError during parsing of some recent replays #53

Closed
jblanchette opened this issue Jun 4, 2020 · 4 comments
Closed

RangeError during parsing of some recent replays #53

jblanchette opened this issue Jun 4, 2020 · 4 comments

Comments

@jblanchette
Copy link

jblanchette commented Jun 4, 2020

👋 running into some new buffer out of bounds errors using latest 1.7.1 release

running on win10 with node version v12.16.0

full error message when calling W3GReplay.parse on the attached replay file

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
    at boundsError (internal/buffer.js:74:11)
    at Buffer.readInt8 (internal/buffer.js:414:5)
    at Parser.eval (eval at <anonymous> (eval at otherRunInContext (C:\Users\Jeff\Code\wc3v\node_modules\w3gjs\dist\W3GReplay.umd.js:2338:25)), <anonymous>:172:31)
    at Parser.eval [as compiled] (eval at <anonymous> (eval at otherRunInContext (C:\Users\Jeff\Code\wc3v\node_modules\w3gjs\dist\W3GReplay.umd.js:2338:25)), <anonymous>:174:12)
    at Parser.parse (C:\Users\Jeff\Code\wc3v\node_modules\w3gjs\dist\W3GReplay.umd.js:3064:25)
    at W3GReplay.ReplayParser.parse (C:\Users\Jeff\Code\wc3v\node_modules\w3gjs\dist\W3GReplay.umd.js:5039:89)
    at W3GReplay.parse (C:\Users\Jeff\Code\wc3v\node_modules\w3gjs\dist\W3GReplay.umd.js:5156:36)
    at C:\Users\Jeff\Code\wc3v\wc3v.js:53:29
    at Array.map (<anonymous>)
    at parseReplays (C:\Users\Jeff\Code\wc3v\wc3v.js:41:25) {
  code: 'ERR_BUFFER_OUT_OF_BOUNDS'
}

attached replay file in a zip folder. contains one file twistedmedows.w3g

twistedmedows.zip

@PBug90
Copy link
Owner

PBug90 commented Jun 5, 2020

Thank your for reporting. This error occurs if the extraPlayerList parser can not read to an end and just keeps going until EOF. This can also result in a stack overflow in the worst case.
You can pass Platform.Netease to prevent this for this particular replay.

#47 already fixed this issue, but it will take some more time for me to release it as Version 2.

@PBug90
Copy link
Owner

PBug90 commented Jun 5, 2020

Okay, it was pretty easy to apply the solution of #47 to the current master branch.

Once #54 is merged, your problem should be resolved regardless of whether you use Platform.Netease or Platform.BattleNet.

@jblanchette
Copy link
Author

thanks for the fast turn around 👍

using the 'netease' argument to parse allowed me to successfully parse the replay. I'll be sure to pull down the release when ready

@PBug90
Copy link
Owner

PBug90 commented Jun 7, 2020

Released as 1.7.2

@PBug90 PBug90 closed this as completed Jun 7, 2020
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

No branches or pull requests

2 participants