Windows CLI Commands in Ruby freeze Wine application

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Aerilius
Level 2
Level 2
Posts: 17
Joined: Fri Sep 03, 2010 2:03 pm

Windows CLI Commands in Ruby freeze Wine application

Post by Aerilius »

I use a Wine application (Google SketchUp) that has Ruby as scripting language. I want to issue commands to the Windows cmd from within SketchUp/Ruby. When I write on the Ruby console in SketchUp:

puts `dir`
or
puts `cd`

it should return the result of that command, but it freezes SketchUp and the gnome-terminal gives this error after some seconds:
err:ntdll:RtlpWaitForCriticalSection section 0x136d24 "?" wait timed out in thread 0009, blocked by 0000, retrying (60 sec)

The command does work in wine cmd, and SketchUp has the correct path to find cmd.exe:

ENV["ComSpec"]
C:\windows\system32\cmd.exe


What could I do to solve this?
Aerilius
Level 2
Level 2
Posts: 17
Joined: Fri Sep 03, 2010 2:03 pm

Post by Aerilius »

Wine 1.3.28
Ubuntu 11.04
Overriding ntdll.dll didn't help (and isn't recommended)
Aerilius
Level 2
Level 2
Posts: 17
Joined: Fri Sep 03, 2010 2:03 pm

Post by Aerilius »

still in Wine 1.3.29
Any ideas?
I read that Ruby on Windows generally has some delays to send commands to cmd. Is that a possible reason for the time out? Can I turn off the time out or make it wait longer?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Windows CLI Commands in Ruby freeze Wine application

Post by vitamin »

Aerilius wrote:it should return the result of that command, but it freezes SketchUp and the gnome-terminal gives this error after some seconds:
Try starting your program from wineconsole instead of regular *nix terminal.
Aerilius
Level 2
Level 2
Posts: 17
Joined: Fri Sep 03, 2010 2:03 pm

Post by Aerilius »

I tried in gnome-terminal with

Code: Select all

wineconsole "C:\Programme\Google\Google SketchUp 8\SketchUp.exe"
and it opened a cmd window which opened SketchUp, but putting the above command on SketchUp's ruby console still freezes SketchUp and gives the same error in gnome-terminal.

I also started directly cmd.exe and launched SketchUp.exe from there, but same result.
User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Post by DanKegel »

This is interesting.

I'd suggest trying to reproduce the problem with standalone windows ruby
in wine...
Aerilius
Level 2
Level 2
Posts: 17
Joined: Fri Sep 03, 2010 2:03 pm

Post by Aerilius »

Same error in Wine 1.3.29 with SketchUp's Ruby (1.86) and latest Ruby.

Code: Select all

$ wine cmd
CMD Version 1.3.29

C:\>Ruby186\bin\ruby.exe -e 'puts %x[dir]'      
err:ntdll:RtlpWaitForCriticalSection section 0x1116ac "?" wait timed out in thread 002b, blocked by 0000, retrying (60 sec)
jaspo
Newbie
Newbie
Posts: 1
Joined: Fri Feb 03, 2012 4:42 pm

Post by jaspo »

What's the state here?

I didn't find any associated bug report.
Has this been fixed?

Is there a work around?

I would really like to use ruby scripts doing cli in sketchup...

/Jan.
Aerilius
Level 2
Level 2
Posts: 17
Joined: Fri Sep 03, 2010 2:03 pm

Post by Aerilius »

Hi,
the errors persist (Wine 1.3.37, ruby 1.8.7)

Code: Select all

err:ntdll:RtlpWaitForCriticalSection section 0x1135e4 "?" wait timed out in thread 0026, blocked by 0000, retrying (60 sec)
Probably all cmd commands give this error (error message repeats after 60s, doesn't stop). I tested echo, dir, cd, date, path, reg.

While cmd commands don't work, launching applications works by giving the file path to the program or to a batch file. Example in Ruby:
puts %x[C:\\users\\username\\batch.bat]
Off-topic, @jaspo: I used a workaround. I wrote the commands to a batch file and launched the batch file. If necessary, the batch file writes the results back to a text file that I then read into Ruby. You can find some code in the ImageMagick.rb here: forums.sketchucation.com/viewtopic.php?f=323&t=40720
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Post by lahmbi5678 »

Hi Airilius,

you probably should file a bug. Unfortunately wine is in code freeze for the 1.4 release, so even if a wine dev tackles that bug and prepares a solution, it may not be fixed in the next few weeks, you may have to wait for a 1.5 release.
jjmckenzie
Moderator
Moderator
Posts: 1153
Joined: Wed Apr 27, 2011 11:01 pm

Windows CLI Commands in Ruby freeze Wine application

Post by jjmckenzie »

On Sat, Feb 4, 2012 at 1:55 PM, lahmbi5678 <[email protected]> wrote:
Hi Airilius,

you probably should file a bug. Unfortunately wine is in code freeze for the 1.4 release, so even if a wine dev tackles that
bug and prepares a solution, it may not be fixed in the next few weeks, you may have to wait for a 1.5 release.
AFIK: All releases of Wine are even. Development releases are odd.
Thus the next release after 1.4 will be 1.6.

James
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Windows CLI Commands in Ruby freeze Wine application

Post by dimesio »

jjmckenzie wrote:AFIK: All releases of Wine are even. Development releases are odd.
Stable releases are even, development releases are odd. The next release after 1.4 will be a development release, 1.5.0.
Locked