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

Normal index 303 is out of bounds -causing socket hung and memory issue #287

Open
PatidarVk opened this issue Mar 20, 2023 · 1 comment
Open

Comments

@PatidarVk
Copy link

Error
at new RuntimeError (D:\workdir\AllTranslators\new\obj2glb-translator\node_modules\cesium\Build\CesiumUnminified\index.cjs:14950:11)
at createVertex (D:\workdir\AllTranslators\new\obj2glb-translator\node_modules\obj2gltf\lib\loadObj.js:233:15)
at addVertex (D:\workdir\AllTranslators\new\obj2glb-translator\node_modules\obj2gltf\lib\loadObj.js:260:7)
at addFace (D:\workdir\AllTranslators\new\obj2glb-translator\node_modules\obj2gltf\lib\loadObj.js:374:23)
at parseLine (D:\workdir\AllTranslators\new\obj2glb-translator\node_modules\obj2gltf\lib\loadObj.js:482:11)
at Interface.callbackWrapper (D:\workdir\AllTranslators\new\obj2glb-translator\node_modules\obj2gltf\lib\readLines.js:30:11)
at Interface.emit (events.js:400:28)
at Interface._onLine (readline.js:434:10)
at Interface._normalWrite (readline.js:588:12)
at ReadStream.ondata (readline.js:246:10)
at ReadStream.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:293:12)
at readableAddChunk (internal/streams/readable.js:267:9)
at ReadStream.Readable.push (internal/streams/readable.js:206:10)
at internal/fs/streams.js:190:14
at FSReqCallback.wrapper [as oncomplete] (fs.js:563:5)
model.zip

The fix is to close the linereader in file /lib/readline.js line no. 32
function readLines(path, callback) {
const stream = fsExtra.createReadStream(path);
return events.once(stream, "open").then(function () {
return new Promise(function (resolve, reject) {
stream.on("error", reject);
stream.on("end", resolve);
const lineReader = readline.createInterface({
input: stream,
});

  const callbackWrapper = function (line) {
    try {
      callback(line);
    } catch (error) {
      lineReader.close();
      reject(error);
    }
  };

  lineReader.on("line", callbackWrapper);

});

});
}

@Apidcloud
Copy link

I have the exact same issue with the following file. It's causing the socket to hang.
faulty.obj.zip

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