Project

General

Profile

Bug #1651

SEGV subsets ??

Added by John Abbott over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bug
Target version:
Start date:
25 Jan 2022
Due date:
% Done:

100%

Estimated time:
0.99 h
Spent time:

Description

This was a surprise:

/**/ L := 1..5000;
/**/ S := subsets(L,2);

Process cocoa5 segmentation fault (core dumped)

The crash came relatively quickly (30s, maybe)
Stack overflow? top did not report excessive memory usage (about 1Gbyte)

History

#1 Updated by John Abbott over 2 years ago

On Julian's computer (Linux, CoCoA-5.3.3b), it gave a controlled CoCoA-5 error: "too many recursive calls" (or similar).
Why did mine SEGV?

#2 Updated by John Abbott over 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I have just used ulimit to increase my stacksize limit, and now I get "too many recursions":

--> ERROR: Too many nested scopes
--> WHERE: at line 46 (column 24) of combinatoria.cpkg5
-->   If N = 1 Then Return [[X] | X In S]; EndIf;
-->                        ^^^^^^^^^^^^^^

I suppose we should re-write subsets so that it does not recurse too deeply.

#3 Updated by Anna Maria Bigatti over 2 years ago

On my Mac I get

--> ERROR: Too many nested scopes

#4 Updated by John Abbott about 2 years ago

  • Status changed from In Progress to Resolved
  • Assignee set to John Abbott
  • % Done changed from 10 to 70

I have modified the impl of SubsetsN in combinatoria.cpkg5 so that it handles 2-subsets specially (avoiding recursion).

My computer SEGV'd because of stack overflow. Not sure why. Julian's Linux box had the same stack limit but didn't overflow.
Anyway, the non-recursive impl should now avoid that problem completely.

Marked as resolved.

#5 Updated by John Abbott about 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 70 to 100
  • Estimated time set to 0.99 h

Too much stress to keep this open any longer. I'm pretty sure it is fixed now (and faster too).
Let the users do the testing -- that's what everyone else seems to do!

Also available in: Atom PDF