LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-10-2002, 02:05 AM   #1
aditya
Member
 
Registered: Aug 2002
Distribution: RH 7.x
Posts: 71

Rep: Reputation: 15
Lightbulb ldconfig gives segmentation fault


Hi guys,
I made a root file system in ramdisk. It was mounted on 'test' directory. But when I did
'ldconfig -r test'
it gave me a Segmentation fault. And No, it's not a version problem or something. It's something I'm forgetting. I know this because it happened with me some time back also, but I don't remember how I corrected it. All I remember is it's not a big gun. It's just a glitch.
But, I can't remember.
 
Old 09-10-2002, 02:36 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Does the contents of test/etc/ld.so.conf make sense? Is the test/etc/ld.so.cache file maybe corrupted? You could always try deleting it. You might also want to try to use the full directory name when using the -r switch. Ex. ldconfig -r /mnt/test

If none of that helps you could always run the ldconfig command with strace to find out where it stops. Something like:

strace -o trace.out ldconfig -r /mnt/test
 
Old 09-10-2002, 03:50 AM   #3
aditya
Member
 
Registered: Aug 2002
Distribution: RH 7.x
Posts: 71

Original Poster
Rep: Reputation: 15
I don't know anything about ld.so.cache and ld.so.conf. Though I have added them, I don't know what they do and how can a file become corrupt just like that. Anyway, I'll try strace and then tell.
 
Old 09-10-2002, 06:15 AM   #4
aditya
Member
 
Registered: Aug 2002
Distribution: RH 7.x
Posts: 71

Original Poster
Rep: Reputation: 15
I ran the strace command, it gave me this. I feel it's uncomrehensible to me, but it's not really such a grave matter as it looks. There's got to be a simple way. Well, best of luck ifnyou understand this:execve("/sbin/ldconfig", ["ldconfig", "-r", "/home/aditya/boot_new/beta"], [/* 19 vars */]) = 0
fcntl64(0, F_GETFD) = 0
fcntl64(1, F_GETFD) = 0
fcntl64(2, F_GETFD) = 0
uname({sys="Linux", node="yogesh", ...}) = 0
geteuid32() = 0
getuid32() = 0
getegid32() = 0
getgid32() = 0
brk(0) = 0x80b9804
brk(0x80b9824) = 0x80b9824
brk(0x80ba000) = 0x80ba000
chroot("/home/aditya/boot_new/beta") = 0
chdir("/") = 0
stat64("/lib", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
stat64("/usr/lib", 0xbffffa50) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=18, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
read(3, "/usr/kerberos/lib\n", 4096) = 18
stat64("/usr/kerberos/lib", 0xbffffa20) = -1 ENOENT (No such file or directory)
read(3, "", 4096) = 0
close(3) = 0
munmap(0x40000000, 4096) = 0
open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 ENOTDIR (Not a directory)
open("/lib", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
brk(0x80bc000) = 0x80bc000
getdents64(0x3, 0x80b9b08, 0x1000, 0x80b8b78) = 224
lstat64("/lib/i686", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
open("/lib/libdl-2.2.5.so", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=12102, ...}) = 0
old_mmap(NULL, 12102, PROT_READ, MAP_SHARED, 4, 0) = 0x40000000
munmap(0x40000000, 12102) = 0
close(4) = 0
open("/lib/libtermcap.so.2.0.8", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=11800, ...}) = 0
old_mmap(NULL, 11800, PROT_READ, MAP_SHARED, 4, 0) = 0x40000000
munmap(0x40000000, 11800) = 0
close(4) = 0
stat64("/lib/libdl.so.2", {st_mode=S_IFREG|0644, st_size=12102, ...}) = 0
open("/lib/libdl.so.2", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=12102, ...}) = 0
old_mmap(NULL, 12102, PROT_READ, MAP_SHARED, 4, 0) = 0x40000000
munmap(0x40000000, 12102) = 0
close(4) = 0
stat64("/lib/libtermcap.so.2", {st_mode=S_IFREG|0644, st_size=11800, ...}) = 0
open("/lib/libtermcap.so.2", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=11800, ...}) = 0
old_mmap(NULL, 11800, PROT_READ, MAP_SHARED, 4, 0) = 0x40000000
munmap(0x40000000, 11800) = 0
close(4) = 0
getdents64(0x3, 0x80b9b08, 0x1000, 0x80b8b78) = 0
close(3) = 0
stat64("/lib/libtermcap.so.2", {st_mode=S_IFREG|0644, st_size=11800, ...}) = 0
stat64("/lib/libtermcap.so.2.0.8", {st_mode=S_IFREG|0644, st_size=11800, ...}) = 0
stat64("/lib/libdl.so.2", {st_mode=S_IFREG|0644, st_size=12102, ...}) = 0
stat64("/lib/libdl-2.2.5.so", {st_mode=S_IFREG|0644, st_size=12102, ...}) = 0
open("/lib/i686", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
getdents64(0x3, 0x80b9b08, 0x1000, 0x80b8b78) = 120
open("/lib/i686/libc-2.2.5.so", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1401027, ...}) = 0
old_mmap(NULL, 1401027, PROT_READ, MAP_SHARED, 4, 0) = 0x40000000
munmap(0x40000000, 1401027) = 0
close(4) = 0
stat64("/lib/i686/libc.so.6", {st_mode=S_IFREG|0644, st_size=1401027, ...}) = 0
open("/lib/i686/libc.so.6", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1401027, ...}) = 0
old_mmap(NULL, 1401027, PROT_READ, MAP_SHARED, 4, 0) = 0x40000000
munmap(0x40000000, 1401027) = 0
close(4) = 0
getdents64(0x3, 0x80b9b08, 0x1000, 0x80b8b78) = 0
close(3) = 0
stat64("/lib/i686/libc.so.6", {st_mode=S_IFREG|0644, st_size=1401027, ...}) = 0
stat64("/lib/i686/libc-2.2.5.so", {st_mode=S_IFREG|0644, st_size=1401027, ...}) = 0
unlink("/etc/ld.so.cache~") = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache~", O_WRONLY|O_CREAT|O_TRUNC|O_NOFOLLOW, 0644) = 3
write(3, "ld.so-1.7.0\0\2\0\0\0\3\0\0\0x\0\0\0\210\0\0\0\3\0\0\0"..., 40) = 40
write(3, "", 0) = 0
write(3, "glibc-ld.so.cache1.1\3\0\0\0^\0\0\0\0\0\0\0"..., 120) = 120
write(3, "libtermcap.so.2\0/lib/libtermcap."..., 94) = 94
close(3) = 0
chmod("/etc/ld.so.cache~", 0644) = 0
rename("/etc/ld.so.cache~", "/etc/ld.so.cache") = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
 
Old 09-10-2002, 07:05 AM   #5
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
The ld.so.cache gets created when you run the ldconfig file. So you wouldn't need to copy it. The ld.so.conf file tells the ldconfig file which directories to look for libraries in. By default it always checks /lib and /usr/lib so if you don't have this file present it doesn't matter. From what I can see in the strace output the ld.so.conf file contains one line which says /usr/kerberos/lib but apparantly this directory is not even present so you don't really need the file.
It also complains about /usr/lib not existing. You could try creating that directory, but that shouldn't be fatal. According to the strace output it's run all the commands properly and written the proper output to the cache file. Even the rename command completes succesfully. I compared it with a strace output on my machine and the next command after rename is exit.
I still don't see why they try to open /dev/null as a directory. But I also get that on my machine and it runs without any problems.

Do you also have troubles running other executables on there? It's probably something that is not directly related with the ldconfig command since the strace output seems to indicated that all the steps succeed successfully till it reaches the exit.
 
Old 09-12-2002, 03:54 AM   #6
aditya
Member
 
Registered: Aug 2002
Distribution: RH 7.x
Posts: 71

Original Poster
Rep: Reputation: 15
Wink Thanks

Hi,

Thanks for that nice command you gave me :strace. I might find it useful sometime in future.
For the time being, I said I was doing something foolish. Well, actually I forgot to include the library loader ld-linux.so in my library. That's what I did the last time.

I came to remember it, and within no time the ldconfig was running in good health.

Thanks anyway, and keep solving problems.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
Segmentation fault.. please help me! rpmadness Linux - Software 4 11-25-2003 06:47 PM
segmentation fault... perdesiz Linux - Software 1 08-18-2003 01:55 AM
What is segmentation fault? Tommi Linux - General 11 05-06-2003 12:34 PM
C Segmentation Fault fatman Programming 20 04-02-2003 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration