bugGNU Octave - Bugs: bug #35068, segfault when running %!test block...

 
 

bug #35068: segfault when running %!test block with embedded %!function

Submitted by:  None
Submitted on:  Wed 14 Dec 2011 09:14:04 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: DuplicateAssigned to: None
Originator Name: Josef LeydoldOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.3
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.

 

Mon 19 Dec 2011 02:24:06 AM UTC, comment #4:

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.

I am going to close this bug and keep the original report open.

Rik <rik5>
Project Administrator
Thu 15 Dec 2011 09:00:20 AM UTC, comment #3:

Sorry for reporting this known bug but I obviously have missed this entry in the database.

I have found this problem when I wanted to test an oct file where
a function handler is passed to a C routine in a rather complex way. Since octave crashed with a segfault I first assumed that it was my error and spent some time to find the point where my program crashes.

So if there is yet no fix on the development branch may I suggest to report this bug in the Octave manual, e.g. in
Section "F.1 Actual Bugs We Haven't Fixed Yet", and/or even better in Section "B.1 Test Functions".

BTW, there is a typo in the manual in the latter section.
The example
does not work.

Anyway, thanks a lot for your help.

Josef Leydold <leydold>
Wed 14 Dec 2011 05:11:41 PM UTC, comment #2:

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

The following works:

Rik <rik5>
Project Administrator
Wed 14 Dec 2011 05:05:22 PM UTC, comment #1:

Alas, this bug has been reported a while back and there is no fix for it yet on the development branch either. See bug #32843.

Rik <rik5>
Project Administrator
Wed 14 Dec 2011 09:14:04 AM UTC, original submission:

Suppose one has the following test file 'testbug' that just contains the following two lines:

and runs this test three times, e.g., by means of the following script 'testbug.m' using 'octave testbug.m'
from the command line:

Then octave crashes with a segfault:

When running octave with valgrind I get the following error report:

I guess that octave accidently has freed a function pointer and set it to NULL and then tried to call the function.

I am new to octave so I know too little about the internal structures of octave so I cannot trace down the error.
The call stack before the crash lists functions like 'tree_evaluator::visit_statement' so it happens somewhere in the parse tree of the interpreter.

Josef

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by leydold (Posted a comment)
  • -unavailable- added by rik5 (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
    Mon 19 Dec 2011 02:24:06 AM UTCrik5StatusConfirmed=>Duplicate
      Open/ClosedOpen=>Closed
    Wed 14 Dec 2011 05:11:41 PM UTCrik5StatusNone=>Confirmed
    Wed 14 Dec 2011 05:05:22 PM UTCrik5Summaryoctave segfaults when running test functions=>segfault when running %!test block with embedded %!function
      Dependencies-=>Depends on bugs #32843

    Back to the top


    Powered by Savane 3.1-cleanup1