Project

General

Profile

Bug #807

DiagMat: mySetEntry checks the entry is writable only if debugging active

Added by John Abbott over 8 years ago. Updated almost 7 years ago.

Status:
Rejected
Priority:
High
Assignee:
Category:
Safety
Start date:
14 Nov 2015
Due date:
% Done:

100%

Estimated time:
1.01 h
Spent time:

Description

The mem fn mySetEntry for DiagMat checks that the indices indicate a diagonal element only if CoCoA_DEBUG has been set. Surely this is a bug?

History

#1 Updated by John Abbott over 8 years ago

As a general rule we say that mem fns do not perform arg sanity checks because such checks are the responsibility of the standard fn which calls the mem fn -- this also allows CoCoALib "internal" functions to call the faster mem fns if we know that the args must be good.

Ooops, my mistake I had forgotten that the approved way of setting a matrix entry is to call SetEntry(M,i,j,val); I thought the only way was to call mySetEntry directly.

Shall we close/reject this issue?

#2 Updated by Anna Maria Bigatti about 8 years ago

  • Target version changed from CoCoALib-0.99540 Feb 2016 to CoCoALib-0.99550 spring 2017

#3 Updated by John Abbott over 7 years ago

  • Status changed from New to In Progress
  • Priority changed from Normal to High
  • Target version changed from CoCoALib-0.99550 spring 2017 to CoCoALib-0.99560
  • % Done changed from 0 to 10

After a quick check, it now seems that all code in MatrixView.C should be checked to make sure that it does not attempt to write where it may not (cannot?) even when debugging is turned off.

Postponing because this is probably going to be a little tedious to get completely right.

#4 Updated by John Abbott over 7 years ago

  • Status changed from In Progress to Rejected
  • Assignee set to John Abbott
  • Target version changed from CoCoALib-0.99560 to CoCoALib-0.99550 spring 2017
  • % Done changed from 10 to 100

This is not a bug. The non mem fn SetEntry calls explicitly myIsWritable, whereas the mem fn deliberately excludes this check (except when debugging is active).

A general design idea of CoCoALib is that normal (public) fns always perform sanity checks on their args, while mem fns (and possibly certain other public fns with "strange names") do not perform sanity checks except when debugging is active. There may be a few exceptions where the main public interface is via the mem fn (these should then perform sanity checks).

Rejecting this issue.

#5 Updated by Anna Maria Bigatti almost 7 years ago

  • Estimated time set to 1.01 h

Also available in: Atom PDF