close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1404 closed defect (fixed)

segfault in syntax check

Reported by: Jorge Owned by: Víctor de Buen Remiro
Priority: high Milestone: Mantainance
Component: Kernel Version: head
Severity: major Keywords:
Cc:

Description

Sometimes a segmentation fault is generated when syntax check is apply in tolbase.

It is a bug difficult to reproduce.

Change History (10)

comment:1 Changed 13 years ago by Jorge

Status: newaccepted

comment:2 Changed 13 years ago by Jorge

The bug is related to this piece of code found in setgrainc.cpp

//--------------------------------------------------------------------
  void BSourcePath::AddEmbed(const BText& txt)
//--------------------------------------------------------------------
{
  assert(current_);
  ((BSourcePath*)current_)->embeded_.Add(txt);
}

when the syntax check is performed current_ is null because the parser is started on a buffer and not a file.

In order to reproduce this error outside tolbase do:

  • create aux.tol, no matter de the contents of the file
  • execute tolcon or tolsh from the directory containing aux.tol
  • evaluate Text check = ParseError( "#Embed \"aux.tol\";" );

comment:3 Changed 13 years ago by Jorge

Owner: changed from Jorge to Víctor de Buen Remiro
Status: acceptedassigned
void BSourcePath::AddEmbed(const BText& txt)

should emit an Error if current_==NULL

comment:4 Changed 13 years ago by Víctor de Buen Remiro

(In [4120]) Refs #1404

comment:5 Changed 13 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: assignedclosed

comment:6 Changed 13 years ago by Víctor de Buen Remiro

(In [4123]) Refs #1404

comment:7 Changed 13 years ago by Jorge

(In [4124]) refs #994, #1404: implementing the command tol::checksyntax

comment:8 Changed 13 years ago by Jorge

(In [4126]) fixes #994, refs #1404,

  • using tol::checksyntax
  • before invoking tol::checksyntax it is changed the cwd to the directory containing the file checked

comment:9 Changed 13 years ago by Jorge

(In [4127]) refs #994, #1404: using exported function from TOL CheckSyntax

comment:10 Changed 13 years ago by Jorge

(In [4128]) refs #994, #1404: using exported function from TOL CheckSyntax

Note: See TracTickets for help on using tickets.