Running inside the gdb worked. Seems like a problem with libmpfr. Will try
compiling it from source.
Following is the end of the GDB output:
/export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go:658:43: error:
expected integer, floating, complex, or string type
s.errorString("integer overflow on token " + tok)
^
/export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go:688:52: error:
expected integer, floating, complex, or string type
s.errorString("unsigned integer overflow on token " + tok)
^
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0xfbb8df24 in mpfr_init2 () from /opt/csw/lib/sparcv8/libmpfr.so.4
(gdb) bt
#0 0xfbb8df24 in mpfr_init2 () from /opt/csw/lib/sparcv8/libmpfr.so.4
#1 0xff1d8bac in mpc_init2 () from /usr/lib/libmpc.so.3
#2 0x001c5500 in Numeric_constant::check_complex_type (this=0xffbff0e8,
type=0x1094488, issue_error=<optimized out>, location=...)
at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.cc:16745
#3 0x001c588c in Numeric_constant::set_type (this=0xffbff0e8,
type=0x11f4f38, issue_error=<optimized out>, loc=...)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/types.h:751
#4 0x001c5944 in Integer_expression::do_check_types (this=0x11f50a0) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.h:535
#5 0x001e7d04 in check_types (gogo=<optimized out>, this=<optimized out>)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.h:920
#6 Check_types_traverse::expression (this=<optimized out>, expr=0x123ba88)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:3306
#7 0x001b3fc8 in Expression::traverse (pexpr=0x123ba88,
traverse=0xffbff6d4) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/expressions.cc:45
#8 0x0022eb8c in Statement::traverse (this=0x123ba78, block=0x123c128,
pindex=0xffbff294, traverse=0xffbff6d4)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54
#9 0x001ea9f0 in Block::traverse (this=0x123c128, traverse=0xffbff6d4) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063
#10 0x0022eb8c in Statement::traverse (this=0x123ba98, block=0x11f5078,
pindex=0xffbff35c, traverse=0xffbff6d4)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54
#11 0x001ea9f0 in Block::traverse (this=0x11f5078, traverse=0xffbff6d4) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063
#12 0x0022df60 in If_statement::do_traverse (this=0x11f6370,
traverse=0xffbff6d4) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:84
#13 0x0022eb8c in Statement::traverse (this=0x11f6370, block=0x11f5028,
pindex=0xffbff484, traverse=0xffbff6d4)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54
#14 0x001ea9f0 in Block::traverse (this=0x11f5028, traverse=0xffbff6d4) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063
#15 0x0022eb8c in Statement::traverse (this=0x11f6390, block=0x11f4f60,
pindex=0xffbff54c, traverse=0xffbff6d4)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/statements.cc:54
#16 0x001ea9f0 in Block::traverse (this=0x11f4f60, traverse=0xffbff6d4) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:6063
#17 0x001eac80 in Function::traverse (this=0x11f6a88, traverse=0xffbff6d4)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:5135
#18 0x001ec6f0 in Bindings::traverse (this=0x10b4f60, traverse=0xffbff6d4,
is_global=<optimized out>) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.h:2584
#19 0x001eca38 in Gogo::traverse (this=0x10f03f8, traverse=0xffbff6d4) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.h:3200
#20 0x001ecd2c in Gogo::check_types (this=0x10f03f8) at
/export/home/amandeep/gccgo-src/gcc/go/gofrontend/gogo.cc:3316
#21 0x001e7700 in go_parse_input_files (filenames=0x10cf468,
filename_count=4, only_check_syntax=<optimized out>)
at /export/home/amandeep/gccgo-src/gcc/go/gofrontend/go.cc:136
#22 0x001e2480 in go_langhook_parse_file () at
/export/home/amandeep/gccgo-src/gcc/go/go-lang.c:329
#23 0x006b97d4 in compile_file () at
/export/home/amandeep/gccgo-src/gcc/toplev.c:455
#24 0x00e1c9f4 in toplev::main(int, char**) () at ./insn-modes-inline.h:38
#25 0x00e1e1e4 in main (argc=21, argv=0xffbffa44) at
/export/home/amandeep/gccgo-src/gcc/main.c:39
On Thursday, August 23, 2018 at 2:25:38 PM UTC-7, Ian Lance Taylor wrote:
>
> On Thu, Aug 23, 2018 at 2:14 PM, Amandeep Gautam
> <[email protected] <javascript:>> wrote:
> >
> > /export/home/amandeep/gccgo-obj/./gcc/go1
> > /export/home/amandeep/gccgo-src/libgo/go/fmt/doc.go
> > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go
> > /export/home/amandeep/gccgo-src/libgo/go/fmt/print.go
> > /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go -quiet -dumpbase
> doc.go
> > -mcpu=v9 -auxbase-strip .libs/fmt.o -g -O2 -version -fgo-pkgpath=fmt
> -fPIC
> > -I . -L/export/home/amandeep/gccgo-obj/./gcc -o /var/tmp//ccmxS20e.s
> >
> > and I got:
> >
> > GNU Go (GCC) version 8.2.1 20180814 (sparc-sun-solaris2.10)
> > compiled by GNU C version 8.2.1 20180814, GMP version 6.1.2,
> MPFR
> > version 4.0.0, MPC version 1.0.2, isl version csw-0.18-GMP
> >
> > GGC heuristics: --param ggc-min-expand=100 --param
> ggc-min-heapsize=131072
> > GNU Go (GCC) version 8.2.1 20180814 (sparc-sun-solaris2.10)
> > compiled by GNU C version 8.2.1 20180814, GMP version 6.1.2,
> MPFR
> > version 4.0.0, MPC version 1.0.2, isl version csw-0.18-GMP
> >
> > GGC heuristics: --param ggc-min-expand=100 --param
> ggc-min-heapsize=131072
> > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go:8:9: error:
> import
> > file 'strconv' not found
> > "strconv"
> > ^
> > /export/home/amandeep/gccgo-src/libgo/go/fmt/format.go:9:14: error:
> import
> > file 'unicode/utf8' not found
> > "unicode/utf8"
> > ^
> > ... and many more before ending into ...
> >
> > /export/home/amandeep/gccgo-src/libgo/go/fmt/scan.go:688:52: error:
> expected
> > integer, floating, complex, or string type
> > s.errorString("unsigned integer overflow on token " + tok)
> > ^
> > Segmentation Fault (core dumped)
> >
> > I tried analyzing the core dumped. so I did: gdb
> > /export/home/amandeep/gccgo-obj/./gcc/go1 ./core and below is how the
> promt
> > looks:
> >
> > GNU gdb (GDB) 7.7
> > Copyright (C) 2014 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later
> > <http://gnu.org/licenses/gpl.html>
> > This is free software: you are free to change and redistribute it.
> > There is NO WARRANTY, to the extent permitted by law. Type "show
> copying"
> > and "show warranty" for details.
> > This GDB was configured as "sparc-sun-solaris2.10".
> > Type "show configuration" for configuration details.
> > For bug reporting instructions, please see:
> > <http://www.gnu.org/software/gdb/bugs/>.
> > Find the GDB manual and other documentation resources online at:
> > <http://www.gnu.org/software/gdb/documentation/>.
> > For help, type "help".
> > Type "apropos word" to search for commands related to "word"...
> > Reading symbols from /export/home/amandeep/gccgo-obj/./gcc/go1...done.
> >
> > warning: Couldn't find general-purpose registers in core file.
> >
> > warning: Wrong size fpregset in core file.
> > [Thread debugging using libthread_db enabled]
> > [New Thread 1 (LWP 1)]
> >
> > warning: Couldn't find general-purpose registers in core file.
> >
> > warning: Couldn't find general-purpose registers in core file.
> > Error in re-setting breakpoint -1: PC register is not available
> > Error in re-setting breakpoint -2: PC register is not available
> > Error in re-setting breakpoint -3: PC register is not available
> > Error in re-setting breakpoint -4: PC register is not available
> > Error in re-setting breakpoint -5: PC register is not available
> > Core was generated by `/export/home/amandeep/gccgo-obj/./gcc/go1
> > /export/home/amandeep/gccgo-src/libgo'.
> >
> > warning: Couldn't find general-purpose registers in core file.
> >
> > warning: Wrong size fpregset in core file.
> > PC not available
> > #-1 <unavailable> in ?? ()
> > (gdb) bt
> > #-1 <unavailable> in ?? ()
> > #0 <unavailable> in ?? ()
> > frame.c:472: internal-error: get_frame_id: Assertion `fi->this_id.p'
> failed.
> > A problem internal to GDB has been detected,
> > further debugging may prove unreliable.
> > Quit this debugging session? (y or n) n
> > frame.c:472: internal-error: get_frame_id: Assertion `fi->this_id.p'
> failed.
> > A problem internal to GDB has been detected,
> > further debugging may prove unreliable.
> > Create a core file of GDB? (y or n) y
> > Command aborted.
> >
> > Have I steps mentioned correctly? Any suggestions on the next steps?
>
> There is something badly wrong with your gdb. Unfortunately I can't
> help you with that. I have not seen that behavior before.
>
> I guess you could hope that the problem is only with the core file,
> and run the program inside gdb rather than trying to look at the core.
>
> Ian
>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.