Crash in ruby 1.8.0

B

Brett H. Williams

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.
 
R

Ryan Pavlik

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.
 
Z

Zachary P. Landau

On Wed, 29 Oct 2003 08:31:32 +0900
Brett H. Williams said:
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 <[email protected]>
GPG: gpg --recv-key 0x24E5AD99 | http://kapheine.hypa.net/kapheine.asc



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

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

Andy Triboletti

Hi all,
I'm pretty new to Ruby, and I came across the Ruby bindings
(http://pablotron.org/software/mb-ruby/) 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!
 
T

Tanaka Akira

Zachary P. Landau said:
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]
 
Y

Yukihiro Matsumoto

Hi,

In message "Crash in ruby 1.8.0"
|
|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);
 
T

ts

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()
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top