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

A careless bug can crash JXcore when using PSK #668

Open
yaronyg opened this Issue Mar 23, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@yaronyg
Member

yaronyg commented Mar 23, 2016

The Crash
Bad Code

I did a bad refactoring where the pskIdToSecret callback (which is eventually used as part of a psk Callback) had some unbounded variables inside of it (e.g. variables that weren't defined anywhere) and that caused JXcore to crash.

@cicorias

This comment has been minimized.

Show comment
Hide comment
@cicorias

cicorias Mar 23, 2016

Member

Where are you calling tls.creatserver. Help if you have a line #

Member

cicorias commented Mar 23, 2016

Where are you calling tls.creatserver. Help if you have a line #

@yaronyg

This comment has been minimized.

Show comment
Hide comment
@yaronyg

yaronyg Mar 24, 2016

Member

The function causing the crash is here. The problem was that I had screwed up a refactor and pskIdentity and pskKey were not bound to anything. in other words there was no declaration of either variable in any visible scope. Once I fixed that everything was fine. The createserver is called here

Another crash, I'm investigating now.

Member

yaronyg commented Mar 24, 2016

The function causing the crash is here. The problem was that I had screwed up a refactor and pskIdentity and pskKey were not bound to anything. in other words there was no declaration of either variable in any visible scope. Once I fixed that everything was fine. The createserver is called here

Another crash, I'm investigating now.

@yaronyg

This comment has been minimized.

Show comment
Hide comment
@yaronyg

yaronyg Mar 24, 2016

Member

The new crash btw is in different code. I'll share the code once I figure out what is going on.

Member

yaronyg commented Mar 24, 2016

The new crash btw is in different code. I'll share the code once I figure out what is going on.

@yaronyg

This comment has been minimized.

Show comment
Hide comment
@yaronyg

yaronyg Mar 24, 2016

Member

O.k. this crash was very similar to the first one. Another programming error from yours truly. IN this case the callback function was:

function (id) {
          return self.pskIdToSecret(id);
}

Where self.pskIdToSecret is undefined. That causes an immediate crash with full stack trace.

BTW, I don't consider this bug to be high priority. That's why it's in IceBox.

Member

yaronyg commented Mar 24, 2016

O.k. this crash was very similar to the first one. Another programming error from yours truly. IN this case the callback function was:

function (id) {
          return self.pskIdToSecret(id);
}

Where self.pskIdToSecret is undefined. That causes an immediate crash with full stack trace.

BTW, I don't consider this bug to be high priority. That's why it's in IceBox.

@cicorias

This comment has been minimized.

Show comment
Hide comment
@cicorias

cicorias Mar 24, 2016

Member

Ok. I'll just poke around in other native areas and see how they validate undefined callbacks or undefined values

Member

cicorias commented Mar 24, 2016

Ok. I'll just poke around in other native areas and see how they validate undefined callbacks or undefined values

@yaronyg yaronyg added 1 - Backlog and removed 0 - Icebox labels Jul 14, 2016

@yaronyg yaronyg assigned enricogior and unassigned cicorias Jul 14, 2016

@yaronyg yaronyg added bug and removed 1 - Backlog labels Oct 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment