bugGNU Octave - Bugs: bug #32222, object array failure

 
 

bug #32222: object array failure

Submitted by:  None
Submitted on:  Mon 24 Jan 2011 10:25:07 AM UTC  
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  dev
Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 25 Jan 2011 08:21:37 AM UTC, comment #3: 

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/7e856c31ffae

It fixes the problem for me, so I'm closing this report.

John W. Eaton <jwe>
Project Administrator
Tue 25 Jan 2011 08:18:24 AM UTC, comment #2: 

Maybe an additional hint: When I run

d(2) = cfg_dep;

where d does not exist before, I get a vector of cfg_dep objects. However, only d(2) gets properly initialised. The fields of d(1) are set to something, but not to their initial values.

Volkmar Glauche <glauche>
Mon 24 Jan 2011 11:21:31 PM UTC, comment #1: 

I have not yet found why the index out of bounds error is happening, but I discovered a segfault if I do

matlabbatch{1}.spm.spatial.realign.estimate.eoptions.weight = '';
matlabbatch{2}.spm.spatial.realign.write.data(1) = cfg_dep;
matlabbatch{2}.spm.spatial.realign.write.data(1)
matlabbatch{2}.spm.spatial.realign.write.data

Jaroslav, do you see why this error and crash are happening?

John W. Eaton <jwe>
Project Administrator
Mon 24 Jan 2011 10:25:07 AM UTC, original submission:  

In the context of SPM, I try to create an array of custom objects. However, the following code fails:

matlabbatch{1}.spm.spatial.realign.estimate.eoptions.weight = '';
matlabbatch{2}.spm.spatial.realign.write.data(1) = cfg_dep;
matlabbatch{2}.spm.spatial.realign.write.data(1)
error: subsref: A(I): index out of bounds; value 1 out of bound 0
error: called from:
error:   /home/volkmar/octave/@cfg_dep/subsref.m at line 29, column 5

Similar code works:

matlabbatch{1}.spm.spatial.realign.estimate.eoptions.weight = '';
matlabbatch{2}.spm.spatial.realign.write.data = cfg_dep;

Unfortunately, I can't simply use the second version of the code, since the first version of code exists in many scripts that SPM users created on their own.

Best,

Volkmar

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #22502:  cfg_dep.tgz added by None (5KiB - application/x-compressed-tar)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by glauche (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jwe
  • -email is unavailable- added by glauche
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-01-25 jwe StatusNone => Fixed
        Open/ClosedOpen => Closed
    2011-01-24 jwe Carbon-Copy- => Added highegg
    2011-01-24 glauche Carbon-Copy- => Added glauche
    2011-01-24 None Attached File- => Added cfg_dep.tgz, #22502

    Back to the top


    Powered by Savane 3.5