[Bug java/15680] New: CodeSource is null in ProtectionDomain

j_s at telia dot com gcc-bugzilla@gcc.gnu.org
Thu May 27 11:41:00 GMT 2004


For the test application:

class Test {
        public static void main(String[] x) {
                System.out.println("Class: " + Test.class);
                System.out.println("Domain: " + Test.class.getProtectionDomain()
);
                System.out.println("CodeSource: " + Test.class.
getProtectionDomain().getCodeSource());
                System.out.println("Location: " + Test.class.
getProtectionDomain().getCodeSource().getLocation());
        }
}

compiled with:

[1:arnetheduck:~/src/tmp]$ gcj -v Test.java --main=Test
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/libgcj.spec
rename spec lib to liborig
Configured with: /var/tmp/portage/gcc-3.4.0-r4/work/gcc-3.4.0/configure 
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4 
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/include 
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4 
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/man 
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/info --enable-shared 
--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib 
--enable-languages=c,c++,java --enable-threads=posix --enable-long-long 
--disable-checking --disable-libunwind-exceptions --enable-cstdio=stdio 
--enable-version-specific-runtime-libs 
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/include/g++-v3 
--with-local-prefix=/usr/local --disable-werror --enable-shared --enable-nls 
--without-included-gettext --x-includes=/usr/X11R6/include 
--x-libraries=/usr/X11R6/lib --enable-interpreter --enable-java-awt=xlib 
--with-x --disable-multilib --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.4.0 20040519 (Gentoo Linux 3.4.0-r4, ssp-3.4-1, pie-8.7.6.2)
 /usr/libexec/gcc/i686-pc-linux-gnu/3.4.0/jc1 Test.java -fhash-synchronization 
-fno-use-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions 
-fkeep-inline-functions -quiet -dumpbase Test.java -mtune=pentiumpro -auxbase 
Test -g1 -version -o /tmp/ccYnmWiK.s
GNU Java version 3.4.0 20040519 (Gentoo Linux 3.4.0-r4, ssp-3.4-1, pie-8.7.6.2) 
(i686-pc-linux-gnu)
        compiled by GNU C version 3.4.0 20040519 (Gentoo Linux 3.4.0-r4, ssp-3.
4-1, pie-8.7.6.2).
GGC heuristics: --param ggc-min-expand=45 --param ggc-min-heapsize=29937
Class path starts here:
    ./
    /usr/share/gcc-data/i686-pc-linux-gnu/3.4/java/libgcj-3.4.0.jar/ (system) 
(zip)
 /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/bin/as -V 
-Qy -o /tmp/cc0eFJcx.o /tmp/ccYnmWiK.s
GNU assembler version 2.14.90.0.8 (i686-pc-linux-gnu) using BFD version 2.14.90.
0.8 20040114
 /usr/libexec/gcc/i686-pc-linux-gnu/3.4.0/jvgenmain Testmain /tmp/ccAfEK9h.i
 /usr/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1 /tmp/ccAfEK9h.i -quiet -dumpbase 
Testmain.c -mtune=pentiumpro -g1 -version -fdollars-in-identifiers -o 
/tmp/ccYnmWiK.s
GNU C version 3.4.0 20040519 (Gentoo Linux 3.4.0-r4, ssp-3.4-1, pie-8.7.6.2) 
(i686-pc-linux-gnu)
        compiled by GNU C version 3.4.0 20040519 (Gentoo Linux 3.4.0-r4, ssp-3.
4-1, pie-8.7.6.2).
GGC heuristics: --param ggc-min-expand=45 --param ggc-min-heapsize=29937
 /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/bin/as -V 
-Qy -o /tmp/cci4UEE9.o /tmp/ccYnmWiK.s
GNU assembler version 2.14.90.0.8 (i686-pc-linux-gnu) using BFD version 2.14.90.
0.8 20040114
 /usr/libexec/gcc/i686-pc-linux-gnu/3.4.0/collect2 --eh-frame-hdr -m elf_i386 
-dynamic-linker /lib/ld-linux.so.2 /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../..
/crt1.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../crti.o 
/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/crtbegin.o 
-L/usr/lib/gcc/i686-pc-linux-gnu/3.4.0 -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.0 
-L/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/lib 
-L/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../.. /tmp/cci4UEE9.o /tmp/cc0eFJcx.o 
-lgcc_s -lgcc -lgcj -lm -lpthread -lz -ldl -lgcc_s -lgcc -lc -lgcc_s -lgcc 
/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/crtend.o /usr/lib/gcc/i686-pc-linux-gnu/3.
4.0/../../../crtn.o


the output given is:
[0:arnetheduck:~/src/tmp]$ ./a.out 
Class: class Test
Domain: ProtectionDomain (
CodeSource:null
ClassLoader:null
Principals:none
java.security.Permissions@80cb740 (
 (java.security.AllPermission * )
)

)

CodeSource: null
Exception in thread "main" java.lang.NullPointerException
   at Test.main(java.lang.String[]) (Unknown Source)

while Sun JDK gives:

[1:arnetheduck:~/src/tmp]$ java Test
Class: class Test
Domain: ProtectionDomain  (file:/home/arnetheduck/src/tmp/ <no certificates>)
 sun.misc.Launcher$AppClassLoader@913750
 <no principals>
 java.security.Permissions@1f12c4e (
 (java.lang.RuntimePermission exitVM)
 (java.io.FilePermission /home/arnetheduck/src/tmp/- read)
)


CodeSource: (file:/home/arnetheduck/src/tmp/ <no certificates>)
Location: file:/home/arnetheduck/src/tmp/

-- 
           Summary: CodeSource is null in ProtectionDomain
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: j_s at telia dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15680



More information about the Java-prs mailing list