librelist archives

« back to archive

Segfault with shoes build on the nobody knows shoes URL example

Segfault with shoes build on the nobody knows shoes URL example

From:
Tobias Pfeiffer
Date:
2011-09-15 @ 20:59
Hey guys - me again :P

I hope this isn't a known issue that I missed. Running this code (taken 
straight from nobody knows shoes) with red shoes:

class Dictionary < Shoes
url '/', :index
url '/(\w+)', :word

def index
stack do
title "Enter a Word"
@word = edit_line
button "OK" do
visit "/#{@word.text}"
end
end
end

def word(string)
stack do
para "No definition found for #{string}. ",
"Sorry this doesn’t actually work."
end
end

end

Shoes.app

Gives me an error:

-e: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

-- control frame ----------
c:0001 p:0000 s:0002 b:0002 l:0021b8 d:0021b8 TOP
---------------------------

-- C level backtrace information -------------------------------------------
/home/tobi/github/shoes/dist/libruby.so.1.9(rb_vm_bugreport+0x5f) 
[0x7ff478aff52f]
/home/tobi/github/shoes/dist/libruby.so.1.9(+0x6053e) [0x7ff4789de53e]
/home/tobi/github/shoes/dist/libruby.so.1.9(rb_bug+0xa2) [0x7ff4789df462]
/home/tobi/github/shoes/dist/libruby.so.1.9(+0x1148a5) [0x7ff478a928a5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfc60) [0x7ff476e76c60]
/lib/x86_64-linux-gnu/libc.so.6(__longjmp_chk+0x18) [0x7ff476bd10b8]
/home/tobi/github/shoes/dist/libruby.so.1.9(+0x67a01) [0x7ff4789e5a01]
/home/tobi/github/shoes/dist/libruby.so.1.9(+0x62c8e) [0x7ff4789e0c8e]
/home/tobi/github/shoes/dist/libruby.so.1.9(rb_check_type+0xc4) 
[0x7ff4789e1214]
/home/tobi/github/shoes/dist/libshoes.so(shoes_app_visit+0xfb) 
[0x7ff4770cc484]
/home/tobi/github/shoes/dist/libshoes.so(shoes_app_goto+0x70) 
[0x7ff4770cc5af]
/home/tobi/github/shoes/dist/libshoes.so(shoes_app_open+0x9b) 
[0x7ff4770cc688]
/home/tobi/github/shoes/dist/libshoes.so(shoes_app_start+0x45) 
[0x7ff4770cc6fa]
/home/tobi/github/shoes/dist/libshoes.so(shoes_start+0x24b) [0x7ff4770cd17b]
/home/tobi/github/shoes/dist/shoes-bin(main+0xe6) [0x400bf6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xff) [0x7ff476af1eff]
/home/tobi/github/shoes/dist/shoes-bin() [0x400a49]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension 
libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

/home/tobi/github/shoes/dist/shoes: line 22: 20362 Aborted 
LD_LIBRARY_PATH=$APPPATH $APPPATH/shoes-bin "$@"

Shoes is built straight from develop today. I think it is related to 
using the Shoes class or the urls (I tried to rewrite infoes using this 
and then came across this error and I noticed that it also happened when 
trying the nks code).

I dunno, shall I open an issue or does somebody know what's wrong on 
first sight?

Tobi

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
spiralofhope
Date:
2011-09-15 @ 15:31
On Thu, 15 Sep 2011 22:59:52 +0200
Tobias Pfeiffer <tobias.pfeiffer@student.hpi.uni-potsdam.de> wrote:

> Shoes is built straight from develop today. I think it is related to 
> using the Shoes class or the urls (I tried to rewrite infoes using
> this and then came across this error and I noticed that it also
> happened when trying the nks code).
> 
> I dunno, shall I open an issue or does somebody know what's wrong on 
> first sight?

On my red shoes, built quite a long time ago, it also segfaults.

It has something to do with

  url '/', :index

I'm not too familiar with url(), is that part of the code correct?


-- 
http://spiralofhope.com

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
Eric Watson
Date:
2011-09-16 @ 00:29
Out of curiosity, does it work if you add a block at the end

Shoes.app do; end

?

On Sep 15, 2011, at 5:28 PM, spiralofhope <spiralofhope@lavabit.com> wrote:

> On Thu, 15 Sep 2011 22:59:52 +0200
> Tobias Pfeiffer <tobias.pfeiffer@student.hpi.uni-potsdam.de> wrote:
>
>> Shoes is built straight from develop today. I think it is related to
>> using the Shoes class or the urls (I tried to rewrite infoes using
>> this and then came across this error and I noticed that it also
>> happened when trying the nks code).
>>
>> I dunno, shall I open an issue or does somebody know what's wrong on
>> first sight?
>
> On my red shoes, built quite a long time ago, it also segfaults.
>
> It has something to do with
>
>  url '/', :index
>
> I'm not too familiar with url(), is that part of the code correct?
>
>
> --
> http://spiralofhope.com
>

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
spiralofhope
Date:
2011-09-15 @ 22:53
On Thu, 15 Sep 2011 19:29:16 -0500
Eric Watson <wasnotrice@gmail.com> wrote:

> Out of curiosity, does it work if you add a block at the end
> 
> Shoes.app do; end
> 
> ?

This is how the code looks, with some formatting and that new ending:
https://gist.github.com/1221295

This code no longer crashes, but it only displays a default Shoes
window, with nothing inside it.



-- 
http://spiralofhope.com

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
Eric Watson
Date:
2011-09-16 @ 06:04
On Sep 15, 2011, at 5:53 PM, spiralofhope wrote:

> This is how the code looks, with some formatting and that new ending:
> https://gist.github.com/1221295
> 
> This code no longer crashes, but it only displays a default Shoes
> window, with nothing inside it.

I think for the url call to work, you'd have to change the last line to

Dictionary.app do; end

But even if you do that, it's still an empty window. On my OS X 10.7 
Shoes, the original (without block) doesn't segfault--it gives the error I
described in https://github.com/shoes/shoes/issues/140

Does your Shoes also segfault on this most minimal example:

Shoes.app

?

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
spiralofhope
Date:
2011-09-16 @ 02:34
On Fri, 16 Sep 2011 01:04:00 -0500
Eric Watson <wasnotrice@gmail.com> wrote:

> Does your Shoes also segfault on this most minimal example:
> 
> Shoes.app

Mine doesn't.


-- 
http://spiralofhope.com

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
Tobias Pfeiffer
Date:
2011-09-16 @ 09:24
On 09/16/2011 08:04 AM, Eric Watson wrote:
> On Sep 15, 2011, at 5:53 PM, spiralofhope wrote:
>
> >  This is how the code looks, with some formatting and that new ending:
> >  https://gist.github.com/1221295
> >
> >  This code no longer crashes, but it only displays a default Shoes
> >  window, with nothing inside it.
>
> I think for the url call to work, you'd have to change the last line to
>
> Dictionary.app do; end
>
> But even if you do that, it's still an empty window. On my OS X 10.7 Shoes, the
> original (without block) doesn't segfault--it gives the error I described in
> https://github.com/shoes/shoes/issues/140
>
> Does your Shoes also segfault on this most minimal example:
>
> Shoes.app
>
> ?
>
Shoes doesn't segfault on Shoes.app

And the example doesn't run when you add

Shoes.app do ; end or something like that to the end... :-/ It just 
opens up an empty shoes window.
Same for Dictionary.app do ; end
Dictionary.app produces a segfault again ... :-/

cheers,
Tobi

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
ashbb
Date:
2011-09-16 @ 11:15
Hi Tobi and folks,

I guess this is not a url() method problem just a UTF-8 character code
handling problem.
Look at the character code of "doesn't" that you want to show with para().
I guess Tobi copied and pasted the code from PDF file (NKS.pdf).
So, the "doesn't" is not ascii code.

There are two ways to solve the problem.

1st: Replace "doesn't" to ascii code.
2nd: Add "# -*- encoding: utf-8 -*-" at the top of the file and save the
file as utf-8 code file (not as ascii code file).

