bugGNU Octave - Bugs: bug #52080, Segmentation fault when calling...

 
 

bug #52080: Segmentation fault when calling clear all on classdef with local functions that cause parse error

Submitted by:  Piotr Held <jsoh425>
Submitted on:  Wed 20 Sep 2017 08:56:56 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Piotr HeldOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Thu 21 Sep 2017 05:31:08 PM UTC, comment #7:

Works here, thanks.

The program hang I've noticed for a while, several weeks or more. Maybe it is just perception, but I've found having to use Cntrl-C quite a bit compared to the past. It's been bug investigation mainly lately, so that may be why.

Dan Sebald <sebald>
Thu 21 Sep 2017 03:52:47 PM UTC, comment #6:

I tested it and the cset fixes the problem, thanks!

Piotr Held <jsoh425>
Thu 21 Sep 2017 03:35:52 PM UTC, comment #5:

I pushed the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/5b88383b9a69

John W. Eaton <jwe>
Project Administrator
Thu 21 Sep 2017 02:18:12 PM UTC, comment #4:

The problem is that we are installing local functions as we find them, but then if there is a parse error, we try to clean up the list of local functions that we've found but they also still exist in the table of local functions. I think the solution is to defer installing them in the table of local functions until after the file is parsed correctly. I'm working on a patch to do that.

I'm sure that there is still a segfault with the --no-gui option, it's just that the wrapper program is hanging when that happens. That's a separate bug.

John W. Eaton <jwe>
Project Administrator
Thu 21 Sep 2017 06:26:35 AM UTC, comment #3:

I'm using version/changeset

changeset 24054:8a6747c6db1a
Sun, 17 Sep 2017 22:16:14 -0400

on Linux. With the --no-gui option, the behavior is an infinite loop or hung program, no segmentation fault.

But to isolate the problem, it seems to be the function clear that is the problem:

where the program hung after line 3. My guess would be that the syntax error causes a clean-up of function foo2, but the reference to it is probably not removed from the symbol table. Hence clearing the function list ends up clearing foo2, which is no longer valid.

Dan Sebald <sebald>
Thu 21 Sep 2017 04:57:43 AM UTC, comment #2:

Here is a back trace from the Address Sanitizer which may help in debugging.

Rik <rik5>
Project Administrator
Thu 21 Sep 2017 12:55:09 AM UTC, comment #1:

What hg id are you using?

Also, do you get the segfault immediately or only when you exit Octave?

I put your code into a file segfault.m and then ran

I didn't have an immediate issue, but after calling exit I get a double free

This is with hg id d9b0d8ae734f.

Rik <rik5>
Project Administrator
Wed 20 Sep 2017 08:56:56 PM UTC, original submission:

The error occurs when calling 'clear all' after trying to create following classdef object:

The segmentation fault happens when clearing foo1 in symbol_table::clear_functions (symtab.h:1430).

I attached the classdef file.

Piotr Held <jsoh425>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #41849:  seg_fault.m added by jsoh425 (80B - text/x-objcsrc)

 

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 sebald (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jsoh425 (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
    Thu 21 Sep 2017 04:11:24 PM UTCjweStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Thu 21 Sep 2017 03:35:52 PM UTCjweStatusConfirmed=>Ready For Test
    Thu 21 Sep 2017 12:55:09 AM UTCrik5StatusNone=>Confirmed
    Wed 20 Sep 2017 08:56:56 PM UTCjsoh425Attached File-=>Added seg_fault.m, #41849

    Back to the top


    Powered by Savane 3.1-cleanup1