Segmentation Fault; more info?

I am getting a segmentation fault.

Is there some way to get more information about what caused the fault?

You'll have to get a core dump and examine it with gdb. A quick google
search comes up with this:
http://linux-digest.blogspot.com/2008/01/working-with-core-dump.html

Jason

···

On Mon, Sep 27, 2010 at 11:48 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:

I am getting a segmentation fault.

Is there some way to get more information about what caused the fault?

Along the segmentation fault you should be seen the backtrace of it.

···

On Sep 27, 12:48 pm, Ralph Shnelvar <ral...@dos32.com> wrote:

[Note: parts of this message were removed to make it a legal post.]

I am getting a segmentation fault.

Is there some way to get more information about what caused the fault?

--
Luis Lavena

Luis,

Monday, September 27, 2010, 9:55:13 AM, you wrote:

···

On Sep 27, 12:48 pm, Ralph Shnelvar <ral...@dos32.com> wrote:

[Note: parts of this message were removed to make it a legal post.]

I am getting a segmentation fault.

Is there some way to get more information about what caused the fault?

Along the segmentation fault you should be seen the backtrace of it.

--
Luis Lavena

I wish I did.

Ralph

You haven't provided any useful information for us to help you (platform, ruby version, code example that causes the crash, etc), but I'm going to try again anyway.

If you are running on a UNIX platform with gdb installed, try this:

gdb --args ruby <script name>

When gdb starts up, type "run" at the prompt. When it crashes this time you might be able to get more information as to location (type 'bt' to get a backtrace from gdb).

cr

···

On Sep 27, 2010, at 1:04 PM, Ralph Shnelvar wrote:

Luis,

Monday, September 27, 2010, 9:55:13 AM, you wrote:

> On Sep 27, 12:48 pm, Ralph Shnelvar <ral...@dos32.com> wrote:

[Note: parts of this message were removed to make it a legal post.]

I am getting a segmentation fault.

Is there some way to get more information about what caused the fault?

> Along the segmentation fault you should be seen the backtrace of it.

> --
> Luis Lavena

I wish I did.

Chuck,

Monday, September 27, 2010, 12:44:14 PM, you wrote:

···

On Sep 27, 2010, at 1:04 PM, Ralph Shnelvar wrote:

Luis,

Monday, September 27, 2010, 9:55:13 AM, you wrote:

> On Sep 27, 12:48 pm, Ralph Shnelvar <ral...@dos32.com> wrote:

[Note: parts of this message were removed to make it a legal post.]

I am getting a segmentation fault.

Is there some way to get more information about what caused the fault?

> Along the segmentation fault you should be seen the backtrace of it.

> --
> Luis Lavena

I wish I did.

You haven't provided any useful information for us to help you (platform, ruby version, code example that causes the crash, etc), but I'm going to try again anyway.

If you are running on a UNIX platform with gdb installed, try this:

gdb --args ruby <script name>

When gdb starts up, type "run" at the prompt. When it crashes this time you might be able to get more information as to location (type 'bt' to get a backtrace from gdb).

cr

Sorry ... Windows Platform.
[BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

The program is an FXRuby program with about 4 threads running. Trimming the problem down is not an option.

I was hoping there was some cross-platform general way of getting that info.

Ah, there might still be a way...

It appears that your ruby was installed from rubyinstaller.org which means that your ruby was built by gcc. I *think* that if you install the devkit that you might be able to run ruby under gdb on Windows.

Check the rubyinstaller wiki for instructions on installing the devkit:

I don't know if it puts gdb into your path or not. Regardless, try to run ruby under gdb like I suggested above and see what happens.

cr

···

On Sep 27, 2010, at 2:02 PM, Ralph Shnelvar wrote:

Chuck,

Monday, September 27, 2010, 12:44:14 PM, you wrote:

> On Sep 27, 2010, at 1:04 PM, Ralph Shnelvar wrote:

Luis,

Monday, September 27, 2010, 9:55:13 AM, you wrote:

> On Sep 27, 12:48 pm, Ralph Shnelvar <ral...@dos32.com> wrote:

[Note: parts of this message were removed to make it a legal post.]

I am getting a segmentation fault.

Is there some way to get more information about what caused the fault?

> Along the segmentation fault you should be seen the backtrace of it.

> --
> Luis Lavena

I wish I did.

> You haven't provided any useful information for us to help you (platform, ruby version, code example that causes the crash, etc), but I'm going to try again anyway.

> If you are running on a UNIX platform with gdb installed, try this:

> gdb --args ruby <script name>

> When gdb starts up, type "run" at the prompt. When it crashes this time you might be able to get more information as to location (type 'bt' to get a backtrace from gdb).

> cr

Sorry ... Windows Platform.
[BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

The program is an FXRuby program with about 4 threads running. Trimming the problem down is not an option.

I was hoping there was some cross-platform general way of getting that info.

Please note that Ruby 1.8.x is not multithread and that the
interpreter cannot enter in the context from another thread.

Also, there must be a code that raised this segmentation fault, any
particular function you're invoking either form C side of FXRuby or in
Ruby-land.

If you ask the same question on FXRuby group you will get the same
answers: show some code.

Either to report a bug to Ruby or FXRuby you will need this, so better
start looking what your code is doing and see what could be the
culprit.

As for GDB, You can clone RubyInstaller repository and build the
DevKit yourself to include GDB in it. But don't expect see in GDB a
backtrace of the root of your problem, because is not defined if is
FXRuby or Ruby-land.

···

On Sep 27, 4:02 pm, Ralph Shnelvar <ral...@dos32.com> wrote:

Sorry ... Windows Platform.
[BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

The program is an FXRuby program with about 4 threads running. Trimming the problem down is not an option.

I was hoping there was some cross-platform general way of getting that info.

--
Luis Lavena

I just checked and it doesn't look like the devkit install includes gdb. :frowning:

So, what I suggested won't work just by installing devkit. You'll need to download gdb (get a version that matches the gcc version that compiled your ruby binary) and compile it yourself.

cr

···

On Sep 27, 2010, at 2:08 PM, Chuck Remes wrote:

On Sep 27, 2010, at 2:02 PM, Ralph Shnelvar wrote:

Chuck,

Monday, September 27, 2010, 12:44:14 PM, you wrote:

> On Sep 27, 2010, at 1:04 PM, Ralph Shnelvar wrote:

Luis,

Monday, September 27, 2010, 9:55:13 AM, you wrote:

> On Sep 27, 12:48 pm, Ralph Shnelvar <ral...@dos32.com> wrote:

[Note: parts of this message were removed to make it a legal post.]

I am getting a segmentation fault.

Is there some way to get more information about what caused the fault?

> Along the segmentation fault you should be seen the backtrace of it.

> --
> Luis Lavena

I wish I did.

> You haven't provided any useful information for us to help you (platform, ruby version, code example that causes the crash, etc), but I'm going to try again anyway.

> If you are running on a UNIX platform with gdb installed, try this:

> gdb --args ruby <script name>

> When gdb starts up, type "run" at the prompt. When it crashes this time you might be able to get more information as to location (type 'bt' to get a backtrace from gdb).

> cr

Sorry ... Windows Platform.
[BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

The program is an FXRuby program with about 4 threads running. Trimming the problem down is not an option.

I was hoping there was some cross-platform general way of getting that info.

Ah, there might still be a way...

It appears that your ruby was installed from rubyinstaller.org which means that your ruby was built by gcc. I *think* that if you install the devkit that you might be able to run ruby under gdb on Windows.

Check the rubyinstaller wiki for instructions on installing the devkit:

Development Kit · oneclick/rubyinstaller Wiki · GitHub

I don't know if it puts gdb into your path or not. Regardless, try to run ruby under gdb like I suggested above and see what happens.