provegard / ncdbg

A debugger for Nashorn that uses Chrome DevTools as frontend
BSD 3-Clause "New" or "Revised" License
31 stars 5 forks source link

frozen debugger #89

Closed benoitcerrina closed 6 years ago

benoitcerrina commented 6 years ago

Hello, today ncdbg froze, it has been reproducible with the exact same debugging sequence. The message in the console is: Message handling error for domain Runtime java.util.concurrent.TimeoutException: Timed out waiting for 'public abstract scala.collection.Seq com.programmaticallyspeaking.ncd.host.ScriptHost.getObjectPro perties(com.programmaticallyspeaking.ncd.host.ObjectId,boolean,boolean)({"id":"uid-8979"}, true, false)[3359]' to complete. I am attaching the log from the debugger which has much more details ncdbg.log

benoitcerrina commented 6 years ago

Another interesting thing is that this has to do with a specific place in the code. If I put a breakpoint there I have this error. I know our code won't help you much but I have added an extract. If I put the breakpoint at the line

NotificationUtil.hasAssigneeNotification2(lAssigneeNotification);

The freeze will occur. If I put it inside the hasAssigneeNotification2 method all is fine

if (options && options.notificationEnabled) { //fire notification var operationDetailsList = []; var operationDetails = {}; operationDetails.objectURI = versionURI; operationDetails.operation = 'updated'; operationDetailsList.push(operationDetails); exports.publishLiveUpdate(operationDetailsList); if (lAssigneeNotification.needed) { lAssigneeNotification.subjectURI = versionURI; //notify assignee try { delete lAssigneeNotification.needed; NotificationUtil.hasAssigneeNotification2(lAssigneeNotification); } catch (e) { print('exception trying to notify a user ' + e); } } }

provegard commented 6 years ago

Hm, closed by mistake?

I'll take a look. I'm away on conference and vacation for a week so please be patient.

benoitcerrina commented 6 years ago

No problem I am patient and you are responding quickly. I think this is a race condition between reading variables. If I keep my pointer away from the screen and wait for the "Local" tree to show the variables it doesn't freeze. It only froze when I was hovering above a variable while the Local tree was refreshing. I assume this issue is reproducible at this point because there are lots of locals to refresh or some specifics about the variable it is trying to display

provegard commented 6 years ago

I think the problem happens due to a cyclic reference somewhere in the property graph of lAssigneeNotification. Could that be true?

provegard commented 6 years ago

Or its prototype chain?

benoitcerrina commented 6 years ago

I will check but it will have to wait for monday, crisis came up at work

provegard commented 6 years ago

By the way, I noticed that the log file contains a lot of code, so you might want to remove it from the issue.

provegard commented 6 years ago

I did some changes to how object properties are extracted, so it should be faster now. Can you please re-test?

benoitcerrina commented 6 years ago

yes will do

benoitcerrina commented 6 years ago

Hello, just tested and it didn't freeze.
Regarding the content of lAssigneeNotification, there were no cyclicity

benoitcerrina commented 6 years ago

I am not sure if it is subjective but the debugger seems much faster now

provegard commented 6 years ago

Sounds good! Do you feel the issue has been resolved?

benoitcerrina commented 6 years ago

yes, closing.