question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

connection.js line 635 infinite loop

See original GitHub issue

I was using sequelize to connect to my postgres database. However, not paying attention, I didn’t configure the right port and username/password. That made my node.js app loop infinitely on this line. I figured this line out by using node debug .

break in node_modules/pg/lib/connection.js:635
 633 Connection.prototype.parseCString = function(buffer) {
 634   var start = this.offset;
>635   while(buffer[this.offset++] !== 0) { }
 636   return buffer.toString(this.encoding, start, this.offset - 1);
 637 };
debug> o
break in node_modules/pg/lib/connection.js:635
 633 Connection.prototype.parseCString = function(buffer) {
 634   var start = this.offset;
>635   while(buffer[this.offset++] !== 0) { }
 636   return buffer.toString(this.encoding, start, this.offset - 1);
 637 };
debug> o

I don’t experience any other issues If I use correct connection data, so this may be a potential bug, just pointing out this discovery.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
brianccommented, Aug 4, 2017

I wouldn’t consider it serious troubles. It only causes an issue if you connect the driver to something that isn’t postgres at all and that backend starts sending unexpected binary data back to the driver. Kinda like doing ‘curl’ on to the port postgres is running on: ain’t gonna work. 😯

I will absolutely accept a PR if it fixes bugs or addes enhancements, has tests, and seems reasonable!

1reaction
charmandercommented, Feb 8, 2017

This library isn’t built to handle malformed messages at all right now. This case can be fixed by using indexOf instead of a manual loop, but the built-in message parsers in general don’t attempt to detect errors. @brianc, would you be interested in changes to that end?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js connection pool produces infinite loop on error
I have purposely set the password wrong, and when testing, I get an infinite loop of "connection failed" errors - indicating something is ......
Read more >
Infinite redirect loop on access_denied error #635 - GitHub
When a user does not have permission to access an app (because no role was assigned to his account), an infinite login loop...
Read more >
How to Find the Exact Line of an Infinite Loop Bug in the code
In the Summary Tab, you can find the location of this method in the file. Sync Infinite Loop is located. Asynchronous Infinite Loops....
Read more >
How to get rid of Google keeping me in a infinite loop ... - Quora
I opened Walmart website and link Ibotta, started my order and after I put 3 items in my cart it wants me to...
Read more >
[FIX][LUMIA]Dead Phone,Bricked bootloader,infinite boot loop ...
In previous post I have posted about unlocking bootloader and enabling root access but what if you have bricked your lumia?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found