bugGNU Octave - Bugs: bug #41945, Segfault when subsasgn returns...

 
 

bug #41945: Segfault when subsasgn returns nothing in user-defined class

Submitted by:  Andreas Weber <andy1978>
Submitted on:  Mon 24 Mar 2014 03:45:48 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.1Operating 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 Mar 2014 10:25:53 AM UTC, comment #5:

Stefan, thank you for your patch. I've applied it to default: http://hg.savannah.gnu.org/hgweb/octave/rev/75467145096f

-- Andy

Andreas Weber <andy1978>
Project Member
Mon 24 Mar 2014 10:51:10 PM UTC, comment #4:

The segfault in function occurs octave_user_function::subsasgn_optimization_ok, because ret_list is NULL (since there's output argument to subsasgn). Using 'function out = subsasgn' also triggers a segfault - in this case param_list is NULL.

Patch is attached or can be found here (with some other ones): bookmark nkf-ready

(file #31030)

Stefan Mahr <dac922>
Mon 24 Mar 2014 10:05:56 PM UTC, comment #3:

Yes, I made a typo in subsasgn. Now it segfaults too. Sorry.

Stefan Mahr <dac922>
Mon 24 Mar 2014 09:23:15 PM UTC, comment #2:

segfault here also with default 54a1e95365e1, configured without jit. GDB backtrace below.

I figured out that it only segfaults when optimize_subsasgn_calls is enabled.

Andreas Weber <andy1978>
Project Member
Mon 24 Mar 2014 04:14:06 PM UTC, comment #1:

No segfault with dev (5cf9a02732b6)

Stefan Mahr <dac922>
Mon 24 Mar 2014 03:45:48 PM UTC, original submission:

When playing with user-defined classes I get a segfault when there is no return from @myclass/subasgn

I think implementing subsasgn in a user-defined class without return value (like my example above) doesn't make sense but nevertheless octave shouldn't segfault.

-- Andy

Andreas Weber <andy1978>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #31030:  subsasgn.diff added by dac922 (899B - text/x-patch)
file #31024:  myclass.tar.gz added by andy1978 (355B - application/x-gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Updated the item)
  • -unavailable- added by dac922 (Posted a comment)
  • -unavailable- added by andy1978 (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 28 Mar 2014 06:24:00 PM UTCjordighStatusNone=>Fixed
    Tue 25 Mar 2014 10:25:53 AM UTCandy1978Open/ClosedOpen=>Closed
    Mon 24 Mar 2014 10:51:10 PM UTCdac922Attached File-=>Added subsasgn.diff, #31030
    Mon 24 Mar 2014 03:45:48 PM UTCandy1978Attached File-=>Added myclass.tar.gz, #31024

    Back to the top


    Powered by Savane 3.1-cleanup1