1834150 Members
2165 Online
110064 Solutions
New Discussion

Segmentation Fault

 
Christopher Chen_1
Occasional Contributor

Segmentation Fault


Everytime I type the command last I get a segmentation fault and it cores. I have other machines configured the same way but only one machine faults and cores.

Any idea as to how to fix this?
3 REPLIES 3
John Poff
Honored Contributor

Re: Segmentation Fault

Hello,

Could it be a bad /var/adm/wtmp file?

JP
Christopher Chen_1
Occasional Contributor

Re: Segmentation Fault


If I remove the wtmp file will it automatically rebuild itself?
S.K. Chan
Honored Contributor

Re: Segmentation Fault

Most of the time this is due to ..
1) /var/adm/btmp
OR
2) /var/adm/wtmp
files being corrupted. Do this to determine if those 2 files are indeed corrupted ..
# cd /var/adm
# mv btmp btmp.org
# mv wtmp wtmp.org
# touch btmp
==> make sure permission/ownership same as btmp.org
# touch wtmp
==> same here

After this run "last" again. We have to figure out which file is corrupted. At this point if "last" doesn't core dumped, proceed ..

# cp btmp.org btmp
# last
==> Any error ? If no most likely wtmp is toast, if yes then btmp is toast. Proceed anyway ..

# cp wtmp.org wtmp
# last
==> Finally determine if wtmp is corrupted.

Once ypu know which file is bad, clear it or zeroed it .. (example if btmp is bad)
# > btmp