epics-modules / autosave

APS BCDA synApps module: autosave
https://epics-modules.github.io/autosave/
Other
8 stars 31 forks source link

Manual save results in file descriptor left open #57

Closed daykin closed 8 months ago

daykin commented 8 months ago

Describe the issue When a manual configuration is saved via write to saveConfig.PROC PV, a new file descriptor stays open after completion.

Steps to reproduce

  1. Create a manual save set with create_manual_set("myReqFile.req", "macro1=value1...,...")
  2. Load configMenu.db to control the save set with dbLoadRecords
  3. enter a configName for, e.g. config1, "my_config"
  4. Save the config

Expected behaivour Saving succeeds and tears down file descriptors after writing

Actual behaviour One file descriptor remains open forever after writing.

Build Environment Architecture: linux-x86_64-debug Epics Base Version: 7.0.7-1 Dependent Module Versions: autosave 5-10-2

Autosave debug output

manual_save: request_file='TISCamMenu.req', save_file='TISCam_ioc_strscam2_rec.cfg',
callbackFunction=0x7fb024fa6ecd, puserPvt=0x56025ffabdf0 save_restore task: manual save('TISCam_ioc_strscam2_rec.cfg')
save_restore:makeNfsPath: dest='/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg'
dbrestore:myFileCopy: copying '/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg' to '/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg_231205-133733'
write_save_file: saving to /mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg
save_restore:check_file: tmpstr='
'
save_restore:check_file: tmpstr='<END>'
save_restore: op_SaveFile: write_save_file() returned 0

asVerify: buffer '# autosave R5.3   Automatically generated - DO
NOT MODIFY - 231205-133733
'

asVerify: buffer 'FS1_STRS:CAM_N0002:TISCamMenu:currName ioc-strscam2- rec '

asVerify: PVname='FS1_STRS:CAM_N0002:TISCamMenu:currName',
value_string[16]='ioc-strscam2-rec'
'FS1_STRS:CAM_N0002:TISCamMenu:currName' native field_type=0
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:TISCamMenu:currName ioc-strscam2- rec '

asVerify: PVname='FS1_STRS:CAM_N0002:TISCamMenu:currName',
value_string[16]='ioc-strscam2-rec'
'FS1_STRS:CAM_N0002:TISCamMenu:currName' native field_type=0
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:TISCamMenu:currDesc
'

asVerify: PVname='FS1_STRS:CAM_N0002:TISCamMenu:currDesc',
value_string[16]='ioc-strscam2-rec'
'FS1_STRS:CAM_N0002:TISCamMenu:currDesc' native field_type=0
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:TISCamMenu:enableSave 1 '

asVerify: PVname='FS1_STRS:CAM_N0002:TISCamMenu:enableSave',
value_string[1]='1'
'FS1_STRS:CAM_N0002:TISCamMenu:enableSave' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:FrameRateEnable 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:FrameRateEnable',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:FrameRateEnable' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ExposureMode 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ExposureMode',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ExposureMode' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ExposureAuto 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ExposureAuto',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ExposureAuto' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:GainAuto 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:GainAuto',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:GainAuto' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:PixelFormat 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:PixelFormat',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:PixelFormat' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:BinX 1 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:BinX', value_string[1]='1'
'FS1_STRS:CAM_N0002:cam1:BinX' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:BinY 1 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:BinY', value_string[1]='1'
'FS1_STRS:CAM_N0002:cam1:BinY' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:MinX 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:MinX', value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:MinX' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:MinY 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:MinY', value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:MinY' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:SizeX 2048 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:SizeX',
value_string[4]='2048'
'FS1_STRS:CAM_N0002:cam1:SizeX' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:SizeY 1536 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:SizeY',
value_string[4]='1536'
'FS1_STRS:CAM_N0002:cam1:SizeY' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ReverseX 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ReverseX',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ReverseX' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ReverseY 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ReverseY',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ReverseY' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:AcquireTime 0.5 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:AcquireTime',
value_string[3]='0.5'
'FS1_STRS:CAM_N0002:cam1:AcquireTime' native field_type=6
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=6,elements=1, storageBytes=8

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:AcquirePeriod 0.5 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:AcquirePeriod',
value_string[3]='0.5'
'FS1_STRS:CAM_N0002:cam1:AcquirePeriod' native field_type=6
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=6,elements=1, storageBytes=8

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:Gain 48 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:Gain', value_string[2]='48'
'FS1_STRS:CAM_N0002:cam1:Gain' native field_type=6
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=6,elements=1, storageBytes=8

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:FrameType 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:FrameType',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:FrameType' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ImageMode 2 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ImageMode',
value_string[1]='2'
'FS1_STRS:CAM_N0002:cam1:ImageMode' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:TriggerMode 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:TriggerMode',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:TriggerMode' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:NumExposures 1 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:NumExposures',
value_string[1]='1'
'FS1_STRS:CAM_N0002:cam1:NumExposures' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:NumImages 1 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:NumImages',
value_string[1]='1'
'FS1_STRS:CAM_N0002:cam1:NumImages' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ShutterMode 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ShutterMode',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ShutterMode' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ShutterOpenDelay 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ShutterOpenDelay',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ShutterOpenDelay' native field_type=6
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=6,elements=1, storageBytes=8

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ShutterCloseDelay 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ShutterCloseDelay',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ShutterCloseDelay' native field_type=6
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=6,elements=1, storageBytes=8

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ShutterOpenEPICS.OUT
'

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ShutterOpenEPICS.OUT',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ShutterOpenEPICS.OUT' native field_type=0
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ShutterCloseEPICS.OUT
'

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ShutterCloseEPICS.OUT',
value_string[0]=''
'FS1_STRS:CAM_N0002:cam1:ShutterCloseEPICS.OUT' native field_type=0
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ShutterOpenEPICS.OCAL 1 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ShutterOpenEPICS.OCAL',
value_string[1]='1'
'FS1_STRS:CAM_N0002:cam1:ShutterOpenEPICS.OCAL' native field_type=0
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ShutterCloseEPICS.OCAL 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ShutterCloseEPICS.OCAL',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ShutterCloseEPICS.OCAL' native field_type=0
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:Temperature 25 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:Temperature',
value_string[2]='25'
'FS1_STRS:CAM_N0002:cam1:Temperature' native field_type=6
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=6,elements=1, storageBytes=8

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ReadStatus.SCAN 0 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ReadStatus.SCAN',
value_string[1]='0'
'FS1_STRS:CAM_N0002:cam1:ReadStatus.SCAN' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ARPacketResendEnable 1 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ARPacketResendEnable',
value_string[1]='1'
'FS1_STRS:CAM_N0002:cam1:ARPacketResendEnable' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ARConvertPixelFormat 1 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ARConvertPixelFormat',
value_string[1]='1'
'FS1_STRS:CAM_N0002:cam1:ARConvertPixelFormat' native field_type=3
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=1,elements=1, storageBytes=2

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ARPacketTimeout 20000 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ARPacketTimeout',
value_string[5]='20000'
'FS1_STRS:CAM_N0002:cam1:ARPacketTimeout' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer 'FS1_STRS:CAM_N0002:cam1:ARFrameRetention 100000 '

asVerify: PVname='FS1_STRS:CAM_N0002:cam1:ARFrameRetention',
value_string[6]='100000'
'FS1_STRS:CAM_N0002:cam1:ARFrameRetention' native field_type=5
asVerify: is_scalar=1, is_scalar_in_file=1, is_long_string=0 asVerify:type=0,elements=1, storageBytes=40

asVerify: buffer '<END>
'

asVerify: PVname='<END>', value_string[6]='100000'
save_restore: manual save status=0 (0==success)

gdb breakpoints on fopen and fclose after triggering

Thread 127 "save_restore" hit Breakpoint 1, _IO_new_fopen
(filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg", mode=0x7fb024fae39b "rb") at
./libio/iofopen.c:86
86  ./libio/iofopen.c: No such file or directory.
(gdb) bt
#0  _IO_new_fopen (filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg", mode=0x7fb024fae39b "rb") at
./libio/iofopen.c:86
#1  0x00007fb024f9eabd in write_save_file (plist=0x560261caf180,
configName=0x7faf45e68d74 "TISCam_ioc_strscam2_rec.cfg",
retSaveFile=0x7faf45e68c70 "") at ../save_restore.c:2101
#2  0x00007fb024f9b8d7 in save_restore () at ../save_restore.c:1312
#3  0x00007fb024ae37cb in start_routine (arg=0x56025fe8e720) at
../osi/os/posix/osdThread.c:441
#4  0x00007fb024926044 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#5  0x00007fb0249a65fc in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

----------
Thread 127 "save_restore" hit Breakpoint 1, _IO_new_fopen
(filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg", mode=0x7fb024fab0d4 "rb") at
./libio/iofopen.c:86
86  in ./libio/iofopen.c
(gdb) bt
#0  _IO_new_fopen (filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg", mode=0x7fb024fab0d4 "rb") at
./libio/iofopen.c:86
#1  0x00007fb024f921ad in myFileCopy (source=0x7faf45e68a40 "/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg",
dest=0x7faf45e68930 "/mnt/iocdata/autosave/diag-
strscam2/TISCam_ioc_strscam2_rec.cfg_231205-131000") at
../dbrestore.c:173
#2  0x00007fb024f9ebd6 in write_save_file (plist=0x560261caf180,
configName=0x7faf45e68d74 "TISCam_ioc_strscam2_rec.cfg",
retSaveFile=0x7faf45e68c70 "") at ../save_restore.c:2106
#3  0x00007fb024f9b8d7 in save_restore () at ../save_restore.c:1312
#4  0x00007fb024ae37cb in start_routine (arg=0x56025fe8e720) at
../osi/os/posix/osdThread.c:441
#5  0x00007fb024926044 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#6  0x00007fb0249a65fc in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb)
------------------------------
Thread 127 "save_restore" hit Breakpoint 1, _IO_new_fopen
(filename=0x7faf45e68930 "/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg_231205-131000",
mode=0x7fb024fab107 "wb") at ./libio/iofopen.c:86
86  in ./libio/iofopen.c
(gdb) bt
#0  _IO_new_fopen (filename=0x7faf45e68930 "/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg_231205-131000",
mode=0x7fb024fab107 "wb") at ./libio/iofopen.c:86
#1  0x00007fb024f9223c in myFileCopy (source=0x7faf45e68a40 "/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg",
dest=0x7faf45e68930 "/mnt/iocdata/autosave/diag-
strscam2/TISCam_ioc_strscam2_rec.cfg_231205-131000") at
../dbrestore.c:185
#2  0x00007fb024f9ebd6 in write_save_file (plist=0x560261caf180,
configName=0x7faf45e68d74 "TISCam_ioc_strscam2_rec.cfg",
retSaveFile=0x7faf45e68c70 "") at ../save_restore.c:2106
#3  0x00007fb024f9b8d7 in save_restore () at ../save_restore.c:1312
#4  0x00007fb024ae37cb in start_routine (arg=0x56025fe8e720) at
../osi/os/posix/osdThread.c:441
#5  0x00007fb024926044 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#6  0x00007fb0249a65fc in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
---------------------------------------------------
Thread 127 "save_restore" hit Breakpoint 2, _IO_new_fclose
(fp=0x7faf6409cec0) at ./libio/iofclose.c:48
48  ./libio/iofclose.c: No such file or directory.
(gdb) bt
#0  _IO_new_fclose (fp=0x7faf6409cec0) at ./libio/iofclose.c:48
#1  0x00007fb024f922eb in myFileCopy (source=0x7faf45e68a40 "/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg",
dest=0x7faf45e68930 "/mnt/iocdata/autosave/diag-
strscam2/TISCam_ioc_strscam2_rec.cfg_231205-131000") at
../dbrestore.c:198
#2  0x00007fb024f9ebd6 in write_save_file (plist=0x560261caf180,
configName=0x7faf45e68d74 "TISCam_ioc_strscam2_rec.cfg",
retSaveFile=0x7faf45e68c70 "") at ../save_restore.c:2106
#3  0x00007fb024f9b8d7 in save_restore () at ../save_restore.c:1312
#4  0x00007fb024ae37cb in start_routine (arg=0x56025fe8e720) at
../osi/os/posix/osdThread.c:441
#5  0x00007fb024926044 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#6  0x00007fb0249a65fc in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) 

---------------------------------------------------
Thread 127 "save_restore" hit Breakpoint 2, _IO_new_fclose
(fp=0x7faf64104a50) at ./libio/iofclose.c:48
48  in ./libio/iofclose.c
(gdb) bt
#0  _IO_new_fclose (fp=0x7faf64104a50) at ./libio/iofclose.c:48
#1  0x00007fb024f92324 in myFileCopy (source=0x7faf45e68a40 "/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg",
dest=0x7faf45e68930 "/mnt/iocdata/autosave/diag-
strscam2/TISCam_ioc_strscam2_rec.cfg_231205-131000") at
../dbrestore.c:203
#2  0x00007fb024f9ebd6 in write_save_file (plist=0x560261caf180,
configName=0x7faf45e68d74
"TISCam_ioc_strscam2_rec.cfg", retSaveFile=0x7faf45e68c70 "") at
../save_restore.c:2106
#3  0x00007fb024f9b8d7 in save_restore () at ../save_restore.c:1312
#4  0x00007fb024ae37cb in start_routine (arg=0x56025fe8e720) at
../osi/os/posix/osdThread.c:441
#5  0x00007fb024926044 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#6  0x00007fb0249a65fc in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
-------------------------------------------------------
Thread 127 "save_restore" hit Breakpoint 2, _IO_new_fclose
(fp=0x7faf64104a50) at ./libio/iofclose.c:48
48  in ./libio/iofclose.c
(gdb) bt
#0  _IO_new_fclose (fp=0x7faf64104a50) at ./libio/iofclose.c:48
#1  0x00007fb024f9e0b7 in write_it (filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg",
plist=0x560261caf180) at ../save_restore.c:1950
#2  0x00007fb024f9ec1b in write_save_file (plist=0x560261caf180,
configName=0x7faf45e68d74 "TISCam_ioc_strscam2_rec.cfg",
retSaveFile=0x7faf45e68c70 "") at ../save_restore.c:2112
#3  0x00007fb024f9b8d7 in save_restore () at ../save_restore.c:1312
#4  0x00007fb024ae37cb in start_routine (arg=0x56025fe8e720) at
../osi/os/posix/osdThread.c:441
#5  0x00007fb024926044 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#6  0x00007fb0249a65fc in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb)
--------------------------------------------------------------
Thread 127 "save_restore" hit Breakpoint 1, _IO_new_fopen
(filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg", mode=0x7fb024face29 "r") at
./libio/iofopen.c:86
86  ./libio/iofopen.c: No such file or directory.
(gdb) bt
#0  _IO_new_fopen (filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag- strscam2/TISCam_ioc_strscam2_rec.cfg", mode=0x7fb024face29 "r") at
./libio/iofopen.c:86
#1  0x00007fb024f9d0a7 in check_file (file=0x7faf45e68a40
"/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg") at
../save_restore.c:1685
#2  0x00007fb024f9e129 in write_it (filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg",
plist=0x560261caf180) at ../save_restore.c:1960
#3  0x00007fb024f9ec1b in write_save_file (plist=0x560261caf180,
configName=0x7faf45e68d74 "TISCam_ioc_strscam2_rec.cfg",
retSaveFile=0x7faf45e68c70 "") at ../save_restore.c:2112
#4  0x00007fb024f9b8d7 in save_restore () at ../save_restore.c:1312
#5  0x00007fb024ae37cb in start_routine (arg=0x56025fe8e720) at
../osi/os/posix/osdThread.c:441
#6  0x00007fb024926044 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#7  0x00007fb0249a65fc in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb)
--------------------------------------------------------------
(gdb) bt
#0  _IO_new_fclose (fp=0x7faf64104a50) at ./libio/iofclose.c:48
#1  0x00007fb024f9d299 in check_file (file=0x7faf45e68a40
"/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg") at
../save_restore.c:1720
#2  0x00007fb024f9e129 in write_it (filename=0x7faf45e68a40 "/mnt/iocdata/autosave/diag-strscam2/TISCam_ioc_strscam2_rec.cfg",
plist=0x560261caf180) at ../save_restore.c:1960
#3  0x00007fb024f9ec1b in write_save_file (plist=0x560261caf180,
configName=0x7faf45e68d74 "TISCam_ioc_strscam2_rec.cfg",
retSaveFile=0x7faf45e68c70 "") at ../save_restore.c:2112
#4  0x00007fb024f9b8d7 in save_restore () at ../save_restore.c:1312
#5  0x00007fb024ae37cb in start_routine (arg=0x56025fe8e720) at
../osi/os/posix/osdThread.c:441
#6  0x00007fb024926044 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#7  0x00007fb0249a65fc in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) 
daykin commented 8 months ago

Ah, I found the issue and see that it's been fixed in newer versions. https://github.com/epics-modules/autosave/commit/9630b00ba23f784b639eea8e527439fbb8b012ec