bugGNU Octave - Bugs: bug #32843, crash when using function defined...

 
 

bug #32843: crash when using function defined in %!test block

Submitted by:  Carlo de Falco <cdf>
Submitted on:  Fri 18 Mar 2011 09:35:08 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 02 Aug 2012 12:43:06 AM UTC, comment #4:

Functions in %!test blocks are not allowed. No segmentation faults will occur because test blocks are scanned for function declarations and any declarations are disallowed. The solution for %!test blocks which need to have functions is to use the shared function syntax of %!function/%!endfunction.

Rik <rik5>
Project Administrator
Mon 19 Dec 2011 02:26:11 AM UTC, comment #3:

I have committed a changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/80bda7c4f012) which prevents embedded functions within %!test blocks. This will stop the segmentation faults and the warning message points directs coders to the syntax which does work (%!function/%!endfunction). The root cause fix is still to address how subfunctions are handled in Octave.

Rik <rik5>
Project Administrator
Wed 14 Dec 2011 05:13:45 PM UTC, comment #2:

There is a workaround. Use a '%!function' block rather than defining the function within a %!test block.

The following works:

Rik <rik5>
Project Administrator
Sat 19 Mar 2011 12:38:49 AM UTC, comment #1:

Confirmed on recent tip (12519:91ccd08fe80c). There's no reason to even use a for loop, the code always crashes on the 3rd invocation. Testing was done on a Linux platform indicating it is not just Mac OS which suffers this problem.

For convenience, I've attached the file pippo.m to use when reproducing the problem.

(file #22970)

Rik <rik5>
Project Administrator
Fri 18 Mar 2011 09:35:08 PM UTC, original submission:

I noticed this bug while testing the patch http://savannah.gnu.org/patch/?7482

I get this consistently reproducible crash with the developers branch on OSX.

Let the file 'pippo.m' contain the following:

if I run 'test pippo' once everything works fine, but after repeating the command a few times:

c.

Carlo de Falco <cdf>
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 #22970:  pippo.m added by rik5 (85B - application/octet-stream)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by cdf (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 02 Aug 2012 12:43:06 AM UTCrik5StatusConfirmed=>Wont Fix
      Open/ClosedOpen=>Closed
    Mon 19 Dec 2011 02:26:11 AM UTCrik5Summarycrash when repeatedly running a test where a function is defined in the test code=>crash when using function defined in %!test block
    Wed 14 Dec 2011 05:05:22 PM UTCrik5Dependencies-=>bugs #35068 is dependent
    Thu 11 Aug 2011 12:38:41 PM UTCjweDependencies-=>bugs #33981 is dependent
    Sat 19 Mar 2011 12:38:49 AM UTCrik5Attached File-=>Added pippo.m, #22970
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1