ashbb

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
Tobias Pfeiffer
Date:
2011-09-16 @ 17:20
Hey ashbb,

well my editor is set to UTF-8 and I first noticed this problem when 
trying to refactor my infoes project - where all the code is written by me.

I tried to do what you said, replaced the ' with the own from my 
keyboard, inserted the encoding statement and double checked that gedit 
promised me to save it as UTF-8. Sadly same error.

The code works on green shoes btw.

Tobi

On 09/16/2011 01:15 PM, ashbb wrote:
> Hi Tobi and folks,
>
> I guess this is not a url() method problem just a UTF-8 character code handling
> problem.
> Look at the character code of "doesn't" that you want to show with para().
> I guess Tobi copied and pasted the code from PDF file (NKS.pdf).
> So, the "doesn't" is not ascii code.
>
> There are two ways to solve the problem.
>
> 1st: Replace "doesn't" to ascii code.
> 2nd: Add "# -*- encoding: utf-8 -*-" at the top of the file and save the file as
> utf-8 code file (not as ascii code file).
>
> ashbb
>

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
ashbb
Date:
2011-09-17 @ 00:21
Hi Tobi,

> The code works on green shoes btw.
Okay then, there must be another problem on Red Shoes. ;-)

To identify the cause, could you confirm the following snippets?
On my Windows 7, they all work well with Shoes 3 (0.r1514).

# 1st
class Dictionary < Shoes
  url '/', :index
  def index
    para 'hello'
  end
end
Shoes.app

# 2nd
class Dictionary < Shoes
  url '/', :index
  url '/word', :word
  def index
    button("OK"){visit "/word"}
  end
  def word
    para 'hello'
  end
end
Shoes.app

# 3rd
class Dictionary < Shoes
  url '/', :index
  url '/(\w+)', :word
  def index
    button("OK"){visit "/hello"}
  end
  def word(string)
    para string
  end
end
Shoes.app

ashbb

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
ashbb
Date:
2011-09-17 @ 01:09
Hi spiralofhope,

> Does it help if I also run them?
Yes!! Very helpful!

Your results shows that this is a Ruby 1.9.2 issue (the difference between
Ruby 1.9.1 and 1.9.2). Just as Cecil had already mentioned.

I guess Tobi will get the same results.

ashbb

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
Tobias Pfeiffer
Date:
2011-09-17 @ 08:05
You guess right ;-)

Tobi

On 09/17/2011 03:09 AM, ashbb wrote:
> Hi spiralofhope,
>
>   >  Does it help if I also run them?
> Yes!! Very helpful!
>
> Your results shows that this is a Ruby 1.9.2 issue (the difference between Ruby
> 1.9.1 and 1.9.2). Just as Cecil had already mentioned.
>
> I guess Tobi will get the same results.
>
> ashbb

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
spiralofhope
Date:
2011-09-16 @ 17:57
On Sat, 17 Sep 2011 09:21:14 +0900
ashbb <ashbbb@gmail.com> wrote:

> To identify the cause, could you confirm the following snippets?

Does it help if I also run them?

They all gave an error:

https://gist.github.com/1223466

(The "no version information available" messages is normal for me)


-- 
http://spiralofhope.com

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
Cecil Coupe
Date:
2011-09-16 @ 00:54
Interesting. The code worked on my linux x64 Shoes - but I have the
original Shoes3 code, not the develop branch and my Shoes is complied
with Ruby 1.9.1. I suspect something has changed in the url code
handling of a regexp that 1.9.2 doesn't like. 


On Thu, 2011-09-15 at 22:59 +0200, Tobias Pfeiffer wrote:
> Hey guys - me again :P
> 
> I hope this isn't a known issue that I missed. Running this code (taken 
> straight from nobody knows shoes) with red shoes:
> 
> class Dictionary < Shoes
> url '/', :index
> url '/(\w+)', :word

Re: [shoes] Segfault with shoes build on the nobody knows shoes URL example

From:
Cecil Coupe
Date:
2011-09-16 @ 01:06
Apologies I was only half correct. I built my shoes3 with 1.9.2 and it
segfaults. Definitely a Ruby 1.9.2 issue.