# Well behaving program suddenly seg faultiing Well behaving p

**URL:** <https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303>\
**Category:** Ruby-Gnome 2\
**Created:** [February 12, 2007, 2:24pm UTC](https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303 "2007-02-12T14:24:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [February 12, 2007, 2:24pm UTC](https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303/1 "2007-02-12T14:24:03Z")

</div>

Well,

I wrote a small gtk-ruby client for communicating to a server(which  
handles some home grown protocol), basically… i have couple of  
threads that keep reading from sockets and I am synchronizing  
Gtk::TextBuffer as shown below.

def read\_from\_control\_socket

@threads \<\< Thread.new do

```
 loop do
   data = nil
   data = @control_socket.gets
   next if data.nil? or data.empty?

   @text_buffer.synchronize do
     @text_buffer.insert(@text_iter,data)
   end

 end # end of loop dp

```

end # end of thread loop

end # end of read\_from\_control\_socket

Above code was working remarkably well and its just a prototype of a  
client, which i use to test certain requests manually and hence I  
didn’t spend much time optimising stuff.

But, I guess after some ubuntu update, whole program partially broke  
and often i get this  
segmentation fault:

/usr/local/lib/ruby/site\_ruby/1.8/libglade2.rb:105: [BUG] Segmentation  
fault  
ruby 1.8.5 (2006-12-25) [i686-linux]

Aborted

Also, I had a callback that i used to use to clear textbuffer and damn  
thing now throws this, when signalled:

tick\_ui.rb:346: warning: GRClosure invoking callback: already destroyed

The callback is something like this:

def on\_clear\_result\_view\_clicked  
@text\_buffer.synchronize do  
@text\_buffer.text = “”  
@text\_iter = @text\_buffer.end\_iter  
end  
@symbol\_entry.grab\_focus  
end

Any ideas, why?

## – gnufied

There was only one Road; that it was like a great river: its springs  
were at every doorstep, and every path was its tributary.  
[http://people.inxsasia.com/~hemant](http://people.inxsasia.com/~hemant)

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [February 12, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303/2 "2007-02-12T19:50:50Z")

</div>

On Mon, Feb 12, 2007 at 06:53:48PM +0530, hemant wrote:

> But, I guess after some ubuntu update, whole program partially broke  
> and often i get this  
> segmentation fault:
> 
> /usr/local/lib/ruby/site\_ruby/1.8/libglade2.rb:105: [BUG] Segmentation fault  
> ruby 1.8.5 (2006-12-25) [i686-linux]
> 
> Aborted

You probably upgraded to Ruby-GTK2 0.15, which had a lot of problems  
related  
to event handling. 0.16 isn’t available yet in Ubuntu/Debian, so you may  
want  
to revert back to 0.14 or install from source.

hth,  
Markus

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [February 12, 2007, 8:11pm UTC](https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303/3 "2007-02-12T20:11:53Z")

</div>

El lunes 12 de febrero, Markus K.  
escribió:\> You probably upgraded to Ruby-GTK2 0.15, which had a lot of problems

> related to event handling. 0.16 isn’t available yet in Ubuntu/Debian,  
> so you may want to revert back to 0.14 or install from source.

Any clue about when 0.16 will be available for Debian?

Etch is near to launch, but 0.15 stands in testing and unstable. I have  
report a bug about that, but no response at all.

Greets.

```
           David

```

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [February 12, 2007, 8:36pm UTC](https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303/4 "2007-02-12T20:36:59Z")

</div>

El lunes 12 de febrero, Markus K.  
escribió:\> On Mon, Feb 12, 2007 at 08:10:29PM +0100, DaVinci wrote:

> > Any clue about when 0.16 will be available for Debian?
> > 
> > Etch is near to launch, but 0.15 stands in testing and unstable. I  
> > have report a bug about that, but no response at all.
> 
> Oh, hey… so that was you I just replied to 😉

=8o

I don’t know why I didn’t read your response. Sorry. It’s good to see  
you here and repair the question 🙂

> I have no idea when it will be available, I hope it will be soon.  
> But I guess this package doesn’t really have high priority…

Perhaps no high priority, but the good name of Debian… 😉

Greets.

```
           David

```

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [February 12, 2007, 8:16pm UTC](https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303/5 "2007-02-12T20:16:54Z")

</div>

On Mon, Feb 12, 2007 at 08:10:29PM +0100, DaVinci wrote:

> Any clue about when 0.16 will be available for Debian?
> 
> Etch is near to launch, but 0.15 stands in testing and unstable. I have  
> report a bug about that, but no response at all.

Oh, hey… so that was you I just replied to 😉  
I have no idea when it will be available, I hope it will be soon.  
But I guess this package doesn’t really have high priority…

> Greets.
> 
> ```
> David
> 
> ```

Cheers,  
Markus

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [February 12, 2007, 9:35pm UTC](https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303/6 "2007-02-12T21:35:10Z")

</div>

On 2/13/07, Markus K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> You probably upgraded to Ruby-GTK2 0.15, which had a lot of problems related  
> to event handling. 0.16 isn’t available yet in Ubuntu/Debian, so you may want  
> to revert back to 0.14 or install from source.

Thats wierd, because even though gtk and libs are installed from  
standard apt tree, i compiled and installed gtk-ruby bindings by hand  
and I have 0.16 version compiled and installed.

## – gnufied

There was only one Road; that it was like a great river: its springs  
were at every doorstep, and every path was its tributary.  
[http://people.inxsasia.com/~hemant](http://people.inxsasia.com/~hemant)

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![gnufied](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gnufied](https://www.ruby-forum.com/u/gnufied)\
**Post date:** [February 13, 2007, 1:37pm UTC](https://www.ruby-forum.com/t/well-behaving-program-suddenly-seg-faultiing-well-behaving-p/85303/7 "2007-02-13T13:37:52Z")

</div>

Hi,

On Mon, 12 Feb 2007 18:53:48 +0530  
hemant [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Well,
> 
> I wrote a small gtk-ruby client for communicating to a server(which  
> handles some home grown protocol), basically… i have couple of  
> threads that keep reading from sockets and I am synchronizing  
> Gtk::TextBuffer as shown below.

> Also, I had a callback that i used to use to clear textbuffer and damn  
> thing now throws this, when signalled:

> Any ideas, why?

Could you show us the sample(small but excutable) code?

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)
