Ruby.exe crashing on windows xp

Luis Lavena wrote in post #998653:

> Can you provide us what is the last sentences before the crash?

I get this pop with the following:
ruby.exe has encountered a problem and needs to be close. We are sorry
for the inconvenience.

I didn't ask the popup information, perhaps wasn't clear but I'm
interested in the output at the console before the crash.

> Normally Ruby will print out the offending line that triggered the
> crash before terminating itself.

There is nothing printed in the development log (i.e. there is no stack
trace shown through 'rails server') so where do I go about culprit line?

The console, not the log file.

I am trying to get a simple app to test with carrierwave (File uploads)
and using Mongoid's Grid FS. Submitting the form often crashes it

If you don't mind, please create a sample application, outside your
existing one that present this behavior and upload it to github, that
will be more easy than copy and paste your entire source code from
here and will provide a reproducible environment for us to help you
better.

You can upload the source code to GitHub for free.

···

On May 15, 6:10 pm, "Glory L." <glory.lo...@gmail.com> wrote:

--
Luis Lavena

Luis Lavena wrote in post #999023:

Luis Lavena wrote in post #998653:

> Can you provide us what is the last sentences before the crash?

I get this pop with the following:
ruby.exe has encountered a problem and needs to be close. We are sorry
for the inconvenience.

I didn't ask the popup information, perhaps wasn't clear but I'm
interested in the output at the console before the crash.

> Normally Ruby will print out the offending line that triggered the
> crash before terminating itself.

There is nothing printed in the development log (i.e. there is no stack
trace shown through 'rails server') so where do I go about culprit line?

The console, not the log file.

I am trying to get a simple app to test with carrierwave (File uploads)
and using Mongoid's Grid FS. Submitting the form often crashes it

If you don't mind, please create a sample application, outside your
existing one that present this behavior and upload it to github, that
will be more easy than copy and paste your entire source code from
here and will provide a reproducible environment for us to help you
better.

You can upload the source code to GitHub for free.

OK guys here it is. I am still very new to all this and I wish things
would work right out of the box easier. Sigh.

Anyhow, the console logs just shows the html templates being rendered
and then crashing with no other messages.

Simple app created to show crashing:

Simply doing http://localhost:3000/videos/new very often crashes my
machine. No need to submit anything.

Clone and bundle install this. I have MongoDB running as a service on
Windows.

Created repository.

https://github.com/glorylo/crash
https://glorylo@github.com/glorylo/crash.git

I suspect there might be some oddity in the setup but nothing obvious is
screaming at me on this. There may be something stupidly done here but
still I wish Ruby was more graceful and handle errors better.

Let me know if you can reproduce this.

···

On May 15, 6:10pm, "Glory L." <glory.lo...@gmail.com> wrote:

--
Posted via http://www.ruby-forum.com/\.

For future reference: The second URL is *your private commit URL*. No
need to share it with anyone, the public one (the first one), will do
just fine. :slight_smile:

···

On Tue, May 17, 2011 at 12:08 AM, Glory L. <glory.lo778@gmail.com> wrote:

https://github.com/glorylo/crash
https://glorylo@github.com/glorylo/crash.git

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.

OK guys here it is. I am still very new to all this and I wish things
would work right out of the box easier. Sigh.

Anyhow, the console logs just shows the html templates being rendered
and then crashing with no other messages.

Simple app created to show crashing:

Simply doing http://localhost:3000/videos/new very often crashes my
machine. No need to submit anything.

There are no routes matching /video in this test app, nor are there
any controllers, models or views beyond what Rails' setup dumps in the
file system.

So, please, provide some *minimal* code to get working, so we might
reproduce the crash. Just update your git repository, and we can git
pull the changes. :slight_smile:

I suspect there might be some oddity in the setup but nothing obvious is
screaming at me on this. There may be something stupidly done here but
still I wish Ruby was more graceful and handle errors better.

