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

Error during debug on iOS: RangeError [ERR_BUFFER_OUT_OF_BOUNDS] #4293

Closed
rosen-vladimirov opened this issue Jan 16, 2019 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1.0 or 5.1.1-2019-01-11-12787
  • Cross-platform modules: Not applicable
  • Android Runtime: Not applicable
  • iOS Runtime: 5.1.0
  • Plugin(s): Not applicable

Describe the bug
During debug on iOS Device, sometimes an error is shown in CLI and the process exits:

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to write outside buffer bounds
    at boundsError (internal/buffer.js:51:11)
    at Buffer.readInt32BE (internal/buffer.js:365:5)
    at PacketStream._transform (/Users/username/workspace/CLI-master-tests-simulator-osx-yarn/node_modules/nativescript/lib/device-sockets/ios/packet-stream.js:11:39)
    at PacketStream.Transform._read (_stream_transform.js:190:10)
    at PacketStream.Transform._write (_stream_transform.js:178:12)
    at doWrite (_stream_writable.js:410:12)
    at writeOrBuffer (_stream_writable.js:394:5)
    at PacketStream.Writable.write (_stream_writable.js:294:11)
    at Socket.ondata (_stream_readable.js:666:20)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

The actual problem is that CLI parses some messages from iOS Runtime and tries to send them to device. However, in some cases the messages are received by CLI on chunks and in rare occasions it is unable to parse them.

To Reproduce

NOTE: Issue is hard to reproduce. We've reproduced it in Sidekick when trying to debug on iOS device.

  1. Start debug session on iOS device
  2. Execute some actions while device is locked.

Expected behavior
CLI should work correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant