Unix Technical Forum

path component not found (errno = ENOENT)

This is a discussion on path component not found (errno = ENOENT) within the AIX Operating System forums, part of the Unix Operating Systems category; --> I've got this error while loading some shared libs. I search for missing symbol problem but did not find ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 07:22 AM
christophe.delarue@gmail.com
 
Posts: n/a
Default path component not found (errno = ENOENT)

I've got this error while loading some shared libs.

I search for missing symbol problem but did not find anything.
I remember that when there is a missing symbol, I got the error `` the
lib is not in exec format''.

We deliver ``instruments'' which are in fact a series of shared
libraries. They are all linked with a -blibpath=/usr/lib. When the main
application wants to load the ``instrument'' shared lib, it looks at a
specific file calld <shared-libname>.preload where each lines contains
lib to load one after the other. So the LIBPATH is not in fault.

This works fine for several instrument. One instrument is different and
requires additional libs. Our problem raises only for this one.

What does mean path component not found (errno = ENOENT) ?

BTW we have three targets plateforms, solaris, aix and NT. Solaris is
fine but neither aix nor NT works ... I did not find any missing
symbol.

Any suggestion ?

.... I got more and more confused ...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 07:22 AM
Gary R. Hook
 
Posts: n/a
Default Re: path component not found (errno = ENOENT)

christophe.delarue@gmail.com wrote:
> We deliver ``instruments'' which are in fact a series of shared
> libraries. They are all linked with a -blibpath=/usr/lib. When the main
> application wants to load the ``instrument'' shared lib, it looks at a
> specific file calld <shared-libname>.preload where each lines contains
> lib to load one after the other. So the LIBPATH is not in fault.
>
> This works fine for several instrument. One instrument is different and
> requires additional libs. Our problem raises only for this one.
>
> What does mean path component not found (errno = ENOENT) ?


It means something wasn't found.

The dependents of the lib to be loaded must be in an accessible
location. I.e. your file points to your instrument, probably
with a path, but the dependents of the instrument must also be
found. This is usually done by (a) having them in a known location
(like /usr/lib) or (b) having the parent module (your instrument)
contain path information that points to it's dependents.

So, the library search path is the issue, and you'll have to
either use well-known locations when you build this one
module, or link the dependents into /usr/lib or some other
known directory.

--
Gary R. Hook
__________________________________________________ ______________________
Vocatus atque non vocatus deus aderit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 07:22 AM
christophe.delarue@gmail.com
 
Posts: n/a
Default Re: path component not found (errno = ENOENT)

Hi,

The path is known :
let foo.a be the shared lib to be loaded, there is a foo.preload :
----------
libbar.a
libbrar2.a
---------
each lib bar is read one after the other with
((void *) dlopen( file.c_str(), RTLD_LAZY | RTLD_GLOBAL ) ) ;

The script I wrote to parse the symbols is :
-----------------------------------------
#! /usr/bin/env python

import os, commands, re, sys

from optparse import OptionParser

if __name__ == '__main__':
parser = OptionParser()
parser.add_option("-c" , "--check",
help="The librarie where undef symbols has to be
found",
type="string",
dest="check")
parser.add_option("-l" , "--libraries",
help="The librarie names where symbols can be
found",
type="string", action="append",
dest="libraries")

options, arg = parser.parse_args()

# Get the undef symbols by grepping the undef in dump
status, SYMLines=commands.getstatusoutput("dump -HTv " +
options.check + " | grep undef | grep -v libc.a | grep -v libC.a")
SYMLines = SYMLines.split('\n')
if len(SYMLines) == 1 and SYMLines[0] == "":
print "All syms are resolved", SYMLines
sys.exit(-1)
if status != 0:
print "dump failed", commands.getstatusoutput("dump -HTv " +
options.check)
sys.exit(-1)
syms = [aLine.split()[-1] for aLine in SYMLines]
print "Finding %s undef symbols from %s\n" %
(len(syms),os.path.basename(options.check))

symbols= {}
for lib in options.libraries:
symbols[lib] = []
# Check wether to use dump or nm depeding of shared lir or not
shared = commands.getoutput("/usr/bin/dump -ov " + lib + " |
head -10 | grep SHROBJ")
if shared == "":
res=commands.getoutput("nm -C " + lib)
symbols[lib] = re.findall(re.compile("^\.([A-Za-z_0-9]+)[
\t]+T+[ \t]+[0-9]+$",re.MULTILINE), res)
else:
cmd = "/usr/bin/dump -HTv " + lib
#print cmd
res= commands.getoutput(cmd)
# Defined symbols are founded on line with EXP and either
DS or RW ?
symbols[lib] = re.findall("EXP[ \t]+[DSRW]+[ \t]+\w+[
\t]+\[noIMid\][ \t]+(?P<sym>[A-Za-z0-9_]+)", res)
print "Founded symbols in %-40s : %5d"
%(os.path.basename(lib),len(symbols[lib]))
print
for sym in syms:
#print "Finding", sym,
found = None
for lib in options.libraries:
if sym in symbols[lib]:
#print "in", lib
found = 1
break
if not found:
print sym, "not founded"

-----------------------------------------

Is this enough to find missing/defined symbols ...

thank's

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 07:34 AM
christophe.delarue@gmail.com
 
Posts: n/a
Default Re: path component not found (errno = ENOENT)

.... I apologize, a dump -HTv show me some linked libraries that should
not be ...

thank's

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:51 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com