can't for daemon problem with gcc/gcj compiled program

Knight, Lloyd Lloyd.Knight@adc.com
Wed Apr 11 11:44:00 GMT 2007


hans,
i am open to whatever you would like me to try.
the results of my attempt to step through the debugger
are below. didn't seem to work.
if there is something else i can do in the debugger to provide
info i may need some guidance.

as far as linking pdftk:
in Makefile.Solaris :

CXXFLAGS= -lrt -lnsl -ldl -lgcj -lsocket -L/usr/local/lib -liconv
#CXXFLAGS= -lposix4 -lnsl -ldl -lgcj -lsocket -L/usr/local/lib -liconv

in Makefile.Base:

$(CXX) pdftk.o attachments.o report.o $(itext_libs) $(libgcj_local_libs)
$(afm_objects) -I$(java_libs_root) $(CPPFLAGS)
-L/opt/gcc346/lib/copyoflib -lgcj -L/opt/gcc346/lib/copyoflib -lstdc++
$(CXXFLAGS) -o pdftk 

i read somewhere that gcc does has issues with shared libraries so above
i copied libgcj.a and libstdc++
to a directory called copyoflib an added the -L directives.

here is what ldd says:
ldd pdftk
        librt.so.1 =>    /usr/lib/librt.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libiconv.so.2 =>         /usr/local/lib/libiconv.so.2
        libm.so.1 =>     /usr/lib/libm.so.1
        libgcc_s.so.1 =>         /opt/gcc346/lib/libgcc_s.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libaio.so.1 =>   /usr/lib/libaio.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Sun-Fire-V240/lib/libc_psr.so.1

here is the actual link content:
/opt/gcc346/bin/g++ pdftk.cc
-I/opt/gcc346/objdir/sparc-sun-solaris2.8/libjava -I../java_libs -O0
-DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers
-DPDFTK_VER=\"1.41\" -c
/opt/gcc346/bin/g++ attachments.cc
-I/opt/gcc346/objdir/sparc-sun-solaris2.8/libjava -I../java_libs -O0
-DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers
-DPDFTK_VER=\"1.41\" -c
/opt/gcc346/bin/g++ report.cc
-I/opt/gcc346/objdir/sparc-sun-solaris2.8/libjava -I../java_libs -O0
-DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers
-DPDFTK_VER=\"1.41\" -c
/opt/gcc346/bin/g++ pdftk.o attachments.o report.o
../java_libs/com/lowagie/text/pdf/pdf.a
../java_libs/com/lowagie/text/text.a
../java_libs/com/lowagie/text/pdf/pdf.a
../java_libs/com/lowagie/text/pdf/codec/codec.a
../java_libs/com/lowagie/text/pdf/codec/wmf/wmf.a
../java_libs/com/lowagie/text/pdf/fonts/fonts.a
../java_libs/com/lowagie/text/markup/markup.a
../java_libs/com/lowagie/text/xml/xmp/xmp.a
../java_libs/com/lowagie/bc/asn1/asn1.a
../java_libs/com/lowagie/text/pdf/codec/postscript/postscript.a
../java_libs/java_local/security/security.a
../java_libs/gnu_local/java/security/provider/provider.a
../java_libs/gnu_local/java/security/security.a
../java_libs/gnu/gcj/convert/convert.a
../java_libs/com/lowagie/text/pdf/fonts/Courier-Bold.o
../java_libs/com/lowagie/text/pdf/fonts/Courier-BoldOblique.o
../java_libs/com/lowagie/text/pdf/fonts/Courier-Oblique.o
../java_libs/com/lowagie/text/pdf/fonts/Courier.o
../java_libs/com/lowagie/text/pdf/fonts/Helvetica-Bold.o
../java_libs/com/lowagie/text/pdf/fonts/Helvetica-BoldOblique.o
../java_libs/com/lowagie/text/pdf/fonts/Helvetica-Oblique.o
../java_libs/com/lowagie/text/pdf/fonts/Helvetica.o
../java_libs/com/lowagie/text/pdf/fonts/Symbol.o
../java_libs/com/lowagie/text/pdf/fonts/Times-Bold.o
../java_libs/com/lowagie/text/pdf/fonts/Times-BoldItalic.o
../java_libs/com/lowagie/text/pdf/fonts/Times-Italic.o
../java_libs/com/lowagie/text/pdf/fonts/Times-Roman.o
../java_libs/com/lowagie/text/pdf/fonts/ZapfDingbats.o -I../java_libs
-O0 -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false
-fdollars-in-identifiers -DPDFTK_VER=\"1.41\"
-L/opt/gcc346/lib/copyoflib -lgcj -L/opt/gcc346/lib/copyoflib -lstdc++
-lrt -lnsl -ldl -lgcj -lsocket -L/usr/local/lib -liconv -o pdftk

i hope this is of use, if not, i will need further instruction to take
advantage
of your assistance.

thank you for your time
lloyd knight

-----Original Message-----
From: Boehm, Hans [mailto:hans.boehm@hp.com] 
Sent: Tuesday, April 10, 2007 4:18 PM
To: Andrew Haley; gc@napali.hpl.hp.com
Cc: Knight, Lloyd; java@gcc.gnu.org
Subject: RE: can't for daemon problem with gcc/gcj compiled program

It looks like the thr_create call in solaris_threads.c is failing.  A
bit of debugging to determine the errno value would be useful.

Is this really being linked against the thread library?  Or is it just
picking up a dummy thr_create() that always fails?

Hans

> -----Original Message-----
> From: java-owner@gcc.gnu.org [mailto:java-owner@gcc.gnu.org] On Behalf

> Of Andrew Haley
> Sent: Tuesday, April 10, 2007 9:06 AM
> To: gc@napali.hpl.hp.com
> Cc: Knight, Lloyd; java@gcc.gnu.org
> Subject: Re: can't for daemon problem with gcc/gcj compiled program
> 
> GC people,
> 
> I can't figure out what the cause of this might be.  The infamous 
> thread registration bug, perhaps?
> 
> Any ideas are welcome...
> 
> Andrew.
> 
> 
> --------------------------------------------------------------
> -------------------
> i have compiled/installed gcc3.4.6 in order to compile the gpl 
> software,
> pdftk1.4 on solaris8.
> pdftk1.4 requires gcj.   after jumping through many hoops, i finally
> got pdftk to compile then finally link with g++.
> 
> the problem i have now is when i run pdftk i get:
> Cant fork daemon
> Core Dump
> 
> here is the stack trace of the core dump:
> (/opt/SUNWspro/bin/../WS5.0/bin/sparcv9/dbx) where =>[1] 
> _libc_kill(0x0, 0x6, 0x0, 0xffffffff, 0x9f7f20, 0xff035970), at 
> 0xff0a0028
>   [2] abort(0xff0bc008, 0xff0bc008, 0x0, 0xffbef628, 0x82f618, 0x0), 
> at
> 0xff035a54
>   [3] GC_abort(0x82fe18, 0x0, 0x5dbb2c, 0x0, 0x140, 0xffbef14c), at
> 0x5d7588
>   [4] GC_thr_init(0x9eacc4, 0x9eae04, 0x0, 0xffbef628, 0x0, 0x917284),

> at 0x5dbd90
>   [5] GC_init_inner(0x0, 0x0, 0x0, 0x0, 0x21eec, 0x5d7fbc), at 
> 0x5d7b90
>   [6] GC_init(0x9f7f28, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x5d7fc4
>   [7] GC_init_gcj_malloc(0x0, 0x5cc1f0, 0x0, 0x0, 0x21a68, 0x5cd698), 
> at 0x5d184c
>   [8] _Z10_Jv_InitGCv(0x0, 0xff0bc008, 0x0, 0x0, 0x7df278, 0x9f2000), 
> at 0x5cd12c
>   [9] _Z16_Jv_CreateJavaVMPv(0xffffffff, 0x0, 0x0, 0x0, 0x0, 0x0), at 
> 0x4f7b80
>   [10] _Z14JvCreateJavaVMPv(0x0, 0x6cfecc, 0x0, 0x0, 0x2e2f312e, 0x2),

> at 0x65c040
>   [11] main(0x2, 0xffbef5a4, 0xffbef5b0, 0xa0457c, 0x0, 0x0), at
> 0x1e14c8
> 
> then...
> 
> (/opt/SUNWspro/bin/../WS5.0/bin/sparcv9/dbx) stop in GC_thr_init
> dbx: warning: 'GC_thr_init' has no debugger info -- will trigger on 
> first instruction
> (2) stop in GC_thr_init
> (/opt/SUNWspro/bin/../WS5.0/bin/sparcv9/dbx) run ./1.pdf
> Running: pdftk ./1.pdf
> (process id 8229)
> Reading en_US.ISO8859-15.so.2
> stopped in GC_thr_init at 0x5dbcac
> 0x005dbcac: GC_thr_init       : save    %sp, -0x78, %sp
> (/opt/SUNWspro/bin/../WS5.0/bin/sparcv9/dbx) step
> dbx: no srcline info for current function or any of its callers -- 
> step aborted
> dbx: warning: internal handler (-76) made defunct -- could not enable 
> event NEXTI
> 
> i was pointed to this issue by Andrew Haley:
> http//gcc.gnu.org/bugzilla/show_bug.cgi?id=13212
> 
> is this the issue i am encountering?
> if so, is there a fix?  i noticed a "patch" in the above report, but 
> it seems more like a listing of diff's of source files.  do i need a 
> newer version of gcc/gcj?
> 
> any help would be appreciated.
> 
> thank you
> lloyd knight
> 
> --
> Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, 
> Berkshire, SL4 1TE, UK Registered in England and Wales No. 3798903
> 



More information about the Java mailing list