[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Crash in ruby 1.8.0

Brett H. Williams

10/28/2003 11:32:00 PM

This doesn't look right...

vor-lord:scan_plan/scan_plan> ruby -e 'def next(); end; next()'
-e:1: [BUG] Segmentation fault
ruby 1.8.0 (2003-08-04) [i386-linux]

Aborted

I thought I could create a method with a name that matched a reserved word
as long as I was careful how it was called (like Object#class). At the
least I would've expected that I would get an error telling me not to
define a method called "next". But a segmentation fault seems to be the
wrong result no matter what...

It crashes on HPUX also, however on my old 1.7.3 version it gives me the
unexpected next error.

--
---------------------------------------------- | --------------------------
Brett Williams | (970) 288-0475
Agilent Technologies | brett_williams@agilent.com
---------------------------------------------- | --------------------------

6 Answers

Ryan Pavlik

10/28/2003 11:50:00 PM

0

On Wed, 29 Oct 2003 08:31:32 +0900
"Brett H. Williams" <brett_williams@agilent.com> wrote:

> This doesn't look right...
>
> vor-lord:scan_plan/scan_plan> ruby -e 'def next(); end; next()'
> -e:1: [BUG] Segmentation fault
> ruby 1.8.0 (2003-08-04) [i386-linux]

Actually:

rpav@central:~% ruby -e 'next()'
-e:1: [BUG] Segmentation fault
ruby 1.8.0 (2003-08-04) [i686-linux]

Weird.

--
Ryan Pavlik <rpav@mephle.com>

"Maybe it's the unfocused, blind, murderous rage." - 8BT

Zachary P. Landau

10/29/2003 12:59:00 AM

0



On Wed, Oct 29, 2003 at 08:50:02AM +0900, Ryan Pavlik wrote:
> On Wed, 29 Oct 2003 08:31:32 +0900
> "Brett H. Williams" <brett_williams@agilent.com> wrote:
>=20
> > This doesn't look right...
> >=20
> > vor-lord:scan_plan/scan_plan> ruby -e 'def next(); end; next()'
> > -e:1: [BUG] Segmentation fault
> > ruby 1.8.0 (2003-08-04) [i386-linux]
>=20
> Actually:
>=20
> rpav@central:~% ruby -e 'next()'=20
> -e:1: [BUG] Segmentation fault
> ruby 1.8.0 (2003-08-04) [i686-linux]

It crashes on break() and return() too.

--=20
Zachary P. Landau <kapheine@hypa.net>
GPG: gpg --recv-key 0x24E5AD99 | http://kapheine.hypa.net/ka...



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/nxDQCwWyMCTlrZkRAkF+AJwKJZ5FYjP/kIrMzU6zX7GOosCl4wCfTZ7g
MNoE6shimLUBvE2TZfGyrWE=
=pfkR
-----END PGP SIGNATURE-----


Andy Triboletti

10/29/2003 1:05:00 AM

0

Hi all,
I'm pretty new to Ruby, and I came across the Ruby bindings
(http://pablotron.org/softwar...) to the musicbrainz project
(musicbrainz.org).

I'd like to use Ruby to generate acoustic fingerprints when fed an MP3
file. Reading over the API, I see this method that looks like it will
do what I want:

/*
* Pass raw PCM data to generate a signature.
*
* Note: MusicBrainz::TRM#pcm_data must be called before this
function.
*
* Returns true if enough data has been sent to generate a signature,
* and false if more data is needed.
*
* Example:
* trm.generate_signature buf, BUFSIZ
*
*/
static VALUE mb_trm_gen_sig(VALUE self, VALUE buf) {


However, I'm not sure how I'd go about passing raw PCM data to Ruby.
Any suggestions? I posted this on comp.lang.ruby too (although it
hasn't shown up yet), I hope no one's offended about the double post if
you frequent both places.

Thanks alot!


Tanaka Akira

10/29/2003 1:17:00 AM

0

In article <20031029005857.GA7569@localhost>,
"Zachary P. Landau" <kapheine@hypa.net> writes:

> It crashes on break() and return() too.

% ./ruby -e '() and 1'
-e:1: [BUG] Segmentation fault
ruby 1.8.1 (2003-10-28) [i686-linux]

% ./ruby -e '() or 1'
-e:1: [BUG] Segmentation fault
ruby 1.8.1 (2003-10-28) [i686-linux]

% ./ruby -e '() && 1'
-e:1: [BUG] Segmentation fault
ruby 1.8.1 (2003-10-28) [i686-linux]

% ./ruby -e '() || 1'
-e:1: [BUG] Segmentation fault
ruby 1.8.1 (2003-10-28) [i686-linux]

% ./ruby -e 'case 1 when (); end'
-e:1: [BUG] Segmentation fault
ruby 1.8.1 (2003-10-28) [i686-linux]
--
Tanaka Akira

matz

10/29/2003 2:32:00 AM

0

Hi,

In message "Crash in ruby 1.8.0"
on 03/10/29, "Brett H. Williams" <brett_williams@agilent.com> writes:
|
|This doesn't look right...
|
|vor-lord:scan_plan/scan_plan> ruby -e 'def next(); end; next()'
|-e:1: [BUG] Segmentation fault
|ruby 1.8.0 (2003-08-04) [i386-linux]
|
|Aborted

This patch should work. Thank you.

matz.

diff -p -u -1 -r1.298 -r1.299
--- parse.y 28 Oct 2003 02:27:02 -0000 1.298
+++ parse.y 29 Oct 2003 02:30:05 -0000 1.299
@@ -5368,3 +5368,3 @@ ret_args(node)
}
- if (nd_type(node) == NODE_SPLAT) {
+ if (node && nd_type(node) == NODE_SPLAT) {
node = NEW_SVALUE(node);

ts

10/29/2003 10:35:00 AM

0

>>>>> "A" == Andy Triboletti <atribole@coe.neu.edu> writes:

A> static VALUE mb_trm_gen_sig(VALUE self, VALUE buf) {


A> However, I'm not sure how I'd go about passing raw PCM data to Ruby.
A> Any suggestions?

Well, the variable buf is just a String object and you call it :

trm.generate_signature(string)

this is equivalent to the C function trm_GenerateSignature()



--

Guy Decoux