bugGNU Octave - Bugs: bug #34861, user defined function does not...

 
 

bug #34861: user defined function does not reload automatically

Submitter:  Matyas Sustik <sustik>
Submitted:  Sat 19 Nov 2011 02:22:53 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Matyas Sustik Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 27 Feb 2013 08:58:51 PM UTC, comment #9: 
Jordi Gutiérrez Hermoso <jordigh>
Group Member
Wed 27 Feb 2013 07:36:40 PM UTC, comment #8: 

At Jordi's suggestion I attached patch that removes the class octave_mex_file_list.

(file #27539)

Janne Olavi Paanajärvi <jpaanaja>
Tue 26 Feb 2013 10:04:07 AM UTC, comment #7: 

I added an alternate fix that extends octave_mex_file_list and
uses it instead of octave_shlib_list.

Janne Olavi Paanajärvi <jpaanaja>
Fri 22 Feb 2013 06:10:11 PM UTC, comment #6: 

Yeah, I wondered about the need of octave_mex_file_list, but I opted for minimal fix. You can't move to completely using octave_mex_file_list here because you need the octave_shlib_list::find_file.

Janne Olavi Paanajärvi <jpaanaja>
Fri 22 Feb 2013 04:33:41 PM UTC, comment #5: 

jwe seems to be in a pruning mode for dead code.  Perhaps we should bring the potential duplicate of octave_shlib_list, octave_mex_file_list up on the Octave Maintainers list and see if we can't eliminate octave_mex_file_list.

Rik <rik5>
Group administrator
Fri 22 Feb 2013 04:10:37 PM UTC, comment #4: 

I was about to apply your fix, but then I realised that this basically invalidates the need for octave_mex_list completely, since you removed the only two places where this is used. Wouldn't it make more sense to change the octave_shlib_list::append call to octave_mex_file_list::append instead?

Alternatively, perhaps there is no need to keep two separate lists of shlibs at all, so perhaps it does make sense to completely get rid of the octave_mex_file_list singleton.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Fri 22 Feb 2013 03:34:12 PM UTC, comment #3: 

Would it be too troubling to amend your commit message to follow our guidelines? First line should be short, and you should say which files and functions you patched and how.

http://wiki.octave.org/Commit_message_guidelines

With a recent enough Mercurial, you can do the following to amend it:


hg up -r bcbc12ab80c4
hg commit --amend


and show us the revised patch.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Fri 22 Feb 2013 03:13:26 PM UTC, comment #2: 

I attached a patch that fixes the issue for me. The problem was that on reload previous mex function was not properly cleared due to it being appended both to octave_shlib_list and octave_mex_file_list. I cannot see the reason for using octave_mex_file_list here. Removing its use fixes the bug.

(file #27499)

Janne Olavi Paanajärvi <jpaanaja>
Sat 19 Nov 2011 06:15:17 PM UTC, comment #1: 

It looks like the web interface ate part of your post. I'm copying it here:


octave:1> mex myhello.c
 octave:2> myhello
 ans =  1.2346
 ## edit the file myhello.c
 octave:3> mex myhello.c
 octave:4> myhello
 warning: library /export/home/jwe/myhello.mex not reloaded due to existing
references
 ans =  1.2346


Small favour, can you please attach myhello.c so we can have a complete example of the problem?

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Sat 19 Nov 2011 02:22:53 AM UTC, original submission:  

If a user function or oct/mex file changes, then it is not properly
reloaded by octave.  In version 3.2.3 (debian testing is what I am using) a recompile of the mex file causes a segfault on subsequent invocation.

According to John W. Eaton, the current development version does not segfault, but still does not behave properly:


octave:1> mex myhello.c
 octave:2> myhello
 ans =  1.2346
 ## edit the file myhello.c
 octave:3> mex myhello.c
 octave:4> myhello
 warning: library /export/home/jwe/myhello.mex not reloaded due to existing references
 ans =  1.2346
+verbatim+

Matyas Sustik <sustik>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #27539:  mexfix4.diff added by jpaanaja (3KiB - text/x-patch)
file #27532:  mexfix3.diff added by jpaanaja (3KiB - text/x-patch - Alternate fix)
file #27501:  mexfix2.diff added by jpaanaja (1KiB - text/x-patch - revised commit message)
file #27499:  mexfix.diff added by jpaanaja (974B - text/x-patch)
file #24399:  myhello.C added by sustik (162B - text/x-c++src)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by jpaanaja (Updated the item)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by sustik (Submitted the item)
  • -email is unavailable- added by sustik
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-11 jordigh Dependencies- bugs #39461 is dependent
    2013-02-27 jordigh StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2013-02-27 jpaanaja Attached File- Added mexfix4.diff, #27539
    2013-02-26 jpaanaja Attached File- Added mexfix3.diff, #27532
    2013-02-22 jpaanaja Attached File- Added mexfix2.diff, #27501
    2013-02-22 jordigh StatusConfirmed Patch Submitted
    2013-02-22 jpaanaja Attached File- Added mexfix.diff, #27499
    2012-02-27 rik5 Item GroupSegfault, Bus Error, etc. Incorrect Result
        StatusNone Confirmed
        Release3.2.3 dev
    2011-11-19 sustik Attached File- Added myhello.C, #24399
    2011-11-19 sustik Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code