From owner-freebsd-hackers Thu Nov 15 11:41:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by hub.freebsd.org (Postfix) with ESMTP id 28EBF37B416 for ; Thu, 15 Nov 2001 11:41:43 -0800 (PST) Received: (qmail 856 invoked from network); 15 Nov 2001 19:41:12 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 15 Nov 2001 19:41:12 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3BF4185B.35A8B872@mitre.org> Date: Thu, 15 Nov 2001 11:41:41 -0800 (PST) From: John Baldwin To: "PSI, Mike Smith" Subject: RE: _init execs in middle of code Cc: hackers@freebsd.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 15-Nov-01 PSI, Mike Smith wrote: > Does anyone know exactly what _init is? An "nm" of my executable lists: > > 080486a8 ? _init > > It is the lowest numeric address (before _start and main) so I would > assume it is some sort of program initialization code. But when trying > to determine the cause of a kernel freeze (caused by my user app), I > found that _init is being "called" after quite a bit of code has been > executed. > > I scanned every library known to man and of course all of my objects. I > cannot find any symbol reference to _init anywhere so I can only guess > it is set up by the linker. HELP! My kernel freezes (every 2nd/3rd > execution of the program) so I can't run the debugger on the kernel. > > However, the freeze condition is very repeatable (happens what appears > to be the same point in the execution WHEN it happens) so if I can > figure out what _init is, I may have a chance to solve this. > > Also if _init isn't supposed to be called during a program running, can > anyone give a clue as to what stupid programming error could cause this > to happen? IIRC, _init is when constructors for global variables are called (and _fini is when destructors are called.) It is magic behind the scenes generated by the compiler and linker. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message