Comments (19)
Issue #57 has been merged into this issue.
from go.
Status changed to Accepted.
from go.
Owner changed to [email protected].
from go.
Status changed to Started.
from go.
gopack.strace for merged isssue 57
Attachments:
- gopack.strace (10021 bytes)
from go.
This issue was closed by revision a174987.
Status changed to Fixed.
Merged into issue #-.
from go.
It does not fix the segfault under native arm build (originally raised in issue #57).
from go.
b88zhou: please add the output of hg log -l 1 and also the output of running the gopack command under strace.
Status changed to Started.
from go.
$ hg log -l 1 changeset: 3992:14daa3d2c998 tag: tip user: Russ Cox <[email protected]> date: Wed Nov 11 14:51:53 2009 -0800 summary: point at how to get easy_install on Ubuntu.
Attachments:
- gopack.strace (4856 bytes)
from go.
Thanks. This is definitely different. Can you please run gopack under gdb and try to get a stack trace?
from go.
bt output
Attachments:
- gopack-gdb-bt.txt (2046 bytes)
from go.
ninkendo: did the fix solve your gopack problem? (You'll have to hg pull -u to get an updated tree.) b88zhou: I have been through the relevant code again and cannot see how that trace can happen. It looks like in duplicate, p->name is 0, which should not be possible. If you have experience with C and want to try to figure it out, it's a very simple hash table somehow gone awry.
Status changed to Accepted.
from go.
Status changed to WaitingForReply.
from go.
$ cat hashstr.c #include <stdio.h> int hashstr(char *name) { int h; char *cp; h = 0; for (cp = name; *cp; h += *cp++) h *= 1119; printf("before h=%d\n", h); if (h < 0) h = ~h; printf("after h=%d\n", h); return h; } int main(void) { int n, h; n = hashstr("breakpoint"); h = n % 1024; printf("hashstr=%d h=%d\n", n, h); } $ gcc-4.3 -g -o hashstr hashstr.c $ ./hashstr before h=-585750607 after h=585750606 hashstr=585750606 h=78 $ gcc-4.3 -g -O2 -fno-inline -o hashstr hashstr.c $ ./hashstr before h=-585750607 after h=-585750607 hashstr=-585750607 h=-79 $ gcc-4.4 -g -o hashstr hashstr.c $ ./hashstr before h=-585750607 after h=585750606 hashstr=585750606 h=78 Looks like a gcc 4.3 specific bug when using -O2. Reproducible on two NAS devices.
from go.
Nice bug! Thanks for tracking that down. I'd like to find a workaround rather than require people to use a different gcc. Instead of if(h < 0) h = ~h, does it work if you use if(h < 0) h = (unsigned)h>>1 ? Thanks.
from go.
Tried your suggestion, does not work. My guess is that gcc 4.3 -O2 optimized away (h < 0) as always false. The following seems to work: int hashstr(char *name) { unsigned int h; char *cp; h = 0; for (cp = name; *cp; h += *cp++) h *= 1119; if (h & (0x01 << 31)) h = ~h; return (int) h; } During native build, gopak no longer segfaults. I had a different problem now, I'll file a separate issue. Thanks.
from go.
I'm going to do something a little simpler, just in case int is 64 bits. Thanks for tracking it down. I'd never have guessed that.
Status changed to Started.
from go.
Fixed by http://golang.org/cl/152088
Status changed to Fixed.
from go.
I can confirm that the latest hg tree builds on my nfs filesystem, and this issues is now fixed.
from go.
Related Issues (20)
- gopls/internal/analysis: noresultvalues diagnostic triggers "end > end of file + 1" bug (via telemetry) HOT 1
- proposal: cmd/go: doc -http should start a pkgsite instance and open a browser HOT 3
- 1.22.4 cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set HOT 2
- x/build/cmd/relui: merge 'Start Google Docker build' + 'Await Google Docker build' into one retryable task HOT 1
- all: increased toolchain binary sizes HOT 8
- x/tools/gopls/internal/test/integration/codelens: TestGCDetails_Toggle/default failures HOT 3
- net/http: TestTransportDialCancelRace/h1 failures HOT 2
- x/tools/gopls/internal/test/integration/misc: TestAssembly/default failures HOT 3
- net/netip: undocumented breaking change in reflect.DeepEquals HOT 7
- x/build/cmd/relui: implement ACLs
- x/tools/gopls/internal/test/integration/modfile: TestGovimModReadonly/default failures HOT 2
- x/tools/gopls: package not found when "linksInHover": "gopls" HOT 1
- iter: TestPull2/1 failures HOT 3
- iter: TestPull2/0 failures HOT 3
- iter: TestPull2/3 failures HOT 3
- iter:iter: TestPull/2 failures HOT 3
- cmd/link/internal/ld: testcarchive fails on Windows with MinGW: doesn't handle "\r" in output HOT 2
- cmd/link: runtime.mach_vm_region_trampoline: unsupported dynamic relocation for symbol libc_mach_task_self_ (type=29 (R_GOTPCREL) stype=46 (SDYNIMPORT)) [1.22 backport] HOT 2
- crypto/tls: usage of QUICResumeSession in Go 1.23rc1 breaks backwards compatibility HOT 2
- Interface type switches became 2x slower in go 1.22 compared to go 1.21 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.