Possibly memory corruption after JSON.stringify or console.log of object with string cyrillic property
I have a weird behavior on BPM project, which I can only explain with memory corruption. I am trying to create a business process with "businessKey" attribute consisting of Cyrillic symbols. It is 100% valid for Camunda (verified). But UB fails BEFORE even sending http request to Camunda in the extremely weird place:
I have a line of code:
const request = http.request(opts)
The opts
does not even contain the "businessKey" attribute:
20190205 08470528 $ info BEFORE http.request(opts), opts= {"sendTimeout":30000,"receiveTimeout":30000,"keepAlive":true,"compressionEnable":true,"URL":"http://localhost:8080/camunda/api/engine/engine/default/case-definition/cmmn-test2:2:3220e2b4-2888-11e9-afa8-0242ac120009/create","method":"POST"}
Looks ok!
It works in one case and fails in another, while have exactly the same parameters.
Error message is:
{ "ClassName":"ESMException", "Address":"00000001000F760D ", "ErrorNum": 500, "Stack": "ClientRequest@http.js:242:3\nrequest@http.js:159:10\ncreateRequest@C:\\Users\\rumata\\Work\\nectain\\ub-app\\node_modules\\@unitybase\\bpm-camunda\\modules\\camundaConnection.js:268:21\njsonRequest@C:\\Users\\rumata\\Work\\nectain\\ub-app\\node_modules\\@unitybase\\bpm-camunda\\modules\\camundaConnection.js:247:21\ncreateCaseInstance@C:\\Users\\rumata\\Work\\nectain\\ub-app\\node_modules\\@unitybase\\bpm-camunda\\modules\\camundaConnection.js:530:22\ncreateCaseInstance@C:\\Users\\rumata\\Work\\nectain\\ub-app\\node_modules\\@unitybase\\bpm-camunda\\modules\\camundaBpmEngine.js:66:10\ncreateInstance@C:\\Users\\rumata\\Work\\nectain\\ub-app\\node_modules\\@unitybase\\bpm\\bpm.js:168:18\ncreateInstance@C:\\Users\\rumata\\Work\\nectain\\ub-app\\node_modules\\@unitybase\\bpm\\bpm_ProcessDefinition.js:255:39\n", "FileName": "http.js", "Line": 242, "Message": "winhttp.dll error 87 (The parameter is incorrect.)" }
There are 2 magic tricks, which makes it work:
This - works:
const aGoodObject = JSON.parse(JSON.stringify(opts))
const request = http.request(aGoodObject)
And if previously I comment a line of code, which logs cyrillic symbols to console - it works either.
This makes me think that internal memory representation of "opt" object is corrupt. I can help with reproduction of issue (or Olga can - this bug came from her).