From owner-freebsd-java@FreeBSD.ORG Sun Oct 23 13:52:47 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7AD8416A41F for ; Sun, 23 Oct 2005 13:52:47 +0000 (GMT) (envelope-from freebsd-java@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD13F43D45 for ; Sun, 23 Oct 2005 13:52:45 +0000 (GMT) (envelope-from freebsd-java@m.gmane.org) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1ETgFL-0005Ud-JM for freebsd-java@freebsd.org; Sun, 23 Oct 2005 15:50:47 +0200 Received: from pcp0010357714pcs.indpnd01.mo.comcast.net ([69.242.190.68]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 Oct 2005 15:50:47 +0200 Received: from mriem by pcp0010357714pcs.indpnd01.mo.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 Oct 2005 15:50:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-java@freebsd.org From: "Manfred Riem" Date: Sun, 23 Oct 2005 08:35:13 -0600 Lines: 269 Message-ID: References: <426b510c0510230351k718c38ffr43273a31204414e6@mail.gmail.com> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: pcp0010357714pcs.indpnd01.mo.comcast.net X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Original Sender: news Subject: Re: "An unexpected error" when i run class with constructor creatingitself. (jdk1.5.0-p2) X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Oct 2005 13:52:47 -0000 Hi Alex, "Alex Pivovarov" wrote in message news:426b510c0510230351k718c38ffr43273a31204414e6@mail.gmail.com... I made a class Constr with a constructor which run = new Constr(). public class Constr { public int field1 = 1; public Constr() { Constr constr = new Constr(); } public static void main(String args[]) { Constr constr = new Constr(); } } ------------- What I get after run: ---------------------- %java Constr # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGBUS (0xa) at pc=0x2b558260, pid=2878, tid=0x8060000 # # Java VM: Java HotSpot(TM) Client VM (1.5.0-p2-root_21_oct_2005_11_50 mixed mode) # Problematic frame: # J Constr.()V # # An error report file with more information is saved as hs_err_pid2878.log # # If you would like to submit a bug report, please write # a letter to freebsd-java@FreeBSD.org mailing list # Abort (core dumped) --------------------- log---------------------------- hs_err_pid2878.log - see below --------------- T H R E A D --------------- Current thread (0x08060c00): JavaThread "main" [_thread_in_Java, id=134610944] siginfo:si_signo=10, si_errno=0, si_code=12, si_addr=0xbfafffec Registers: EAX=0x2d5a0980, EBX=0x00000000, ECX=0x2d5a0980, EDX=0x316ac248 ESP=0xbfb02fec, EBP=0xbfb03018, ESI=0x00000000, EDI=0x00000000 EIP=0x2b558260, EFLAGS=0x00010246 Top of Stack: (sp=0xbfb02fec) 0xbfb02fec: 2b558325 2d5a0980 00000000 280966d3 0xbfb02ffc: 00000000 2d5a0980 2d5a0970 bfb03048 0xbfb0300c: 2b5582e0 2d5a0970 316ac248 bfb03048 0xbfb0301c: 2b558325 2d5a0960 00000000 280966d3 0xbfb0302c: 00000000 2d5a0960 2d5a0950 bfb03078 0xbfb0303c: 2b5582e0 2d5a0950 316ac248 bfb03078 0xbfb0304c: 2b558325 2d5a0940 00000000 280966d3 0xbfb0305c: 00000000 2d5a0940 2d5a0930 bfb030a8 Instructions: (pc=0x2b558260) 0x2b558250: 90 90 90 90 90 90 90 3b 41 04 0f 85 20 ae fe ff 0x2b558260: 89 84 24 00 d0 ff ff 55 8b ec 83 ec 28 8b 75 08 Stack: [0xbfb00000,0xbfc00000), sp=0xbfb02fec, free space=11k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V J Constr.()V ...... --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x08140c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=135532032] 0x08140800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=135531008] 0x08140400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=135529984] 0x08140000 JavaThread "Finalizer" daemon [_thread_blocked, id=135528960] 0x0806bc00 JavaThread "Reference Handler" daemon [_thread_blocked, id=134659584] =>0x08060c00 JavaThread "main" [_thread_in_Java, id=134610944] Other Threads: 0x0805af00 VMThread [id=134658560] 0x0805aa00 WatcherThread [id=135655936] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 576K, used 326K [0x2d560000, 0x2d600000, 0x2da40000) eden space 512K, 51% used [0x2d560000, 0x2d5a1a88, 0x2d5e0000) from space 64K, 100% used [0x2d5f0000, 0x2d600000, 0x2d600000) to space 64K, 0% used [0x2d5e0000, 0x2d5e0000, 0x2d5f0000) tenured generation total 1408K, used 416K [0x2da40000, 0x2dba0000, 0x31560000) the space 1408K, 29% used [0x2da40000, 0x2daa8008, 0x2daa8200, 0x2dba0000) compacting perm gen total 8192K, used 1329K [0x31560000, 0x31d60000, 0x35560000) the space 8192K, 16% used [0x31560000, 0x316ac508, 0x316ac600, 0x31d60000) No shared spaces configured. Dynamic libraries: 0x08048000 /usr/local/jdk1.5.0/bin/java 0x2808c000 /usr/lib/libpthread.so.1 0x280b0000 /lib/libc.so.5 0x2818b000 /usr/local/jdk1.5.0/jre/lib/i386/client/libjvm.so 0x285dd000 /lib/libm.so.3 0x285f9000 /usr/local/jdk1.5.0/jre/lib/i386/native_threads/libhpi.so 0x2860a000 /usr/local/jdk1.5.0/jre/lib/i386/libverify.so 0x28617000 /usr/local/jdk1.5.0/jre/lib/i386/libjava.so 0x28635000 /usr/local/jdk1.5.0/jre/lib/i386/libzip.so 0x28055000 /libexec/ld-elf.so.1 VM Arguments: java_command: Constr Environment Variables: JAVA_HOME=/usr/local/jdk1.5.0 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/alex/bin LD_LIBRARY_PATH=/usr/local/jdk1.5.0/jre/lib/i386/client:/usr/local/jdk1.5.0/jre/lib/i386:/usr/local/jdk1.5.0/jre/../lib/i386 SHELL=/bin/csh DISPLAY=:0.0 HOSTTYPE=FreeBSD OSTYPE=FreeBSD MACHTYPE=i386 --------------- S Y S T E M --------------- OS:FreeBSD uname:FreeBSD 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Wed Oct 19 20:52:56 MSD 2005 root@st1.fqdn:/usr/src/sys/i386/compile/st1deb i386 rlimit: STACK 65536k, CORE infinity, NOFILE 7322 CPU:total 1 family 6, cmov, cx8, fxsr, mmx Memory: 4k page, physical 469292k vm_info: Java HotSpot(TM) Client VM (1.5.0-p2-root_21_oct_2005_11_50) for freebsd-x86, built on Oct 21 2005 13:43:00 by root with gcc 3.4.2 [FreeBSD] 20040728 ------------------------ P.S. -------------------------- in jdk1.4.2-p7 after run this class I just get stack overflow error. %java TestCon Exception in thread "main" java.lang.StackOverflowError _______________________________________________ freebsd-java@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-java To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org" This is a completely normal error. You are recursive constructing an object in the constructor. This will always generate a StackOverflowError. Since you are not catching Errors the VM can have a default implementation that prints out a message (just like it does). Kind regards, Manfred Riem mriem@manorrock.org