Received: (at submit) by bugs.debian.org; 10 Dec 2000 03:41:19 +0000 From bgjenero@sympatico.ca Sat Dec 09 21:41:19 2000 Return-path: Received: from dyn208-28-50-215.win.mnsi.net (chimera.tff.ca) [208.28.50.215] (mail) by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 144xMU-0006lh-00; Sat, 09 Dec 2000 21:41:18 -0600 Received: from localhost ([127.0.0.1] helo=no.spam.ca ident=bgjenero) by chimera.tff.ca with esmtp (Exim 3.12 #1 (Debian)) id 144xOJ-0000o5-00 for ; Sat, 09 Dec 2000 22:43:11 -0500 Sender: bgjenero Message-ID: <3A32FBCB.FEE091F8@no.spam.ca> Date: Sat, 09 Dec 2000 22:43:07 -0500 From: Boris Gjenero Organization: The First Frontier X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.17 i586) X-Accept-Language: en MIME-Version: 1.0 To: submit@bugs.debian.org Subject: atexit functions don't work after XF86DGAGetVideo Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Delivered-To: submit@bugs.debian.org Package: xlib6g-dev Version: 3.3.6-11 This deals with the XFree86-DGA X extension's XF86DGAGetVideo function in /hdb1/usr/X11R6/lib/libXxf86dga.a and functions set to run when the program is exiting using atexit. Any atexit function set up before a call to XF86DGAGetVideo will not run on exit after the XF86DGAGetVideo call. However, any functions set up with atexit after the XF86DGAGetVideo call will run normally. If a program exits after XF86DGAGetVideo has been called it will print the message "video memory protecting" at the end. This happens regardless of whether DGA mode was ever entered. That message is printed once even if XF86DGAGetVideo is called multiple times. For an atexit function to work in this case atexit must be used after the last XF86DGAGetVideo call. So basically, it seems that XF86DGAGetVideo installs some function using the atexit mechanism. Either that function causes an immediate exit or it is installed in such a way that the list of functions to run at exit is corrupted. Clearly XF86DGAGetVideo is doing something wrong. I don't think it should even install a function to run at exit. It would be more logical for XF86DGADirectVideo to install such a function because XF86DGAGetVideo just gets some information and XF86DGADirectVideo actually starts DGA mode. It is easy to investigate this behaviour. Just get the source to the XFree86-DGA demonstration client, add some function and put atexit calls in various locations. The demonstration client is /usr/X11R6/bin/dga in package xbase-clients. Oh, and BTW. my gcc package version is 2.95.2-13. I don't think this is compiler-related, but who knows.