Ticket #1404 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

segfault in syntax check

Reported by: josp Owned by: vdebuen
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

Changed 2 years ago by josp

  • status changed from new to accepted

Changed 2 years ago by josp

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\";" );

Changed 2 years ago by josp

  • owner changed from josp to vdebuen
  • status changed from accepted to assigned
void BSourcePath::AddEmbed(const BText& txt)

should emit an Error if current_==NULL

Changed 2 years ago by vdebuen

(In [4120]) Refs #1404

Changed 2 years ago by vdebuen

  • status changed from assigned to closed
  • resolution set to fixed

Changed 2 years ago by vdebuen

(In [4123]) Refs #1404

Changed 2 years ago by josp

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

Changed 2 years ago by josp

(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

Changed 2 years ago by josp

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

Changed 2 years ago by josp

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

Note: See TracTickets for help on using tickets.