Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pike
pike
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 105
    • Issues 105
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pikelang
  • pikepike
  • Issues
  • #1937

Closed
Open
Opened Aug 08, 2001 by Peter Bortas@zinoOwner

Frames not freed timely in exception unwinding with named lambdas

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=1937

Reported by Martin Stjernholm mast@roxen.com

When the error is thrown in the following program, the ref to the MutexKey k is not freed during the exception unwinding. It thus causes the x->lock() after the catch to fail with a recursive mutex locks error. A gc() call frees the key.

    Thread.Mutex x = Thread.Mutex();

    void f()
    {
      Thread.MutexKey k = x->lock();
      int i = 17;
      void sub (int k)
      {
	if (k < i) sub (k + 1);
	error ("x\n");
      };
      sub (0);
    }

    int main()
    {
      catch (f());
      werror ("%O\n", x->lock());
    }

I consider this a bug, since much code counts on that mutex keys in local variables are freed on exception unwinding. Also, there are no dynamic frames involved that have reason to exist outside the call to f. The problem exists in all 7.x versions.

Assignee
Assign to
Pike 7.2
Milestone
Pike 7.2
Assign milestone
Time tracking
None
Due date
None
Reference: pikelang/pike#1937