November 21, 2011

Solaris 10 touch Bad address

Posted in Solaris at 11:20 am by alessiodini

Today i’m working on this issue:

root@system01 # clnode show-rev
clnode: (C660883) Internal error.

Altough this is not a critical issue i was very curious to understand what did not work.
I tried the legacy scinstall command as follow:

system01 # scinstall -p
touch: cannot change times on /var/cluster/run/scinstall/scinstall.tmp.28601: Bad address

scinstall: scinstall did NOT complete successfully!

well , from scinstall i had more info about the issue.
I tried to use touch for make a new file:

root@system01 # cd /var/cluster/run/scinstall/
root@system01 # touch 1
touch: cannot change times on 1: Bad address
root@system01 # touch 1
root@system01 #

the first time it does not work , the second it works, mmm.
Let’s try again:

root@ssb40015 # pwd
/sun-temp
root@system01 # touch 1
touch: cannot change times on 1: Bad address
root@system01 # touch 2
touch: cannot change times on 2: Bad address
root@system01 # touch 3
touch: cannot change times on 3: Bad address

Well , after these experiments i was able to identify the follow conditions:

1) The issue happens when i try to make a new file for the first time
2) The issue does not happens when i try to make a new file for the second time
3) The issue is not due to pathname ( in my opinion ) because i tried it from /var and /sun-temp ( then no permissions issue )
4) Even i got that error the file was maked by touch command but it’s empty.
5) The scinstall comand does not complete , because every time it makes a new file with touch where the name of the file is scinstall.tmp.pid

I used truss for compare both cases output ( when it works and when not ).
The difference is here:
( when it does not work )

4846: stat64(“pippo”, 0xFFBFF968) Err#2 ENOENT
4846: creat64(“pippo”, 0666) = 3
4846: futimens(3, 0x00000000) Err#14 EFAULT
4846: fstat64(2, 0xFFBFE818) = 0
touch4846: write(2, ” t o u c h”, 5) = 5
: cannot change times on 4846: write(2, ” : c a n n o t c h a”.., 25) = 25
pippo4846: write(2, ” p i p p o”, 5) = 5
: 4846: write(2, ” : “, 2) = 2
Bad address4846: write(2, ” B a d a d d r e s s”, 11) = 11

4846: write(2, “\n”, 1) = 1
4846: close(3) = 0
4846: _exit(1)

( when it works )

5868: stat64(“pippo”, 0xFFBFF968) = 0
5868: utimensat(-3041965, “pippo”, 0x00000000, 0) = 0
5868: _exit(0)

It seems that the issue comes from futimens syscall.
I read the manpage but i was not able to find the “Err#14 EFAULT” error.
Looking on the web i found something similar on Solaris 11 , it seems a bug where EFAULT stands for “times pointed to an invalid address; or, dirfd was AT_FDCWD, and pathname is NULL or an invalid address.”

I hope to understand more about this issue!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: