Subject: COMPAT_LINUX and the JDK
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
List: tech-kern
Date: 03/03/2001 22:53:09
An attempt to run the JDK-1.3 with green threads on the PowerPC:

$ java -green -version
java: ../../../../../src/solaris/hpi/green_threads/src/dl-malloc.c:1636:
malloc_extend_top: Assertion `((size_t)((char*)(((mbinptr)(&(av_[2 *
(0)])))->fd) + top_size) & (pagesz - 1)) == 0' failed.
Abort (core dumped) 

The message suggest that there is a problem with memory allocation. I
thought about bad alignement, problems with brk() emulation, and so on,
but I checked, it seems okay (the adresses are not the same on native
Linux and on emulated Linux, but the alignements are ok (emulated Linux
is more aligned than native Linux, but I beleive it cannot be harmful))

Here is the kernel trace just before the problem. I still think there
could be a brk() issue, but I don't see anything that could be wrong.
Any idea?

  1115 java     CALL  getpid
  1115 java     RET   getpid 1115/0x45b
  1115 java     CALL  access(0x7fffb2c8,0)
  1115 java     NAMI
"/emul/linux/usr/pkgsrc/lang/jdkppc/work/jdk-1.3.0-FCSa/usr/local/jdk13/
lib/ppc/libjava.so"
  1115 java     NAMI
"/usr/pkgsrc/lang/jdkppc/work/jdk-1.3.0-FCSa/usr/local/jdk13/lib/ppc/lib
java.so"
  1115 java     RET   access -1 errno 2 No such file or directory
  1115 java     CALL  access(0x7fffb2c8,0)
  1115 java     NAMI
"/emul/linux/usr/pkgsrc/lang/jdkppc/work/jdk-1.3.0-FCSa/usr/local/jdk13/
jre/lib/ppc/libjava.so"
  1115 java     NAMI
"/usr/pkgsrc/lang/jdkppc/work/jdk-1.3.0-FCSa/usr/local/jdk13/jre/lib/ppc
/libjava.so"
  1115 java     RET   access 0
  1115 java     CALL  brk(0)
  1115 java     RET   brk 268517376/0x10014000
  1115 java     CALL  brk(0x100140d0)
  1115 java     RET   brk 268517584/0x100140d0
  1115 java     CALL  brk(0)
  1115 java     RET   brk 268521472/0x10015000
  1115 java     CALL  brk(0x10015f30)
  1115 java     RET   brk 268525360/0x10015f30
  1115 java     CALL  write(0x2,0x7fff79c8,0xc5)
  1115 java     GIO   fd 2 wrote 197 bytes
       "java:
../../../../../src/solaris/hpi/green_threads/src/dl-malloc.c:163\
        6: malloc_extend_top: Assertion
`((size_t)((char*)(((mbinptr)(&(av_[2 \
        * (0)])))->fd) + top_size) & (pagesz - 1)) == 0' failed.
       "

-- 
Emmanuel Dreyfus.
"Le 80x86 n'est pas si complexe - il n'a simplement pas de sens"
(Mike Johnson, responsable de la conception x86 chez AMD) 
p99dreyf@criens.u-psud.fr