J2SDK 1.4.0: SEGV

Richard rgollub at uninet.com.br
Fri Aug 9 11:23:20 PDT 2002


	Hi all,

	I'd appreciate other fellow LFSers to confirm or not the following:

	Have successfully compiled j2sdk-1.4.0_01 under gcc-3.1, but,
unfortunately the build contains a bug that apparently points at gcc as
being guilty of generating faulty code (so far just a guess of mine,
pending of deeper analysis)...

	For test bed I use the Java2D demo, and when this demo is run I
consistently get a segmentation fault in the same function/address.

	The offending function is the trigonometrical function 'tan', used
obviously in most of the demo's features. One way of triggering the segv
is running as follows:

	$ export JAVA_HOME=/usr/local/j2sdk
	$ export PATH=$PATH:$JAVA_HOME/bin
	$ java -jar $JAVA_HOME/demo/jfc/Java2D/Java2Demo.jar

	Once the intro presentation is running, click the 'Arcs,Curves' tab. It
segfaults with following backtrace:

<quote>
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x405E38BE
Function=__j__kernel_rem_pio2+0x35E
Library=/opt/j2sdk-1.4.0/jre/lib/i386/libjava.so

Current Java thread:
	at java.lang.StrictMath.tan(Native Method)
	at java.lang.Math.tan(Math.java:133)
	at java.awt.geom.ArcIterator.btan(ArcIterator.java:86)
	at java.awt.geom.ArcIterator.currentSegment(ArcIterator.java:144)
	at
sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:289)
	at
sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
	at
sun.java2d.pipe.DuctusShapeRenderer.fill(DuctusShapeRenderer.java:49)
	at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2190)
	at java2d.demos.Arcs_Curves.Arcs.render(Arcs.java:100)
	at java2d.Surface.paint(Surface.java:325)
	at
javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4735)
	at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
	at javax.swing.JComponent._paintImmediately(JComponent.java:4632)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4464)
	at java2d.Surface.paintImmediately(Surface.java:294)
	at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:404)
	at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

Dynamic libraries:
08048000-0804d000 r-xp 00000000 16:07 285878    
		/opt/j2sdk-1.4.0/bin/java
0804d000-0804e000 rw-p 00004000 16:07 285878    
		/opt/j2sdk-1.4.0/bin/java
40000000-40015000 r-xp 00000000 16:07 113540     /lib/ld-2.2.5.so
40015000-40016000 rw-p 00014000 16:07 113540     /lib/ld-2.2.5.so
40016000-4001e000 r-xp 00000000 16:07 288414    
		/opt/j2sdk-1.4.0/jre/lib/i386/native_threads/libhpi.so
4001e000-4001f000 rw-p 00007000 16:07 288414    
		/opt/j2sdk-1.4.0/jre/lib/i386/native_threads/libhpi.so
4001f000-40020000 r--p 00000000 16:07 113578    
		/usr/lib/locale/en_US/LC_IDENTIFICATION
40020000-4002e000 r-xp 00000000 16:07 113353     /lib/libpthread-0.9.so
4002e000-40036000 rw-p 0000d000 16:07 113353     /lib/libpthread-0.9.so
40037000-40039000 r-xp 00000000 16:07 111741     /lib/libdl-2.2.5.so
40039000-4003a000 rw-p 00001000 16:07 111741     /lib/libdl-2.2.5.so
4003a000-40153000 r-xp 00000000 16:07 111081     /lib/libc-2.2.5.so
40153000-40159000 rw-p 00118000 16:07 111081     /lib/libc-2.2.5.so
4015d000-4042c000 r-xp 00000000 16:07 288420    
		/opt/j2sdk-1.4.0/jre/lib/i386/client/libjvm.so
4042c000-404a2000 rw-p 002ce000 16:07 288420    
		/opt/j2sdk-1.4.0/jre/lib/i386/client/libjvm.so
404b4000-404c6000 r-xp 00000000 16:07 113505     /lib/libnsl-2.2.5.so
404c6000-404c7000 rw-p 00011000 16:07 113505     /lib/libnsl-2.2.5.so
404ca000-40573000 r-xp 00000000 16:07 133037    
		/usr/lib/libstdc++.so.4.0.0
40573000-4058c000 rw-p 000a8000 16:07 133037    
		/usr/lib/libstdc++.so.4.0.0
40591000-405b2000 r-xp 00000000 16:07 111700     /lib/libm-2.2.5.so
405b2000-405b3000 rw-p 00020000 16:07 111700     /lib/libm-2.2.5.so
405b3000-405ba000 r-xp 00000000 16:07 132768     /lib/libgcc_s.so.1
405ba000-405bc000 rw-p 00006000 16:07 132768     /lib/libgcc_s.so.1
405bc000-405cb000 r-xp 00000000 16:07 288424    
		/opt/j2sdk-1.4.0/jre/lib/i386/libverify.so
405cb000-405cc000 rw-p 0000e000 16:07 288424    
		/opt/j2sdk-1.4.0/jre/lib/i386/libverify.so
405cc000-405e7000 r-xp 00000000 16:07 288425    
		/opt/j2sdk-1.4.0/jre/lib/i386/libjava.so
405e7000-405e9000 rw-p 0001a000 16:07 288425    
		/opt/j2sdk-1.4.0/jre/lib/i386/libjava.so
405ea000-405f9000 r-xp 00000000 16:07 288427    
		/opt/j2sdk-1.4.0/jre/lib/i386/libzip.so
405f9000-405fb000 rw-p 0000e000 16:07 288427    
		/opt/j2sdk-1.4.0/jre/lib/i386/libzip.so
405fb000-41c73000 r--s 00000000 16:07 298899    
		/opt/j2sdk-1.4.0/jre/lib/rt.jar
41cb5000-41ccc000 r--s 00000000 16:07 288453    
		/opt/j2sdk-1.4.0/jre/lib/sunrsasign.jar
41ccc000-41d3a000 r--s 00000000 16:07 288461    
		/opt/j2sdk-1.4.0/jre/lib/jsse.jar
41d3a000-41d4d000 r--s 00000000 16:07 288454    
		/opt/j2sdk-1.4.0/jre/lib/jce.jar
41d4d000-41fce000 r--s 00000000 16:07 298680    
		/opt/j2sdk-1.4.0/jre/lib/charsets.jar
4404e000-4404f000 r--p 00000000 16:07 113577    
		/usr/lib/locale/en_US/LC_MEASUREMENT
4404f000-44050000 r--p 00000000 16:07 113576    
		/usr/lib/locale/en_US/LC_TELEPHONE
4c0d0000-4c0d1000 r--p 00000000 16:07 113575    
		/usr/lib/locale/en_US/LC_ADDRESS
4c0d1000-4c0d2000 r--p 00000000 16:07 113574    
		/usr/lib/locale/en_US/LC_NAME
4c0d2000-4c0d3000 r--p 00000000 16:07 113573    
		/usr/lib/locale/en_US/LC_PAPER
4c0d3000-4c0d4000 r--p 00000000 16:07 113572    
		/usr/lib/locale/en_US/LC_MESSAGES/SYS_LC_MESSAGES
4c0d4000-4c0d5000 r--p 00000000 16:07 113570    
		/usr/lib/locale/en_US/LC_MONETARY
4c0d5000-4c0db000 r--p 00000000 16:07 113569    
		/usr/lib/locale/en_US/LC_COLLATE
4c0db000-4c0dc000 r--p 00000000 16:07 113568    
		/usr/lib/locale/en_US/LC_TIME
4c0dc000-4c0dd000 r--p 00000000 16:07 113567    
		/usr/lib/locale/en_US/LC_NUMERIC
4c0dd000-4c108000 r--p 00000000 16:07 113566    
		/usr/lib/locale/en_US/LC_CTYPE
4c108000-4c10a000 r--s 00000000 16:07 288450    
		/opt/j2sdk-1.4.0/jre/lib/ext/dnsns.jar
4c10a000-4c111000 r-xp 00000000 16:07 178875    
		/usr/X11R6/lib/libXp.so.6.2
4c111000-4c112000 rw-p 00006000 16:07 178875    
		/usr/X11R6/lib/libXp.so.6.2
4c112000-4c11b000 r-xp 00000000 16:07 113375    
		/lib/libnss_files-2.2.5.so
4c11b000-4c11c000 rw-p 00008000 16:07 113375    
		/lib/libnss_files-2.2.5.so
4c147000-4c1ab000 r--s 00000000 16:07 286943    
		/opt/j2sdk-1.4.0/demo/jfc/Java2D/Java2Demo.jar
4c1ab000-4c1c8000 r--s 00000000 16:07 288449    
		/opt/j2sdk-1.4.0/jre/lib/ext/sunjce_provider.jar
4c1c8000-4c1d6000 r--s 00000000 16:07 288452    
		/opt/j2sdk-1.4.0/jre/lib/ext/ldapsec.jar
4c1d6000-4c279000 r--s 00000000 16:07 288451    
		/opt/j2sdk-1.4.0/jre/lib/ext/localedata.jar
4c279000-4c4fb000 r-xp 00000000 16:07 288435    
		/opt/j2sdk-1.4.0/jre/lib/i386/libawt.so
4c4fb000-4c50e000 rw-p 00281000 16:07 288435    
		/opt/j2sdk-1.4.0/jre/lib/i386/libawt.so
4c534000-4c57c000 r-xp 00000000 16:07 288434    
		/opt/j2sdk-1.4.0/jre/lib/i386/libmlib_image.so
4c57c000-4c57d000 rw-p 00047000 16:07 288434    
		/opt/j2sdk-1.4.0/jre/lib/i386/libmlib_image.so
4c57d000-4c57f000 r-xp 00000000 16:07 178696    
		/usr/X11R6/lib/X11/locale/common/xlcDef.so.2
4c57f000-4c580000 rw-p 00001000 16:07 178696    
		/usr/X11R6/lib/X11/locale/common/xlcDef.so.2
4c581000-4c583000 r-xp 00000000 16:07 111111    
		/usr/lib/gconv/ISO8859-1.so
4c583000-4c584000 rw-p 00001000 16:07 111111    
		/usr/lib/gconv/ISO8859-1.so
4c587000-4c5d5000 r-xp 00000000 16:07 178723    
		/usr/X11R6/lib/libXt.so.6.0
4c5d5000-4c5d9000 rw-p 0004d000 16:07 178723    
		/usr/X11R6/lib/libXt.so.6.0
4c5da000-4c5e7000 r-xp 00000000 16:07 178720    
		/usr/X11R6/lib/libXext.so.6.4
4c5e7000-4c5e8000 rw-p 0000c000 16:07 178720    
		/usr/X11R6/lib/libXext.so.6.4
4c5e8000-4c5ec000 r-xp 00000000 16:07 178861    
		/usr/X11R6/lib/libXtst.so.6.1
4c5ec000-4c5ee000 rw-p 00003000 16:07 178861    
		/usr/X11R6/lib/libXtst.so.6.1
4c5ee000-4c6b1000 r-xp 00000000 16:07 178680    
		/usr/X11R6/lib/libX11.so.6.2
4c6b1000-4c6b4000 rw-p 000c2000 16:07 178680    
		/usr/X11R6/lib/libX11.so.6.2
4c6b4000-4c6bc000 r-xp 00000000 16:07 178713    
		/usr/X11R6/lib/libSM.so.6.0
4c6bc000-4c6bd000 rw-p 00007000 16:07 178713    
		/usr/X11R6/lib/libSM.so.6.0
4c6bd000-4c6d1000 r-xp 00000000 16:07 178703    
		/usr/X11R6/lib/libICE.so.6.3
4c6d1000-4c6d2000 rw-p 00013000 16:07 178703    
		/usr/X11R6/lib/libICE.so.6.3
4c6d4000-4c769000 r-xp 00000000 16:07 288437    
		/opt/j2sdk-1.4.0/jre/lib/i386/libfontmanager.so
4c769000-4c77b000 rw-p 00094000 16:07 288437    
		/opt/j2sdk-1.4.0/jre/lib/i386/libfontmanager.so
4c77b000-4c797000 r-xp 00000000 16:07 178699    
		/usr/X11R6/lib/X11/locale/common/ximcp.so.2
4c797000-4c799000 rw-p 0001b000 16:07 178699    
		/usr/X11R6/lib/X11/locale/common/ximcp.so.2
4c799000-4c7b0000 r-xp 00000000 16:07 288433    
		/opt/j2sdk-1.4.0/jre/lib/i386/libdcpr.so
4c7b0000-4c7c3000 rw-p 00016000 16:07 288433    
		/opt/j2sdk-1.4.0/jre/lib/i386/libdcpr.so
4c7c3000-4c7eb000 r-xp 00000000 16:07 288438    
		/opt/j2sdk-1.4.0/jre/lib/i386/libjpeg.so
4c7eb000-4c7ed000 rw-p 00027000 16:07 288438    
		/opt/j2sdk-1.4.0/jre/lib/i386/libjpeg.so
4c7ed000-4c7f2000 rw-s 00000000 00:05 3538959    /SYSV00000000 (deleted)
4c7f2000-4c7f7000 rw-s 00000000 00:05 3571728    /SYSV00000000 (deleted)
4c900000-4ca81000 rw-s 00000000 00:05 3473421    /SYSV00000000 (deleted)
4ca81000-4cb11000 rw-s 00000000 00:05 3506190    /SYSV00000000 (deleted)
4cb11000-4cb46000 rw-s 00000000 00:05 3604497    /SYSV00000000 (deleted)
4cb46000-4cb72000 rw-s 00000000 00:05 3637266    /SYSV00000000 (deleted)
4cb72000-4cba5000 rw-s 00000000 00:05 3670035    /SYSV00000000 (deleted)

Local Time = Fri Aug  9 09:24:57 2002
Elapsed Time = 33
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0-RAG-_09_aug_2002_04_21
mixed mode)
#
</quote>

	Same outcome (i.e, segv in the same function albeit within a diff
backtrace history) can be obtained by clicking other tabs (e.g.,
Composite), but not all tabs end up segfaulting.

	However, let it be noted that running the same demo with the bootstrap
(binary j2sdk distributed by Sun), it just runs flawlessly !!!

	My machine runs an Intel PIII-600, and the gcc-3.1 has been patched to
default -march to i686 (base system's arch, in fact, if the patch
works:). 

	Thus, effectively, the j2sdk has been compiled as if it had been
given OTHER_CFLAGS='-O2 -march=i686', instead of just the '-O2' actually
given.

	I'd appreciate to learn other experiences you might have regarding this
issue. TIA.

	Richard
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message



More information about the blfs-support mailing list