A segmentation fault isn't under Ruby's control, and usually a result
of misbehaving C code.

···

On Tue, May 17, 2011 at 12:08 AM, Glory L. <glory.lo778@gmail.com> wrote:

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.

Phillip Gawlowski wrote in post #999137:

Thanks Phillip.

I just tried to clone. There should be those files as well, I did
resources :videos in the routes.rb file. It might have been a timing
issue as I forgot to add some files and you cloned it then. I am
leaning towards something odd with this example as I now got a simple
file upload running with Mongoid but the crash example is something I
cannot pinpoint.

···

--
Posted via http://www.ruby-forum.com/.

Phillip Gawlowski wrote in post #999137:

Thanks Phillip.

I just tried to clone. There should be those files as well, I did
resources :videos in the routes.rb file. It might have been a timing
issue as I forgot to add some files and you cloned it then.

Indeed. An update made the source work. :slight_smile:

I am
leaning towards something odd with this example as I now got a simple
file upload running with Mongoid but the crash example is something I
cannot pinpoint.

Yes, unfortunately(?), I cannot reproduce the crash here, either,
despite throwing the largest image file I had into the upload field.

Though, what might hep us is if you grab Visual Studio C++ Express[1]
(it's free, but requires registration after 30 days). This *should*
includes a debugger which able to hook into a crashed Ruby process (I
can't test that assumption since I have a Visual Studio Pro
installation and they can't quite exist side-by-side, alas). That way,
you can at least get a stack trace for us, in case this happens again
with your actual Rails app.

[1] Visual Studio: IDE and Code Editor for Software Developers and Teams

Alternatively, you can try to install the gems you need via plain old
RubyGems instead of Bundler, since Bundler doesn't appear to pick up
the DevKit and its compiler package.

···

On Tue, May 17, 2011 at 4:59 AM, Glory L. <glory.lo778@gmail.com> wrote:

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.

It is too bad the problem is isolated to my machine :frowning: It crashes
rather easily with simply going to form page.. no need to submit
anything.

Alternatively, you can try to install the gems you need via plain old
RubyGems instead of Bundler, since Bundler doesn't appear to pick up
the DevKit and its compiler package.

I'll install VC++ express kit as a last resort if I come across this
again. It seems the Ruby community is developed largely on Mac/linux
and I wonder if I should get myself a Mac to avoid some of the hurdles I
already have to jump through with Cygwin, MYSGit, etc.

Thanks for your time, Phillip.

···

--
Posted via http://www.ruby-forum.com/\.

Yes, unfortunately(?), I cannot reproduce the crash here, either,
despite throwing the largest image file I had into the upload field.

I was not able either.

Though, what might hep us is if you grab Visual Studio C++ Express[1]
(it's free, but requires registration after 30 days). This *should*
includes a debugger which able to hook into a crashed Ruby process (I
can't test that assumption since I have a Visual Studio Pro
installation and they can't quite exist side-by-side, alas). That way,
you can at least get a stack trace for us, in case this happens again
with your actual Rails app.

[1]http://www.microsoft.com/express/Downloads/

I would recommend start the server using GDB, which is part of the
DevKit instead of making the user jump into the daunting task of
building Ruby from source completely.

On the command line, locate wheer you installed the DevKit and do:

C:\Path\to\DevKit\devkitvars.bat

That will make GCC and friends available, including GDB

Then, CD into your application directory and do:

gdb ruby.exe

Which will load Ruby inside GDB, from there:

run -S rails server

Which will run ruby inside GDB, a little bit slower but similar to
doing from the command line.

When the exception occurs, GDB will show that the execution halted
with a SEGFAULT or SEGV exception and will allow you capture the
backtrace, just do "bt" and will obtain a list of the C part of Ruby
that crashed.

···

On May 17, 10:43 pm, Phillip Gawlowski <cmdjackr...@googlemail.com> wrote:

--
Luis Lavena