bugGNU Octave - Bugs: bug #39058, Unexpected behavior from...

 
 

bug #39058: Unexpected behavior from mexPutVariable

Submitted by:  None
Submitted on:  Thu 23 May 2013 10:21:50 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: None
Originator Name: Kory DonatiOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.4
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 31 May 2013 02:50:40 PM UTC, comment #1:

I checked in the following change on the default branch. I don't expect that there will be another 3.6.x release, so to get this fix you'll need to either wait for the next major release of Octave (either 3.8 or 4.0) or build the development version of Octave from sources.

http://hg.savannah.gnu.org/hgweb/octave/rev/08f0f274de36

John W. Eaton <jwe>
Project Administrator
Thu 23 May 2013 10:21:50 PM UTC, original submission:

I think the mex function mexPutVariable is not working correctly, specifically when the desired workspace is set to "caller" and the mex file is called from within a function. If an mxArray is passed to the "caller" workspace from mexPutVariable, it is actually passed to one level above the caller.

In the attached example, the mex source file simple_array.c creates an array to pass to the caller's workspace. If compiled using: "mkoctfile --mex simple_array.c" and executed: "simple_array" from the command line, the variable out_caller appears in the workspace as expected, verified using "whos".

However, if the mex file is called within a m-file function(see run_me.m), then the variable is not pased to the caller, but to the base workspace. This can be seen in the attached run_me.m file. I expect to see the who list called in run_me.m to return OUT_caller.

command line calls in order:
mkoctfile --mex simple_array.c
run_me
%whos output shows nothin in run_me workspace.
whos
%output from comand line shows variable out_caller

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #28152:  simple_array.c added by None (670B - application/octet-stream)
file #28153:  run_me.m added by None (59B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 31 May 2013 02:50:40 PM UTCjweSummaryUnecpected behavior from mexPutVariable=>Unexpected behavior from mexPutVariable
    Fri 31 May 2013 02:50:39 PM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 23 May 2013 10:21:50 PM UTCNoneAttached File-=>Added simple_array.c, #28152
      Attached File-=>Added run_me.m, #28153

    Back to the top


    Powered by Savane 3.1-cleanup1