{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/5333","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/5333/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/5333/comments","events_url":"https://api.github.com/repos/chef/chef/issues/5333/events","html_url":"https://github.com/chef/chef/issues/5333","id":177429269,"number":5333,"title":"Segmentation fault with chef-client 12.14.60 on Windows 2012R2","user":{"login":"rlaveycal","id":6595659,"avatar_url":"https://avatars.githubusercontent.com/u/6595659?v=3","gravatar_id":"","url":"https://api.github.com/users/rlaveycal","html_url":"https://github.com/rlaveycal","followers_url":"https://api.github.com/users/rlaveycal/followers","following_url":"https://api.github.com/users/rlaveycal/following{/other_user}","gists_url":"https://api.github.com/users/rlaveycal/gists{/gist_id}","starred_url":"https://api.github.com/users/rlaveycal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlaveycal/subscriptions","organizations_url":"https://api.github.com/users/rlaveycal/orgs","repos_url":"https://api.github.com/users/rlaveycal/repos","events_url":"https://api.github.com/users/rlaveycal/events{/privacy}","received_events_url":"https://api.github.com/users/rlaveycal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chef/chef/labels/Windows","name":"Windows","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-16T13:44:53Z","updated_at":"2016-09-20T11:33:56Z","closed_at":"2016-09-20T11:33:56Z","body":"## Description\r\n\r\nI have a custom resource that creates a Windows share using win32ole (pull request is [here](https://github.com/chef-cookbooks/windows/pull/282)). It does the following\r\n\r\n```\r\nrequire 'win32ole'\r\nwmi = WIN32OLE.connect(\"winmgmts://\")\r\nshare = wmi.get(\"Win32_Share\")\r\nr = share.create('c:\\', 'my_share', 0, 16777216, 'test', nil, nil)\r\n```\r\n\r\nwhich results in\r\n```\r\n[BUG] Segmentation fault\r\nruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]\r\n-- Control frame information -----------------------------------------------\r\nc:0041 p:---- s:0171 e:000170 CFUNC  :method_missing\r\nc:0040 p:0102 s:0160 e:000159 METHOD C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/ctn-infrastructure/providers/share.rb:145\r\n```\r\n\r\nIt's the call to create() that cause the fault.\r\n\r\nIt works with chef-client 12.13.37\r\n\r\n## Chef Version\r\n\r\n12.14.60\r\n\r\n## Platform Version\r\n\r\nWindows 2012R2\r\n\r\n## Replication Case\r\n\r\nPut the above script in a block and execute, or use the referenced pull request\r\n\r\n## Client Output\r\n\r\nhttps://gist.github.com/rlaveycal/7d0593864aeb5826054ba11353fd9d44\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/248275993","html_url":"https://github.com/chef/chef/issues/5333#issuecomment-248275993","issue_url":"https://api.github.com/repos/chef/chef/issues/5333","id":248275993,"user":{"login":"rlaveycal","id":6595659,"avatar_url":"https://avatars.githubusercontent.com/u/6595659?v=3","gravatar_id":"","url":"https://api.github.com/users/rlaveycal","html_url":"https://github.com/rlaveycal","followers_url":"https://api.github.com/users/rlaveycal/followers","following_url":"https://api.github.com/users/rlaveycal/following{/other_user}","gists_url":"https://api.github.com/users/rlaveycal/gists{/gist_id}","starred_url":"https://api.github.com/users/rlaveycal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlaveycal/subscriptions","organizations_url":"https://api.github.com/users/rlaveycal/orgs","repos_url":"https://api.github.com/users/rlaveycal/repos","events_url":"https://api.github.com/users/rlaveycal/events{/privacy}","received_events_url":"https://api.github.com/users/rlaveycal/received_events","type":"User","site_admin":false},"created_at":"2016-09-20T11:33:56Z","updated_at":"2016-09-20T11:33:56Z","body":"You're right - this is a win32ole bug on x64. The issue is with the 3rd to last string parameter (which is the share's description). If this is `''` then you get the fault. Set to `nil` or any other value and it works\r\n\r\nFor reference this causes the issue:\r\n```\r\n\\opscode\\chef\\embedded\\bin\\ruby -rwin32ole -e 'wmi = WIN32OLE.connect(\"winmgmts://\"); share = wmi.get(\"Win32_Share\"); puts share.create(\"c:\\\\test2\", \"test\", 0, 16777216, \"\", nil, nil)'\r\n```\r\n\r\nI've closed this issue and I'll raise a bug on Ruby.\r\n"}}
{"actor":{"display_login":"rlaveycal"}}