Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2002 14:42:50 -0500
From:      Charles Anderson <caa@midgard.dhs.org>
To:        Greg Lewis <glewis@eyesbeyond.com>
Cc:        Fuyuhiko Maruyama <fuyuhik8@is.titech.ac.jp>, Michael E Mercer <mmercer@nc.rr.com>, freebsd-java@FreeBSD.ORG
Subject:   Re: LimeWire crash gdb information
Message-ID:  <20021219194250.GC11902@midgard.dhs.org>
In-Reply-To: <20021112163230.A95899@misty.eyesbeyond.com>
References:  <3DBAE791.27A93619@nc.rr.com> <20021027083816.B10962@misty.eyesbeyond.com> <3DBB49F8.941D3E09@nc.rr.com> <3DBB4CEA.E0DC7E1C@nc.rr.com> <3DBB5250.8DA88B27@nc.rr.com> <20021030172314.A31631@misty.eyesbeyond.com> <55of97wizj.wl@dittohead.is.titech.ac.jp> <20021112163230.A95899@misty.eyesbeyond.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I just had limewire crash while running java_g, so I poked around a bit.
I found this.
(gdb) where
#0  0x280b8b58 in kill () from /usr/lib/libc.so.4
#1  0x280fa109 in abort () from /usr/lib/libc.so.4
#2  0x281765b9 in Abort ()
    at ../../../src/share/javavm/runtime/interpreter.c:1449
#3  0x281b3e95 in panic (
    format=0x2807df80 "\"%s\", line %d: assertion failure\n")
    at ../../../src/share/javavm/runtime/util.c:126
#4  0x28072dd0 in open (fname=0x280fb600 ".", flags=0)
    at ../../../../src/solaris/hpi/green_threads/src/iomgr.c:744
#5  0x28094d52 in realpath () from /usr/lib/libc.so.4
#6  0x2c339be8 in canonicalize (
    original=0x8c77f00 "/home/mp3/work/Clash_-_Lost_In_The_Supermarket.mp3",
    resolved=0x2e2b557c "/home/mp3/work/Clash_-_Clampdown.mp3", len=1024)
    at ../../../src/solaris/native/java/io/canonicalize_md.c:188
#7  0x2c3389ee in Java_java_io_UnixFileSystem_canonicalize (env=0x85f1e04,
    this=0x2e2b59d0, pathname=0x887d194)
    at ../../../src/solaris/native/java/io/UnixFileSystem_md.c:119
#8  0x28177768 in invoke_O_O (o=0x28ea91b0, mb=0x8106700, args_size=2,
    ee=0x85f1e04)
    at ../../../build/bsd-i386/tmp/java/java.lang/jvm/obj_g/invokers.c:555
#9  0x28183126 in ExecuteJava_C (initial_pc=0x2e2b5ee8 "Ö\r\001±",
    ee=0x85f1e04) at ../../../src/share/javavm/runtime/executeJava.c:1579
#10 0x28174982 in do_execute_java_method_vararg (ee=0x85f1e04, obj=0x28e77cd8,
    method_name=0x8053b38 "run", method_signature=0x8053258 "()V", mb=0x0,
    isStaticCall=FALSE,
    args=0x2e2b5f70 "\200\036_\b\004\036_\b\230_+.')\e(l)\e(\004\036_\b¸_+.Ì)\e(Ø|ç(\004\036_\b¸_+.½)\e(l)\e(è_+.\020Ì\n(\003", otherBits=0x0,
    shortFloats=FALSE) at ../../../src/share/javavm/runtime/interpreter.c:573
#11 0x28174178 in execute_java_dynamic_method (ee=0x85f1e04, obj=0x28e77cd8,
    method_name=0x281c3ea0 "run", signature=0x281c42de "()V")
    at ../../../src/share/javavm/runtime/interpreter.c:288
#12 0x2819fbc8 in ThreadRT0 (p=0x28e77cd8)
    at ../../../src/share/javavm/runtime/jvm.c:2101
#13 0x281b29cc in saveStackBase (args=0x2819fb74)
    at ../../../src/share/javavm/runtime/threads.c:139
#14 0x2807af39 in start_func (func=0x281b296c <saveStackBase>, args=0xbfbfdd90)
    at ../../../../src/solaris/hpi/green_threads/src/threads_md.c:351
#15 0x0 in ?? ()

Boiled down to this hunk of code.  
735
736         while(1) {
737             newfd = (*systable[SYS_OPEN].addr)(fname, flags, mode);
738             if ((newfd != -1) ||
739                 ((errno != EAGAIN) && (errno != EINTR))) {
740                 break;
741             }
742         }
743
744         SIMPLE_INITFD(newfd, open);

#define SIMPLE_INITFD(newfd, funcname) \
if (1) {                                                        \
    if (newfd >= 0) {                                   \
        Log1(1, #funcname " fd: %d \n", newfd);         \
        sysAssert(fd_flags[newfd] == 0);                \
        fd_flags[newfd] = 0;                            \
        if (initialize_monitors(newfd) == HPI_FALSE) {  /* Out of memory */ \
            (*systable[SYS_CLOSE].addr)(newfd);         /* Close new fd */  \
            errno = ENOMEM;                             \
            newfd = -1;                                 \
        }                                               \
    } else {                                            \
        Log1(1, #funcname " error: %d\n", errno);       \
    }                                                   \
} else                                                  \
    ((void) 0)

fd_flags[newfd] is not zero

(gdb) print newfd
$1 = 1024

whats newfd allocated at?

#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
    max_files = MIN(FD_SETSIZE, nbr_files.rlim_cur);
#else
    max_files = nbr_files.rlim_cur;
#endif

    fdmon = (sys_mon_t **) calloc(max_files, sizeof(sys_mon_t *));
    if (fdmon == 0) {
        VM_CALL(panic)("out of memory");        /* Fatal startup error */
    }

    for (i = 0; i < PREALLOCATE_FDS; ++i) {
        if (initialize_monitors(i) == HPI_FALSE) {
            VM_CALL(panic)("out of memory");    /* Fatal startup error */
        }
    }

    fd_flags = (char *) calloc(max_files, sizeof(char));
 
# ulimit -n
15360         (It's set pretty big because samba likes lots of fds.)

FD_SETSIZE?  Not redefined anywhere....
# grep FD_SETSIZE /usr/include/sys/types.h
 * FD_SETSIZE may be defined by the user, but the default here should
#ifndef FD_SETSIZE
#define FD_SETSIZE      1024

oops, no wonder it didn't like the 1024th fd.  Maybe that MIN should be MAX?

I'm compiling right now, to see how this works.

-Charlie
-- 
Charles Anderson	caa@columbus.rr.com

No quote, no nothin'

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021219194250.GC11902>