Bug 163969 - aot-compile-rpm should use -fjni
aot-compile-rpm should use -fjni
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: java-1.4.2-gcj-compat (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Gary Benson
:
Depends On:
Blocks: 164079
  Show dependency treegraph
 
Reported: 2005-07-22 11:02 EDT by Robin Green
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-07-29 04:46:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test case (3.13 KB, application/octet-stream)
2005-07-23 10:47 EDT, Robin Green
no flags Details
Fix (398 bytes, patch)
2005-07-24 08:10 EDT, Robin Green
no flags Details | Diff

  None (edit)
Description Robin Green 2005-07-22 11:02:37 EDT
Description of problem:
While trying to debug bug 161483 I received the following error in eclipse's
error log:

java.lang.NullPointerException
   at java.util.Collections$SynchronizedMap.get(java.lang.Object)
(/usr/lib/libgcj.so.6.0.0)
   at
org.eclipse.core.internal.resources.ResourceInfo.getSessionProperty(org.eclipse.core.runtime.QualifiedName)
(Unknown Source)
   at
org.eclipse.core.internal.resources.Resource.getSessionProperty(org.eclipse.core.runtime.QualifiedName)
(Unknown Source)
   at
org.eclipse.team.internal.ccvs.core.resources.SessionPropertySyncInfoCache.safeGetSessionProperty(org.eclipse.core.resources.IResource,
org.eclipse.core.runtime.QualifiedName)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.SessionPropertySyncInfoCache.isResourceSyncInfoCached(org.eclipse.core.resources.IContainer)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer.cacheResourceSyncForChildren(org.eclipse.core.resources.IContainer,
boolean) (/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer.members(org.eclipse.core.resources.IContainer)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at org.eclipse.team.internal.ccvs.core.resources.EclipseFolder.members(int)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseFolder.acceptChildren(org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.PruneFolderVisitor.visitFolder(org.eclipse.team.internal.ccvs.core.ICVSFolder)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseFolder.accept(org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseFolder.acceptChildren(org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.PruneFolderVisitor.visitFolder(org.eclipse.team.internal.ccvs.core.ICVSFolder)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseFolder.accept(org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseFolder.acceptChildren(org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.PruneFolderVisitor.visitFolder(org.eclipse.team.internal.ccvs.core.ICVSFolder)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseFolder.accept(org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.PruneFolderVisitor.visit(org.eclipse.team.internal.ccvs.core.ICVSFolder,
org.eclipse.team.internal.ccvs.core.ICVSResource[])
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.PruneFolderVisitor.visit(org.eclipse.team.internal.ccvs.core.client.Session,
org.eclipse.team.internal.ccvs.core.ICVSResource[])
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.Checkout.commandFinished(org.eclipse.team.internal.ccvs.core.client.Session,
org.eclipse.team.internal.ccvs.core.client.Command$GlobalOption[],
org.eclipse.team.internal.ccvs.core.client.Command$LocalOption[],
org.eclipse.team.internal.ccvs.core.ICVSResource[],
org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IStatus)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.Command.doExecute(org.eclipse.team.internal.ccvs.core.client.Session,
org.eclipse.team.internal.ccvs.core.client.Command$GlobalOption[],
org.eclipse.team.internal.ccvs.core.client.Command$LocalOption[],
java.lang.String[],
org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener,
org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.Checkout.doExecute(org.eclipse.team.internal.ccvs.core.client.Session,
org.eclipse.team.internal.ccvs.core.client.Command$GlobalOption[],
org.eclipse.team.internal.ccvs.core.client.Command$LocalOption[],
java.lang.String[],
org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener,
org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.CheckoutWithOverwrite.doExecute(org.eclipse.team.internal.ccvs.core.client.Session,
org.eclipse.team.internal.ccvs.core.client.Command$GlobalOption[],
org.eclipse.team.internal.ccvs.core.client.Command$LocalOption[],
java.lang.String[],
org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener,
org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.Command$1.run(org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer.run(org.eclipse.core.runtime.jobs.ISchedulingRule,
org.eclipse.team.internal.ccvs.core.ICVSRunnable,
org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseResource$2.run(org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.core.internal.resources.Workspace.run(org.eclipse.core.resources.IWorkspaceRunnable,
org.eclipse.core.runtime.jobs.ISchedulingRule, int,
org.eclipse.core.runtime.IProgressMonitor) (Unknown Source)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseResource.run(org.eclipse.team.internal.ccvs.core.ICVSRunnable,
org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.client.Command.execute(org.eclipse.team.internal.ccvs.core.client.Session,
org.eclipse.team.internal.ccvs.core.client.Command$GlobalOption[],
org.eclipse.team.internal.ccvs.core.client.Command$LocalOption[],
java.lang.String[],
org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener,
org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.ui.operations.CheckoutProjectOperation.performCheckout(org.eclipse.team.internal.ccvs.core.client.Session,
org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder,
org.eclipse.team.internal.ccvs.core.resources.IProject[], boolean,
org.eclipse.team.internal.ccvs.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.ui_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.ui.operations.CheckoutProjectOperation$1.run(org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.ui_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer.run(org.eclipse.core.runtime.jobs.ISchedulingRule,
org.eclipse.team.internal.ccvs.core.ICVSRunnable,
org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.core_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.ui.operations.CheckoutProjectOperation.checkout(org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder,
org.eclipse.team.internal.ccvs.core.resources.IProject,
org.eclipse.team.internal.ccvs.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.ui_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.ui.operations.CheckoutMultipleProjectsOperation.checkout(org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder,
org.eclipse.team.internal.ccvs.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.ui_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.ui.operations.CheckoutOperation.checkout(org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder[],
org.eclipse.team.internal.ccvs.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.ui_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.ui.operations.CheckoutOperation.execute(org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.ui_3.1.0.jar.so)
   at
org.eclipse.team.internal.ccvs.ui.operations.CVSOperation.run(org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.cvs.ui_3.1.0.jar.so)
   at
org.eclipse.team.internal.ui.actions.JobRunnableContext.run(org.eclipse.jface.operation.IRunnableWithProgress,
org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.ui_3.1.0.jar.so)
   at
org.eclipse.team.internal.ui.actions.JobRunnableContext$ResourceJob.runInWorkspace(org.eclipse.core.runtime.IProgressMonitor)
(/usr/lib/gcj/eclipse/org.eclipse.team.ui_3.1.0.jar.so)
   at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(org.eclipse.core.runtime.IProgressMonitor)
(Unknown Source)
   at org.eclipse.core.internal.jobs.Worker.run()
(/usr/lib/gcj/eclipse/org.eclipse.core.runtime_3.1.0.jar.so)
   at .GC_start_routine (/usr/lib/libgcj.so.6.0.0)
   at .__clone (/lib/libc-2.3.90.so)

Notice that the line (#3 and #4) for org.eclipse.core.internal.resources... say
(Unknown Source), which indicates to me that they are probably being interpreted.

So I produced a small test case (see below), and indeed, they are being
interpreted according to gij - even though
/usr/lib/gcj/eclipse/org.eclipse.core.resources_3.1.0.jar.so exists.

Version-Release number of selected component (if applicable):
eclipse-platform-3.1.0_fc-6

How reproducible:
Always

Steps to Reproduce:
1. gij -verbose -cp
/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar:/usr/share/eclipse/plugins/org.eclipse.core.runtime_3.1.0.jar
org.eclipse.core.internal.resources.ResourceInfo

Actual results:
<snip>
[Loaded (pre-compiled) gnu.gcj.runtime.PersistentByteMap$AccessMode from <no
code source>]
[Loaded (pre-compiled) java.nio.channels.FileChannel$MapMode from <no code source>]
[Loaded (pre-compiled) java.nio.MappedByteBufferImpl from <no code source>]
[Loaded (pre-compiled) java.nio.MappedByteBuffer from <no code source>]
[Loaded (pre-compiled) java.nio.ByteBuffer from <no code source>]
[Loaded (pre-compiled) java.nio.Buffer from <no code source>]
[Loaded (pre-compiled) java.nio.ByteOrder from <no code source>]
[Loaded (pre-compiled) java.util.Vector$1 from <no code source>]
[Loaded (pre-compiled) gnu.gcj.runtime.SharedLibHelper from <no code source>]
[Loaded (pre-compiled) java.lang.UnknownError from <no code source>]
[Loaded (bytecode) org.eclipse.core.internal.watson.IElementTreeData from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.internal.resources.ICoreConstants from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.internal.utils.IStringPoolParticipant from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.internal.resources.ResourceInfo from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (BC-compiled) org.eclipse.core.runtime.QualifiedName from
(file:/usr/share/eclipse/plugins/org.eclipse.core.runtime_3.1.0.jar <no
certificates>)]
[Loaded (BC-compiled) org.eclipse.core.runtime.IAdaptable from
(file:/usr/share/eclipse/plugins/org.eclipse.core.runtime_3.1.0.jar <no
certificates>)]
[Loaded (BC-compiled) org.eclipse.core.runtime.jobs.ISchedulingRule from
(file:/usr/share/eclipse/plugins/org.eclipse.core.runtime_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.resources.IResource from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.resources.IContainer from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.resources.IProject from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.resources.IStorage from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.resources.IEncodedStorage from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.resources.IFileState from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.internal.resources.MarkerSet from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
[Loaded (bytecode) org.eclipse.core.internal.utils.ObjectMap from
(file:/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar <no
certificates>)]
no suitable method `main' in class

Expected results:
The classes in org.eclipse.core.resources_3.1.0.jar should say Loaded (BC-compiled).

Additional info:
gdb shows that the VM, in this test case, is repeatedly opening
/usr/lib/gcj/eclipse/org.eclipse.core.resources_3.1.0.jar.so - although as shown
above it is never used.

rpm -V eclipse-platform shows some configuration files as having gone missing,
but nothing in /usr/share/eclipse/plugins or /usr/lib/gcj/eclipse appears to be
damaged.

This is with gcc-4.0.1-4
Comment 1 Robin Green 2005-07-22 11:10:21 EDT
Quoting comment #0:
> While trying to debug overholt@redhat.com 

I didn't write that!

This is caused by a bugzilla bug. Bugzilla changed some text of the form
"bugXXXXX" into "overholt@redhat.com". The email just sent out by bugzilla had
the correct text.

Some unintentional humour there...
Comment 2 Robin Green 2005-07-22 18:51:59 EDT
(In reply to comment #1)
> I didn't write that!
>
> This is caused by a bugzilla bug.

I was wrong. It was caused by a bug in a firefox extension I was using. I'll
shut up about this irrelevancy now, I promise!
Comment 3 Robin Green 2005-07-23 10:33:59 EDT
This is a gcj bug. Moving to gcc component.

The original issue reported is caused by:
/usr/lib/gcj/eclipse/org.eclipse.core.resources_3.1.0.jar.so: undefined symbol:
_ZN3org7eclipse4core8internal10localstore21CoreFileSystemLibrary22internalCopyAttributesEP6JArrayIcES7_b

This is caused by gcj not defining that symbol. Here is a cut-down test case:

1. Download attached file t.jar
2. gcj -findirect-dispatch -shared -Wl,-Bsymbolic -o t.jar.so t.jar
3. readelf -W -s t.jar.so |grep internalCopyAttr

Actual results:
    37: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND
_ZN3org7eclipse4core8internal10localstore21CoreFileSystemLibrary22internalCopyAttributesEP6JArrayIcES7_b
    43: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND
_ZN3org7eclipse4core8internal10localstore21CoreFileSystemLibrary23internalCopyAttributesWEP6JArrayIwES7_b
   210: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND
_ZN3org7eclipse4core8internal10localstore21CoreFileSystemLibrary22internalCopyAttributesEP6JArrayIcES7_b
   216: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND
_ZN3org7eclipse4core8internal10localstore21CoreFileSystemLibrary23internalCopyAttributesWEP6JArrayIwES7_b

Expected results:
Those symbols should not be all UND (i.e. undefined) because they correspond to
the methods actually being compiled at the time.

Version:
gcc-java-4.0.1-4
Comment 4 Robin Green 2005-07-23 10:47:19 EDT
Created attachment 117100 [details]
test case

This test case just contains a single .class file extracted from
/usr/share/eclipse/plugins/org.eclipse.core.resources_3.1.0.jar from
eclipse-platform-3.1.0_fc-6.
Comment 5 Robin Green 2005-07-23 13:27:44 EDT
Oops - this isn't a compiler bug at all. It's just that gcj wasn't called with
-fjni. So my "reduced test case" is bogus.

Testing a patch.
Comment 6 Robin Green 2005-07-24 08:10:47 EDT
Created attachment 117104 [details]
Fix

This patch fixes the problem.

[To get eclipse to build against rawhide, I also had to comment out part of the
ecj bootstrap process because of a gcj error, and replace references to mozilla
1.7.8 with mozilla 1.7.10 in a patch, but that's irrelevant to this bug.]
Comment 7 Gary Benson 2005-07-25 12:21:43 EDT
Looks like aot-compile-rpm ought to be passing -fjini then.  I'll make it happen.
Comment 8 Robin Green 2005-07-25 13:10:57 EDT
(In reply to comment #7)
> Looks like aot-compile-rpm ought to be passing -fjini then.  I'll make it happen.

But what if in future an app uses CNI instead of JNI? Then -fjni should not be
passed. How would that be dealt with?
Comment 9 Gary Benson 2005-07-26 04:08:16 EDT
aot-compile-rpm is not a generic build system.  aot-compile-rpm is a script to
convert normal, bytecode-only rpms into ones with native solibs for gcj.  People
wanting to use CNI can use make or whatever.
Comment 10 Andrew Overholt 2005-07-27 00:29:25 EDT
Updating subject and component.
Comment 11 Gary Benson 2005-07-29 04:46:21 EDT
Fixed. Packages requiring -fjni should BuildRequires: java-gcj-compat-devel >=
1.0.36

Note You need to log in before you can comment on or make changes to this bug.