NetBSD Problem Report #50369

From  Mon Oct 26 12:12:13 2015
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer "Postmaster" (verified OK))
	by (Postfix) with ESMTPS id B4ADBA65C8
	for <>; Mon, 26 Oct 2015 12:12:13 +0000 (UTC)
Message-Id: <>
Date: Mon, 26 Oct 2015 12:12:12 +0000 (UTC)
Subject: bozohttpd's lua state isn't closed, garbage collectors aren't called
X-Send-Pr-Version: www-1.0

>Number:         50369
>Category:       misc
>Synopsis:       bozohttpd's lua state isn't closed, garbage collectors aren't called
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 26 12:15:00 +0000 2015
>Last-Modified:  Tue Jul 14 19:41:07 +0000 2020
>Originator:     Jan Danielsson
>Release:        netbsd-7
La Cosa Nostra Ltd
NetBSD nb7.farrah 7.0 NetBSD 7.0 (VBOX) #0: Fri Oct  9 19:10:06 CEST 2015  jan@nb7.farrah:/home/jan/sysbuild/obj.amd64/usr/src/sys/arch/amd64/compile/VBOX amd64

After processing a request to a Lua handler it doesn't appear that the Lua state is closed properly. This causes objects which need to be cleaned up by the garbage collector never to be cleaned up.
Create a Lua table/object which creates a local domain socket, and which has a garbage collector which closes the socket and removes the corresponding file in the file system.

Instantiate that object in a Lua handler in bozohttpd; make a few connections which cause the objects to be created, and notice all the socket files remain in the file system since their garbage collectors where never called.
Add lua_close(L) after the Lua context is no longer needed for the request.



Responsible-Changed-From-To: misc-bug-people->mbalmer
Responsible-Changed-When: Sun, 27 Mar 2016 09:52:22 +0000

Responsible-Changed-From-To: mbalmer->misc-bug-people
Responsible-Changed-When: Tue, 14 Jul 2020 19:41:07 +0000
Reset to role account.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.