Problem with Thread's memory (possible bug)

  • Thread starter Victor \Zverok\ Shepelev
  • Start date
V

Victor \Zverok\ Shepelev

Hi all.

Some time ago I've started thread named "Memory crush somewhere in Socket"
with no results. No I can describe the problem more correctly and in
details.

First of all: Windows XP with ruby1.9, RUBY_PLATFORM = i386-mswin32_71

I have a window, and dispatch all keyboard events to Ruby's block.
All works good, except Ruby's Threads. When I do anything like just
Thread.new{} in my keyboard handling block, I have corrupted memory and
entire program crashed soon.

How can I debug (or just walk around) this problem?

Thanks.

v.
 
E

Eric Hodel

Hi all.

Some time ago I've started thread named "Memory crush somewhere in
Socket"
with no results. No I can describe the problem more correctly and in
details.

First of all: Windows XP with ruby1.9, RUBY_PLATFORM = i386-mswin32_71

First of all, try to reproduce in Ruby 1.8.5.
 
V

Victor \Zverok\ Shepelev

From: Eric Hodel [mailto:[email protected]]
Sent: Monday, November 06, 2006 12:41 AM
First of all, try to reproduce in Ruby 1.8.5.

Unfortunately, I can't do it easy.
My window library extensively uses instance_exec. Reproducing _without_ this
library would be a pain.

V.
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: Problem with Thread's memory (possible bug)"

|First of all: Windows XP with ruby1.9, RUBY_PLATFORM = i386-mswin32_71
|
|I have a window, and dispatch all keyboard events to Ruby's block.
|All works good, except Ruby's Threads. When I do anything like just
|Thread.new{} in my keyboard handling block, I have corrupted memory and
|entire program crashed soon.
|
|How can I debug (or just walk around) this problem?

First, mere 1.9 does not mean anything. Specify the date.
Full ruby -v line is better.

Besides that, is it possible to supply error reproducing code?

matz.
 
V

Victor \Zverok\ Shepelev

From: Yukihiro Matsumoto [mailto:[email protected]]
Sent: Monday, November 06, 2006 10:46 AM
In message "Re: Problem with Thread's memory (possible bug)"
on Mon, 6 Nov 2006 04:02:55 +0900, "Victor \"Zverok\" Shepelev"

|First of all: Windows XP with ruby1.9, RUBY_PLATFORM = i386-mswin32_71
|
|I have a window, and dispatch all keyboard events to Ruby's block.
|All works good, except Ruby's Threads. When I do anything like just
|Thread.new{} in my keyboard handling block, I have corrupted memory and
|entire program crashed soon.
|
|How can I debug (or just walk around) this problem?

First, mere 1.9 does not mean anything. Specify the date.
Full ruby -v line is better.

Sorry :(
There was words "today's version" in my platform description, but I've
deleted them before send message.
It was Ruby1.9-today, downloaded yesterday.

ruby 1.9.0 (2006-11-04) [i386-mswin32_71]
Besides that, is it possible to supply error reproducing code?

Possible, but not very useful, as there is custom UI library used.
Here is it:

-----
require 'lib/config'

require 'htmr'
require 'htmr/load'
require 'htmr/extend'
require 'htmr/events'

MAIN_HTMR = File.join(HTMR_PATH, 'nanobrowser.htmr')

win = Htmr::Window.create_from_file(MAIN_HTMR, 'NanoBrowser')

Htmr::App::main_window = win

include Htmr::Keys
win.get('#url').on_key_down(ENTER) do
Thread.new{} #HERE's thread usage!
end

win.show

Htmr::App::run
-----

inside 'lib/config' there is:
-----
$:.unshift File.expand_path(File.dirname(__FILE__))
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), "vendors"))
require 'vendors'

DLL_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', 'bin'))

ENV['PATH'] += ";" + DLL_PATH

HTMR_PATH = File.join(File.expand_path(File.dirname(__FILE__)), '..',
'htmr')
-----

All htmr/* files is UI library.

If I'll comment "HERE's thread" line, all works fine. I use my library till
last 2 month inside rather complicated software, and there was almost no
problems.

Thanks.

V.
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: Problem with Thread's memory (possible bug)"

|It was Ruby1.9-today, downloaded yesterday.
|
|ruby 1.9.0 (2006-11-04) [i386-mswin32_71]

Much better.

|>Besides that, is it possible to supply error reproducing code?
|
|Possible, but not very useful, as there is custom UI library used.

Hmm. Does you custom UI library tweaks system stack in any way? Ruby
threads does evil things with setjmp/longjmp. They may not co-exist
with other library with similar technique.

matz.
 
V

Victor 'Zverok' Shepelev

Yukihiro Matsumoto (matz@ruby-lang=2Eorg)
6/11/2006 15:39:43
Hi,

In message "Re: Problem with Thread's memory (possible bug)"
on Mon, 6 Nov 2006 19:15:33 +0900, "Victor \"Zverok\" Shepelev"

|It was Ruby1=2E9-today, downloaded yesterday=2E
|
|ruby 1=2E9=2E0 (2006-11-04) [i386-mswin32_71]

Much better=2E

|>Besides that, is it possible to supply error reproducing code?
|
|Possible, but not very useful, as there is custom UI library used=2E

Hmm=2E Does you custom UI library tweaks system stack in any way? Ruby=
threads does evil things with setjmp/longjmp=2E They may not co-exist
with other library with similar technique=2E

I don't know definitely, because "my" library is really third-party closed=
-source DLL with my C/C++ wrapper=2E My wrapper does no evil, what about H=
TMLayout (third-party library), I'll ask the author today or tomorrow and =
do the further investigation=2E

Thanks!

V=2E
 
V

Victor \Zverok\ Shepelev

Yukihiro Matsumoto [mailto:[email protected]]
Monday, November 06, 2006 3:40 PM
In message "Re: Problem with Thread's memory (possible bug)"
on Mon, 6 Nov 2006 19:15:33 +0900, "Victor \"Zverok\" Shepelev"

|It was Ruby1.9-today, downloaded yesterday.
|
|ruby 1.9.0 (2006-11-04) [i386-mswin32_71]

Much better.

|>Besides that, is it possible to supply error reproducing code?
|
|Possible, but not very useful, as there is custom UI library used.

Hmm. Does you custom UI library tweaks system stack in any way? Ruby
threads does evil things with setjmp/longjmp. They may not co-exist
with other library with similar technique.

Matz, there is no setjmp/longjmp or something like this in my UI library.
I'd be grateful for any other advices, how to catch this.

V.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,218
Messages
2,571,123
Members
47,725
Latest member
Rudy

Latest Threads

Top