Reply to topic  [ 3 posts ] 
SIGBUS error from y=transpose(x=indgen(300)(,-:1:300)) 
Author Message
Yorick Master

Joined: Tue Mar 07, 2006 10:31 pm
Posts: 125
Location: Meudon, France
Post SIGBUS error from y=transpose(x=indgen(300)(,-:1:300))
Hi,

I get an error when I try to define two array in one go like this:

Code:
> y=transpose(x=indgen(300)(,-:1:300))
ERROR (*main*) Misaligned address interrupt (SIGBUS)
WARNING source code unavailable (try dbdis function)
now at pc= 1 (of 33), failed at pc= 25
To enter debug mode, type <RETURN> now (then dbexit to get out)
>


When the two-line equivalent works fine:

Code:
> x=indgen(300)(,-:1:300)
> y=transpose(x)
>


Is this a bug or am I doing something wrong?

Regards, Thibaut.


Mon Oct 27, 2008 2:40 am
Profile WWW
Yorick Master

Joined: Mon Nov 22, 2004 9:43 am
Posts: 354
Location: Livermore, CA, USA
Post 
Yes and no. What you typed is incorrect -- you gave the transpose() function a keyword argument, transpose(x=expression). Of course, transpose does not accept any keywords, so transpose fails. Of course, it should fail much more gracefully, like cos(x=3). I notice several other common built-in functions fail badly, for example abs(x=3) and max(x=3). Does anyone want to try to make a complete list of the bad actors?

The correct statement is:
Code:
y = transpose( (x = indgen(300)(,-:1:300)) );


Tue Oct 28, 2008 7:34 pm
Profile
Yorick Master

Joined: Tue Mar 07, 2006 10:31 pm
Posts: 125
Location: Meudon, France
Post 
Thanks,

indeed, a stupid mistake, and indeed, the "cos(x=3)" error is somewhat more helpful: it simply looks less like a bug!

It looks like a dreadfully dull task to hunt down all the functions that behave like transpose. I'll try to post below if I run across similar cases.

Regards, Thibaut.


Wed Oct 29, 2008 8:28 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.