Coder Social home page Coder Social logo

path.TestWalk fails running as root about go HOT 33 CLOSED

golang avatar golang commented on June 8, 2024
path.TestWalk fails running as root

from go.

Comments (33)

gopherbot avatar gopherbot commented on June 8, 2024

Comment 1 by zefonseca:

Same issue, Slackware 13.
I commented out each test function body that failed and it finished the compilation.
Total 3 test files with problems:
src/pkg/os/os_test.go
src/pkg/os/path_test.go
src/pkg/net/net_test.go (tried to "dial out")

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 2 by bow.fujita:

In src/pkg/os/path_test.go at line #122:
if err = RemoveAll(path); err == nil {
Is this a bug?
The code at line #122 is different from any other codes calling RemoveAll() in
path_test.go, at line #79, #100, #144, so I think the code should be
if err = RemoveAll(path); err != nil {
I modified the code and ran all.bash again, however I got another error message as below:
gopack grc _test/os.a _gotest_.8 
make[2]: Leaving directory `/root/go/src/pkg/os'
--- FAIL: os_test.TestRemoveAll
    RemoveAll "_obj/_TestRemoveAll_" returned os.Error not *PathError
FAIL

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 3 by bow.fujita:

> Is this a bug?
Sorry, my guess was wrong. This is NOT a bug.
At line #122, it is expected that RemoveAll(path) will fail, because Chmod(dpath, 0)
is called previously and nobody, except root, can remove subdirectory `dpath`.
The reason why all.bash failed is that I ran all.bash as root.
When I ran all.bash as a normal user, installation successfully completed.
Thank you.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 4 by denis.kuzmenok:

Same error, Centos 5.3 x64, running under root or sudo:
6g -o _gotest_.6 dir_linux.go env.go error.go exec.go file.go getwd.go path.go 
proc.go stat_linux.go sys_linux.go time.go types.go
rm -f _test/os.a
gopack grc _test/os.a _gotest_.6
make[2]: Leaving directory `/root/develop/go/src/pkg/os'
--- FAIL: os_test.TestRemoveAll
        RemoveAll "_obj/_TestRemoveAll_" succeeded with chmod 0 subdirectory?(extra 
*os.PathError=lstat _obj/_TestRemoveAll_: no such file or directory)
FAIL
make[1]: *** [test] Error 1
make[1]: Leaving directory `/root/develop/go/src/pkg/os'
make: *** [os.test] Error 2

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 5 by renatoalbano:

Same error, Mac OS X  Leopard 10.5.8:
8g -o _gotest_.8 dir_darwin.go env.go error.go exec.go file.go getwd.go path.go proc.go
stat_darwin.go 
sys_darwin.go time.go types.go    
rm -f _test/os.a
gopack grc _test/os.a _gotest_.8 
--- FAIL: os_test.TestRemoveAll
    RemoveAll "_obj/_TestRemoveAll_" succeeded with chmod 0 subdirectory?(extra *os.PathError=lstat 
_obj/_TestRemoveAll_: no such file or directory)
FAIL
make[1]: *** [test] Error 1
make: *** [os.test] Error 2

from go.

rsc avatar rsc commented on June 8, 2024

Comment 7:

Owner changed to [email protected].

Status changed to Started.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 8:

This issue was closed by revision 1971e1b.

Status changed to Fixed.

Merged into issue #-.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 9 by larsgoran.forsberg:

Same, Mac OS X Lepoard 10.5.8
cd os && make test
gotest
rm -f _test/os.a _gotest_.8
8g -o _gotest_.8 dir_darwin.go env.go error.go exec.go file.go getwd.go path.go proc.go
stat_darwin.go 
sys_darwin.go time.go types.go    
rm -f _test/os.a
gopack grc _test/os.a _gotest_.8 
--- FAIL: os_test.TestRemoveAll
    RemoveAll "_obj/_TestRemoveAll_" succeeded with chmod 0 subdirectory?(extra *os.PathError=lstat 
_obj/_TestRemoveAll_: no such file or directory)
FAIL
make[1]: *** [test] Error 1
make: *** [os.test] Error 2

from go.

rsc avatar rsc commented on June 8, 2024

Comment 10:

You can run
hg pull
hg update
and run again and it should not fail anymore.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 11:

Issue #46 has been merged into this issue.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 12 by larsgoran.forsberg:

Still getting an error with new patch (mac os x 10.5)
cd os && make test
gotest
rm -f _test/os.a _gotest_.8
8g -o _gotest_.8 dir_darwin.go env.go error.go exec.go file.go getwd.go path.go proc.go
stat_darwin.go 
sys_darwin.go time.go types.go    
rm -f _test/os.a
gopack grc _test/os.a _gotest_.8 
--- FAIL: os_test.TestRemoveAll
    Chmod "_obj/_TestRemoveAll_/dir" 0777: chmod _obj/_TestRemoveAll_/dir: no such file or directory
FAIL
make[1]: *** [test] Error 1
make: *** [os.test] Error 2

from go.

rsc avatar rsc commented on June 8, 2024

Comment 13:

Status changed to Started.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 14 by malatmals:

Ya I get the same pretty much on my snow leopard...
cd os && make test
gotest
rm -f _test/os.a _gotest_.6
6g -o _gotest_.6 dir_darwin.go env.go error.go exec.go file.go getwd.go path.go proc.go
stat_darwin.go 
sys_darwin.go time.go types.go    
rm -f _test/os.a
gopack grc _test/os.a _gotest_.6 
--- FAIL: os_test.TestRemoveAll
    Chmod "_obj/_TestRemoveAll_/dir" 0777: chmod _obj/_TestRemoveAll_/dir: no such file or directory
FAIL
make[1]: *** [test] Error 1
make: *** [os.test] Error 2

from go.

rsc avatar rsc commented on June 8, 2024

Comment 15:

This issue was closed by revision 2cda46d.

Status changed to Fixed.

Merged into issue #-.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 16:

Issue #78 has been merged into this issue.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 17 by larsgoran.forsberg:

Still can't compile.
cd path && make test
gotest
rm -f _test/path.a _gotest_.8
8g -o _gotest_.8 path.go    path_test.go
rm -f _test/path.a
gopack grc _test/path.a _gotest_.8 
--- FAIL: path.TestWalk
    1. error expected, none found
    node testdata/d/x mark = 2; expected 1
    node testdata/d/y mark = 2; expected 1
    node testdata/d/z mark = 2; expected 1
    node testdata/d/z/u mark = 2; expected 1
    node testdata/d/z/v mark = 2; expected 1
FAIL
make[1]: *** [test] Error 1
make: *** [path.test] Error 2

from go.

rsc avatar rsc commented on June 8, 2024

Comment 18:

Why do you all run so many things as root?  ;-)
Okay, reopening this bug.  Will fix tomorrow.

Status changed to Started.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 19:

Issue #84 has been merged into this issue.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 20 by larsgoran.forsberg:

Well, Im guessing the root-love comes from my time as BSD admin at a hosting company,
where you actually 
compiled stuff as root or not at all.. Call it bad manors but hey.. 
In another sense, I tried to compile this as a normal user first and it gave me an
instant failure and my brain just 
told me "ahh, this should be done as root"..
I will give the normal user another go in a few hours but i'm guessing you will want to
fix this either way.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 21:

Issue #111 has been merged into this issue.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 22:

Issue #120 has been merged into this issue.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 23:

Issue #134 has been merged into this issue.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 24:

This issue was closed by revision e7b8f5f.

Status changed to Fixed.

Merged into issue #-.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 25:

Issue #193 has been merged into this issue.

from go.

agl avatar agl commented on June 8, 2024

Comment 26:

Issue #208 has been merged into this issue.

from go.

agl avatar agl commented on June 8, 2024

Comment 27:

Issue #235 has been merged into this issue.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 28 by robin.duckett:

"Don't use root" cannot be the fix for this bug. Sometimes it's unavoidable.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 29:

Don't use root was the workaround.
This has been fixed properly in the tree
and the current release runs fine as root.
Thanks for your feedback.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 30 by nathan.beckmann:

This is failing on Debian Lenny:
make[2]: Entering directory `/afs/csail.mit.edu/u/b/beckmann/tools/go/src/pkg/os'
6g -o _gotest_.6 dir_linux.go error.go exec.go file.go getwd.go path.go proc.go
stat_linux.go time.go types.go  env_unix.go file_unix.go sys_linux.go  
rm -f _test/os.a
gopack grc _test/os.a _gotest_.6 
make[2]: Leaving directory `/afs/csail.mit.edu/u/b/beckmann/tools/go/src/pkg/os'
--- FAIL: os_test.TestRemoveAll
    RemoveAll "_obj/_TestRemoveAll_" succeeded with chmod 0 subdirectory?(extra *os.PathError=lstat _obj/_TestRemoveAll_: no such file or directory)
FAIL
make[1]: *** [test] Error 1
make[1]: Leaving directory `/afs/csail.mit.edu/u/b/beckmann/tools/go/src/pkg/os'
make: *** [os.test] Error 2

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 31 by nathan.beckmann:

Apparently an AFS issue, must be built as root. This would be good to have in the
documentation somewhere (maybe I missed it). Works now.

from go.

gopherbot avatar gopherbot commented on June 8, 2024

Comment 32 by 518lee:

== Failure on Fedora 14, non-root user ==
=== Version: ===
changeset:      6764:03404c0155f6
tag:        tip
user:        Robert Griesemer 
date:        Fri Nov 12 16:39:33 2010 -0800
summary:        token/position: implemented Pos
=== Logs: ===
make[2]: Entering directory `/media/f/opt/go/src/pkg/os'
rm -f _test/os.a _gotest_.8
make[2]: Leaving directory `/media/f/opt/go/src/pkg/os'
make[2]: Entering directory `/media/f/opt/go/src/pkg/os'
8g -o _gotest_.8 dir_linux.go error.go env.go exec.go file.go getwd.go path.go proc.go
stat_linux.go time.go types.go  env_unix.go file_unix.go sys_linux.go  
rm -f _test/os.a
gopack grc _test/os.a _gotest_.8 
make[2]: Leaving directory `/media/f/opt/go/src/pkg/os'
--- FAIL: os_test.TestRemoveAll
    RemoveAll "_obj/_TestRemoveAll_" succeeded with chmod 0 subdirectory%!(EXTRA *os.PathError=lstat _obj/_TestRemoveAll_: no such file or directory)
FAIL
make[1]: *** [test] Error 1
make[1]: Leaving directory `/media/f/opt/go/src/pkg/os'
make: *** [os.test] Error 2

from go.

rsc avatar rsc commented on June 8, 2024

Comment 33:

/media/f is probably a FAT file system
which might as well be the same as running as root.
I will disable the test.

Status changed to Accepted.

from go.

rsc avatar rsc commented on June 8, 2024

Comment 34:

changeset:   6907:b66dc1a07967
user:        Russ Cox 
date:        Thu Dec 09 14:49:13 2010 -0500
summary:     os: fix test of RemoveAll

Status changed to Fixed.

from go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.