Skip to content

core dump on finding a record in the callback of writing #6

@tangthth

Description

@tangthth

Issue Description:

Core dump occurs when finding a record in the callback of writing. The script aborted and core dump file generated, but no any error message reported.

Reproduce Step:

  1. write a nodejs script as below to write a record and in its callback find the record
  2. execute the script

Logs:

/u/usra/myscripts:>node test_vsam.js
Writing record done. Record key: 00001
/u/usra/myscripts:>ls -l
total 635968
-rw------- 1 USRA GRPA 162689280 Aug 23 10:00 coredump.01010453
-rw-r----- 1 USRA GRPA 192 Aug 10 06:37 schema.json
-rw-r----- 1 USRA GRPA 8286 Aug 23 10:00 test_vsam.js
/u/usra/myscripts:>file coredump.01010453
coredump.01010453: binary data
/u/tangth/myscripts:>file -i coredump.01010453
coredump.01010453: regular file

Reference:

vsamObj.write(recordx, function(err) {
	if (err !=null)	{
		console.log("Error in writing Record.  Record Key: " + recordx.key)
		console.error("The Error is: " + err)
	}
    else {
		console.log("Writing record done.  Record key: " + recordx.key)
				
		vsamObj.find(recordx.key, function(record,err) {		    
			console.log("Entering the callback of vsamObj.find().")
			if (err != null ) {
				console.log("Error in finding the record by key: " + recordx.key)
				console.error("The Error is: " + err)
			}	
			else {
				console.log("Found record key: " + record.key + ", record name: " + record.name + ", record gender: " + record.gender)		
			}				
		})
	}
}) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions