ID 270590 - Segmentation fault / crash when running a onScriptClose Python script which evaluates a file knob from metadata

Follow

Problem summary
Segmentation fault / crash when running a onScriptClose Python script which evaluates a file knob from metadata

Customer reported version
nuke.10.5v2

Customer reported platform
centos6

Steps to reproduce

1) Download the attached files

2) Add the init.py and postScript.py to your .nuke directory

3) Open Nuke and open the Nuke script

4) On the Slate1 group node, goto Advanced Slate Controls> Font> Font: and set the path to a valid font file 

5) Save and close the script

6) Run the below command:

<NukePath>/<NukeVersion> -V 2 -F 1025 -x -<path/to/nuke/script.nk>
This will print:
 

Writing /shared/projects/rec709/delivery/test_1025.null

Writing /shared/projects/rec709/delivery/test_1025.null took 0.12 seconds

Frame 1025 (1 of 1)

 

Total render time: 0.12 seconds

Test Post Script

Source path evaluation: /shared/projects/[lindex [split [metadata exif/0/Model] ":"] 0]/delivery/test_%04d.null

Segmentation fault (core dumped)




Reproduced by support
This problem has been constantly reproduced on:
Nuke 10.5v2 - CentOS 6.8
Nuke 10.5v1 - CentOS 6.8
Nuke 10.0v6 - CentOS 6.8
Nuke 10.0v1 - CentOS 6.8
Nuke 9.0v9 - CentOS 6.8
Nuke 9.0v1 - CentOS 6.8

This problem has been sporadically reproduced on:
Nuke 10.5v2 - MacOSX 10.12 
Nuke 10.5v1 - MacOSX 10.12
Nuke 10.0v6 - MacOSX 10.12
Nuke 10.0v1 - MacOSX 10.12
Nuke 9.0v9 - MacOSX 10.12
Nuke 9.0v1 - MacOSX 10.12
Note: It did not Segmentation fault, it just hard crashed. It also didn't happen everytime, varying from every time to one in 20 times

This problem was not reproduced on:
Nuke 10.5v2 - Windows 10
Nuke 10.5v1 - Windows 10
Nuke 10.0v6 - Windows 10
Nuke 10.0v1 - Windows 10
Nuke 9.0v9 - Windows 10
Nuke 9.0v1 - Windows 10
Nuke 8.0v7 - Windows 10 - CentOS 6.8 - MacOSX 10.12

Expected behaviour
For Nuke to print the evaluated version of the file knob

Actual behaviour
Nuke crashed
 

    We're sorry to hear that

    Please tell us why