-
Notifications
You must be signed in to change notification settings - Fork 170
chefspec and segmentation fault using chefdk 0.2.0 on windows 7 #171
Comments
Can provide specs and recipes if necessary. |
backtrace has ffi-yajl 0.2.0, the current version is 1.1.0 if upgrading doesn't fix it, then there's two known issues which will dump core: and both of those cases are probably bugs in the code that is feeding input to the parser, the coredump is just a particularly ugly error message. |
Tried upping to 1.1.0 - same error. |
@carpnick When you upgraded, did the |
Yes it showed the new version. I actually uninstalled the previous version .2.0 to make sure it wasn't being used. I will give the new chefdk a try when it comes out. |
Using 0.3.0 I am getting a really weird behavior. When I set the RSPEC config to debug level logging I see this basic output(Condensed to part where it fails)
The line 464 in Client.rb: !File.exists?(path) || (Dir.entries(path).size <= 2) Without debug logging....
Line 155 from common.rb: Parser.new(source, opts).parse |
@lamont-granquist can you check this out related to ffi-yajl ? |
There's a couple of known segfaulting issues with ffi-yajl that it might be, i can't tell from the backtraces what is causing it though, i need the inputs. |
Did a bit more debugging. Not sure if this helps. I went into : fauxhai-2.2.0/lib/fauxhai/mocker.rb:56 and I noticed it was calling : JSON.parse( File.read(filepath) ) So I started separating the File and JSON calls and I noticed it randomly failing sometimes on the read and sometimes within JSON.parse. So I went a bit further and made a local modification in the same spot like this: puts 'Running GC.start' Now it always segment faults out of GC.start. So then I tried testing the theory with a quick script I wrote (I started writing all the files json to my own temp files named 1 to 4): The above worked every time I ran it. BTW we are basically re-reading 2008R2.json from the fauxhai data: http://www.speedyshare.com/UsHVK/Temp.zip |
So these are known segfaults in the parser:
If its something different, then I'm suspicious that the GC in the 2.0.0 ruby that we're using on windows is buggy because we're not seeing these kinds of reports on 1.9.3 in chef-client or on 2.1.2/2.1.3 in chef-dk on unix. I've also built Chef 12 on ruby 2.1.2 as an omnibus package and run it through our spec tests which pretty reliably abuse the parser incessantly and used to cause coredumps in the past and haven't been seeing coredumps. We can't upgrade windows to 2.1.3 right now because of a problem with the ffi gem on windows with 2.1.3 though. |
I would agree with this assessment. The fact that a GC.start call always fails either means the GC is trying to free memory still in use by one of the c extensions or the GC itself is buggy on windows. Next steps - wait for ruby upgrade at this point? I assume we arent seeing reports about this because few windows cookbooks have unit tests? |
Yeah, debugging GC crashes is a large yak shave. If its just ruby 2.0.0 being problematic and 2.1.3 will fix it, then its a waste of time to try to track it down. If it replicates on ruby 1.9.3 on windows, or on any of the unix platforms, that'd be more disconcerting. Unfortunately, right now upgrading to 2.1.3 on windows is a different kind of yak shave where everyone with a precompiled windows gem needs to be bugged to upgrade (ffi, win32-api, etc) and that is all outside of our control. |
chefspec works for me under the following:
If you're still having this issue then perhaps I can try to replicate with your code. |
unable to reproduce this on Win 7 with ChefDK 0.3.5. |
I suspect that either a JSON gem bump, monkey patch fixes for ffi-yajl or something else might have fixed this. If this can still be reproduced on the latest ChefDK, please comment and I will reopen. |
yeah most likely JSON fighting with ffi-yajl/json_gem, which is gone now. |
Log:
The text was updated successfully, but these errors were encountered: