Linux PARISC architecture development
 help / color / mirror / Atom feed
From: matoro <matoro_mailinglist_kernel@matoro.tk>
To: Ian Lance Taylor <iant@golang.org>
Cc: John David Anglin <dave.anglin@bell.net>,
	deller@gmx.de, linux-parisc@vger.kernel.org, hppa@gentoo.org
Subject: Re: Correct goarch.sh settings for gccgo on hppa?
Date: Sun, 27 Nov 2022 01:53:28 -0500	[thread overview]
Message-ID: <8d3b98ad973d3cd0ed807ec9d2edeaf2@matoro.tk> (raw)
In-Reply-To: <CAOyqgcWK4UhU-GhEvUo26X_UEK_GK-a1xzqr27J98HAe1J9VYg@mail.gmail.com>

Surprisingly yes, a trivial program does work.  Seems the problems only 
arise on anything more than that.

$ go version
go version go1.18 gccgo (Gentoo 12.2.1_p20221008 p1) 12.2.1 20221008 
linux/hppa
$ cat test.go
package main
import "fmt"
func main() {
     fmt.Println("Hello World!")
}
$ go build test.go
$ ./test
Hello World!

Main issue is that the exact stacktrace is different in between runs.  I 
tried setting GOMAXPROCS=1 in order to make it reproducible but that 
completely changed the error.

$ GOMAXPROCS=1 go install github.com/gokcehan/lf@latest
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x0]

goroutine 15 [running]:
memchr
         :0
created by net_1http.Transport.queueForDial
         
/var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/net/http/transport.go:1418 
+0x37b

Here is as much info as I am able to get out of gdb:

$ GOMAXPROCS=1 gdb --quiet --args /usr/local/bin/go install 
github.com/gokcehan/lf@latest
Reading symbols from /usr/local/bin/go...
Reading symbols from 
/usr/lib/debug//usr/hppa2.0-unknown-linux-gnu/gcc-bin/12/go-12.debug...
(gdb) r
Starting program: /usr/local/bin/go install 
github.com/gokcehan/lf@latest
warning: Unable to find libthread_db matching inferior's thread library, 
thread debugging will not be available.
[New LWP 7838]
[New LWP 7839]

Thread 3 "go" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 7839]
0xf7556aa8 in memcmp () from /lib/libc.so.6
(gdb) bt full
#0  0xf7556aa8 in memcmp () from /lib/libc.so.6
No symbol table info available.
#1  0xf8d41134 in net_1http.Transport.dialConn (t=0x41a90340, 
t@entry=0x41acc370, ctx=..., param=...)
     at 
/var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/net/http/transport.go:1645
         trace = 0x0
         wrapErr = 0x433107ec
         cm = 0x4180b950
         pconn = 0x41acc370
         err = {__methods = 0x0, __object = 0x0}
#2  0xf8d42b7c in net_1http.Transport.dialConnFor (t=0x41acc370, 
w=0x4180b950)
     at 
/var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/net/http/transport.go:1449
         pc = <optimized out>
         err = <optimized out>
         delivered = <optimized out>
#3  0xf8d42eb4 in net/http.go..thunk166 (__go_thunk_parameter=<optimized 
out>)
     at 
/var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/net/http/transport.go:1418
No locals.
#4  0xf8ea2264 in runtime.kickoff ()
     at 
/var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/runtime/proc.go:1316
         gp = 0x4180b950
         fv = 0x4180e5b8
         param = 0x41acc370
#5  0xf74f4284 in setcontext () from /lib/libc.so.6
No symbol table info available.
#6  0x00000000 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt 
stack?)

This seems to have something at least, is it useful?

-------- Original Message --------
Subject: Re: Correct goarch.sh settings for gccgo on hppa?
Date: 2022-11-26 22:17
 From: Ian Lance Taylor <iant@golang.org>
To: matoro <matoro_mailinglist_kernel@matoro.tk>

On Fri, Nov 25, 2022, 9:39 PM matoro 
<matoro_mailinglist_kernel@matoro.tk>
wrote:

> Oh sorry, should have clarified.  I did all those parts already, just
> didn't include them because I assumed the at-fault piece would be in
> goarch.sh.  This is for Linux only.
> 
> All I did for the conditional stuff was add HPPA to all the 32-bit
> files, and add the two unique syscall numbers.  This was based on the
> instructions in configure.ac.  Here is the complete patch:
> https://dpaste.com/HVHNU9BKF.txt
> 
> Is there something I might be missing?
> 


Good to hear you have updated the build tags.  I don't know what is 
wrong,
tough.  Can you run the failing program under the debugger and find out
where that address is coming from?

But first: does a trivial hello world program work?

Ian



-------- Original Message --------
> Subject: Re: Correct goarch.sh settings for gccgo on hppa?
> Date: 2022-11-26 00:25
>  From: Ian Lance Taylor <iant@golang.org>
> To: matoro <matoro_mailinglist_kernel@matoro.tk>
> 
> On Fri, Nov 25, 2022 at 8:31 PM matoro
> <matoro_mailinglist_kernel@matoro.tk> wrote:
> >
> > Thank you both for the suggestions.  I tried the following values:
> >
> > diff --git a/libgo/goarch.sh b/libgo/goarch.sh
> > index 977f318b3..e0d6a3ad8 100755
> > --- a/libgo/goarch.sh
> > +++ b/libgo/goarch.sh
> > @@ -88,6 +88,16 @@ case $goarch in
> >                  ;;
> >          esac
> >          ;;
> > +    hppa)
> > +       bigendian=true
> > +       defaultphyspagesize=4096
> > +       family=HPPA
> > +       int64align=8
> > +       minframesize=64
> > +       pcquantum=4
> > +       ptrsize=4
> > +       stackalign=64
> > +       ;;
> >       ia64)
> >          family=IA64
> >          cachelinesize=128
> >
> > But unfortunately got the same result.  I wonder if there is something
> > else missing?
> >
> > Ian, if you have the time, I have a machine you can use to look at
> > this.
> 
> As far as I know gccgo has never been ported to parisc.  This requires
> a fair bit more than just fixing up goarch.sh.  There are a bunch of
> files in libgo that are conditionally compiled based on the GOARCH
> (processor) and GOOS (operating system) values.  These are marked in
> the files by comments that start with "+build" or "go:build".  Many of
> those comments will need to be adjusted to recognize parisc and
> whatever operating system you are using.  If this is for HP/UX, there
> is also operating specific code required in various places.
> 
> I'm happy to answer questions about doing the port, but it's not a
> trivial task.
> 
> Ian
> 

  parent reply	other threads:[~2022-11-27  6:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 18:00 Correct goarch.sh settings for gccgo on hppa? matoro
2022-11-25 18:31 ` Helge Deller
2022-11-25 18:45 ` John David Anglin
2022-11-26  4:31   ` matoro
2022-11-26  5:25     ` Ian Lance Taylor
2022-11-26  5:39       ` matoro
     [not found]         ` <CAOyqgcWK4UhU-GhEvUo26X_UEK_GK-a1xzqr27J98HAe1J9VYg@mail.gmail.com>
2022-11-27  6:53           ` matoro [this message]
2022-11-27  8:19             ` Helge Deller
2022-11-28 20:20               ` Ian Lance Taylor
2022-11-28 21:07                 ` matoro
2022-11-28 21:24                   ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d3b98ad973d3cd0ed807ec9d2edeaf2@matoro.tk \
    --to=matoro_mailinglist_kernel@matoro.tk \
    --cc=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=hppa@gentoo.org \
    --cc=iant@golang.org \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox