Bug 110610 - Java supplied with Matlab 6.1 has a big problem with glibc in Fedora 1
Summary: Java supplied with Matlab 6.1 has a big problem with glibc in Fedora 1
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 1
Hardware: i686
OS: Linux
high
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-21 18:30 UTC by bednar
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-11-30 23:36:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description bednar 2003-11-21 18:30:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114

Description of problem:
The Java VM supplied with Matlab 6.1 and 6.5 cannot run with 
Fedora Core 1 and java built in matlab 6.1 still doesn't
work (I read about similar problem with java on
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg110209.html
)
Here is the output from matlab:

[root@localhost bin]# matlab
Warning: Unable to load Java Runtime Environment:
/usr/local/matlab6p1/sys/java/jre/glnx86/jre/lib/i386/native_threads/libjava.so:
symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6
with link time reference.
Warning: Disabling Java support.

Whot is worse, I tried export LD_ASSUME_KERNEL=2.2.5 
and 2.4.1 and 2.4.19. None of these work.
The problem is very important for many of people who make serious job
on linux.

When I changed MATLAB_JAVA environment variable to point SUN's java
1.4.2 the matlab start with java GUI but, after opening one more
window of matlab (like editor or preferences) matlab freezes. I use
system locale pl_:PL and have SUN's java 1.4.2 with locale for
en,gb,de,es. I don't know if it could be locale problem or maybe NPTL
or glibc because I cannot find any log from java crash.

Same was with standard version of glibce supplied with fedora and with
upgraded version glibc-2.3.2-101.1.



Version-Release number of selected component (if applicable):
glibc-2.3.2-101.1

How reproducible:
Always

Steps to Reproduce:
1.run matlab from CLI
2.
3.
    

Actual Results:  [root@localhost bin]# matlab
Warning: Unable to load Java Runtime Environment:
/usr/local/matlab6p1/sys/java/jre/glnx86/jre/lib/i386/native_threads/libjava.so:
symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6
with link time reference.
Warning: Disabling Java support.

Matlab works only in text mode without java GUI and without graphic
debugger and editor. Aditional windows (like axes setu of plots)
cannot open.

Expected Results:  Matlab working with java GUI

Additional info:

Very important because I read about similar problems with other
applications and java under Fedora 1 (test 3, RedHat Linux 9).

Comment 1 Jakub Jelinek 2003-11-21 21:49:14 UTC
Try using some less buggy JVM.
Latest Sun JDK should work just fine for example.

Or, as a workaround for the buggy JVM, you can try:
gcc -O2 -shared -o ~/libcwait.so -fpic -xc - <<\EOF
#include <errno.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
pid_t
__libc_wait (int *status)
{
  int res;
  asm volatile ("pushl %%ebx\n\t"
                "movl %2, %%ebx\n\t"
                "movl %1, %%eax\n\t"
                "int $0x80\n\t"
                "popl %%ebx"
                : "=a" (res)
                : "i" (__NR_wait4), "0" (WAIT_ANY), "c" (status), "d" (0),
                  "S" (0));
  return res;
}
EOF

and run the program with
LD_PRELOAD=~/libcwait.so LD_ASSUME_KERNEL=2.4.19
in environment.

Comment 2 bednar 2003-11-30 23:26:25 UTC
Hi! That solution works really good!
I wonder if this piece of code will by used as patch on glibc int the
next wersion of glibc rpm available in updated of Fedora Core 1. Will it?

Comment 3 Jakub Jelinek 2003-11-30 23:36:27 UTC
No, it will not.  We have been applying it as workaround for 2 years and vendors did not bother
to fix their buggy software.

Comment 4 bednar 2003-11-30 23:49:24 UTC
Great :)

Comment 5 David Kewley 2004-02-20 00:18:10 UTC
I though I'd chime in here to describe what I see, in case it helps
others who come across this bug report.  I am not asking for anyone
(Jakub) to fix anything.

I find the following in RHL 9:

First of all, I see basically the same symptoms that bednar sees with
Matlab R12.1.  I didn't use the fix that Jakub suggested.  A fix for
me is to install the latest release of Sun JRE 1.3.1, and tell matlab
to use it.  Matlab R12.1 comes only with JRE 1.1.8 included, and it
runs fine on RHL 8, but it doesn't run on RHL 9.  Providing JRE 1.3.1
makes Matlab R12.1 run on RHL 9; perhaps this fix would work on FC 1
as well.

Incidentally Matlab R13 and R13SP1 both come with JRE 1.3.1, and use
it by default.  They also come with 1.1.8, but do not use it by
default (at least in my installs).

I have been trying to get J2RE 1.4.2 to work with Matlab, and have had
no success.  Googling suggests that all other reporters have failed as
well.  I was intrigued by Jakub's fix, but this did not help me use
Matlab R13 with J2RE 1.4.2 on RHL 9.  It has the same problem that
bednar described when using J2RE 1.4.2: you can open e.g. the Matlab
desktop Java window just fine, but if you open e.g. an editor window
(which also uses Java), the editor window doesn't fully render, and
Matlab permanently hangs (I've let it run overnight with no return to
normal state).


Comment 6 Ciril Petr 2004-10-07 12:49:17 UTC
I had the same problem running java launcher of JRE 1.3.1_08. We have
big java project that currently runs only on JRE 1.3.1. I installed
JRE 1.3.1_12 and it works!

Best regards, 
Ciril


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