Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hopefully this is the right place, since there is no comp.programming.unix

2 views
Skip to first unread message

S James S Stapleton

unread,
Jul 21, 2008, 12:24:45 PM7/21/08
to
or similar list that I can find. I am trying something on FreeBSD 7.0, with
the built in GCC.

I have a library I compiled (ctypeless -> libctypeless.a libctypeless.o),
and have copied the .so and .a files over to /usr/lib

I use dlopen to open the library:
void *dlhandle = dlopen(libfile, RTLD_NOW | RTLD_GLOBAL);

with libfile as "ctypeless", "libctypeless.so", "/usr/lib/libctypeless.so"

and in all of the cases, the library will not open. dlhandle points to 0x0
dlerror() returns: "Invalid shared object handle"

Any suggestions, or is there a place I should ask other than here?

Thanks,
-Jim Stapleton


jpd

unread,
Jul 21, 2008, 12:50:56 PM7/21/08
to
Begin <g62d8e$li6$1...@charm.magnus.acs.ohio-state.edu>
On Mon, 21 Jul 2008 12:24:45 -0400,
S James S Stapleton <staple...@osu.edu> wrote:
[snip!]

There, all fixed now. Provided you can find my answer.


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.

S James S Stapleton

unread,
Jul 21, 2008, 1:10:49 PM7/21/08
to
So I didn't realize that was the name I needed to look for. No need to be
rude about it. I feel like I've been transported to one of various Linux
Forums all of a sudden...

-Jim Stapleton


Bob Eager

unread,
Jul 21, 2008, 1:48:08 PM7/21/08
to

Did you run ldconfig?

--
Bob Eager
UNIX since v6..
http://tinyurl.com/2xqr6h

Bob Eager

unread,
Jul 21, 2008, 1:48:08 PM7/21/08
to

I sometimes think jpd has escaped from there...

S James S Stapleton

unread,
Jul 21, 2008, 1:59:15 PM7/21/08
to

"Bob Eager" <rd...@spamcop.net> wrote in message
news:176uZD2KcidF-p...@rikki.tavi.co.uk...
> Did you run ldconfig?
>

Yeah, no go.

Thanks,
-Jim Stapleton


Philip Paeps

unread,
Jul 21, 2008, 5:32:53 PM7/21/08
to
Bob Eager <rd...@spamcop.net> wrote:
> On Mon, 21 Jul 2008 17:10:49 UTC, "S James S Stapleton" <staple...@osu.edu> wrote:
> > So I didn't realize that was the name I needed to look for. No need to be
> > rude about it. I feel like I've been transported to one of various Linux
> > Forums all of a sudden...
>
> I sometimes think jpd has escaped from there...

jpd can be a bit "direct" at times. I didn't see anything particularly "rude"
in this thread?

- Philip

--
Philip Paeps Please don't email any replies
phi...@paeps.cx I follow the newsgroup.

I think ... therefore I am confused.

jpd

unread,
Jul 21, 2008, 6:09:08 PM7/21/08
to
Begin <slrng8a045.10n...@carrot.paeps.cx>

On 21 Jul 2008 21:32:53 GMT, Philip Paeps <philip...@paeps.cx> wrote:
> Bob Eager <rd...@spamcop.net> wrote:
>> On Mon, 21 Jul 2008 17:10:49 UTC,
>> "S James S Stapleton" <staple...@osu.edu> wrote:
>> > So I didn't realize that was the name I needed to look for. No need
>> > to be rude about it. I feel like I've been transported to one of
>> > various Linux Forums all of a sudden...
>>
>> I sometimes think jpd has escaped from there...
>
> jpd can be a bit "direct" at times. I didn't see anything particularly
> "rude" in this thread?

Maybe I should change that. Then again, I might as well start posting in
those ``forums'', or ``lists'', or whatever they're called this week,
while at it... nah.


Bit of a pity the OP didn't get the hint, but no surprise, really.

Giorgos Keramidas

unread,
Jul 21, 2008, 6:06:28 PM7/21/08
to

Three short questions:

* Did you also try RTLD_LAZY?
* What does file(1) say about libctypeless.so?
* Can you try LD_PRELOAD-ing the library?

For example, I wrote a tiny libgets.so.1 library to test a wrapper of
gets() of my own that supports configurable options with GETS_OPTIONS,
like the standard FreeBSD malloc() support for MALLOC_OPTIONS. I don't
have to install it to test it, because preloading it works fine:

,-----------------------------------------------------------------------
|
| kobe % find .
| .
| ./libgets
| ./libgets/Makefile
| ./libgets/gets.o
| ./libgets/gets.c
| ./libgets/libgets.a
| ./libgets/gets.po
| ./libgets/libgets_p.a
| ./libgets/gets.So
| ./libgets/libgets.so
| ./libgets/libgets.so.1
| ./foo
| ./foo/foo.o
| ./foo/Makefile
| ./foo/foo.c
| ./foo/foo
|
| kobe % LD_PRELOAD=$(pwd)/libgets/libgets.so.1 ./foo/foo
| stdio: running with gets() wrapper
| What is your name?
| This program is unsafe; it uses gets()
| warning: this program uses gets(), which is unsafe.
| Giorgos
| Hi, Giorgos
|
| kobe %
|
`-----------------------------------------------------------------------

Can you try something similar with libctypeless.so.1 and see if it works
for you? Maybe there's something odd about the way it was built and the
runtime linker fails to load it.

Bob Eager

unread,
Jul 21, 2008, 6:28:08 PM7/21/08
to
On Mon, 21 Jul 2008 21:32:53 UTC, Philip Paeps <philip...@paeps.cx>
wrote:

> Bob Eager <rd...@spamcop.net> wrote:
> > On Mon, 21 Jul 2008 17:10:49 UTC, "S James S Stapleton" <staple...@osu.edu> wrote:
> > > So I didn't realize that was the name I needed to look for. No need to be
> > > rude about it. I feel like I've been transported to one of various Linux
> > > Forums all of a sudden...
> >
> > I sometimes think jpd has escaped from there...
>
> jpd can be a bit "direct" at times. I didn't see anything particularly "rude"
> in this thread?

I did say "sometimes". The rudeness, such as it was, was in the title,
which was a comment on the original, different, thread.

The Linux people are worse, mind.

Jason Bourne

unread,
Jul 21, 2008, 8:28:06 PM7/21/08
to
jpd wrote:

[snip]


>
> Maybe I should change that. Then again, I might as well start posting in
> those ``forums'', or ``lists'', or whatever they're called this week,
> while at it... nah.
>

Haven't you heard? Google Groups are teh so 31337! Everyone on Usenet should
be using teh Google Groups!

</sarcasm>

[snip]

-Jason

S James S Stapleton

unread,
Jul 22, 2008, 8:41:21 AM7/22/08
to
> Bit of a pity the OP didn't get the hint, but no surprise, really.

The hint that the group I should go to is in the title? Got that, and even
posted there long before this reply of mine. Maybe the hint was you would
rather I not post here at all? If that's the case, it's not a matter of not
getting the hint.

Anyway, the rudeness was in the title. I didn't misspell anything - that
suggest I didn't intend to post on this group in the first place. Then
suggeting that the title of the thread was potentially something I couldn't
find... That was also rather rude.


-Jim Stapleton


S James S Stapleton

unread,
Jul 22, 2008, 9:11:00 AM7/22/08
to
> * Did you also try RTLD_LAZY?

Just did, no success

> * What does file(1) say about libctypeless.so?

[sjss@aragorn ~]$ file /usr/lib/libctypeless.so
/usr/lib/libctypeless.so: ELF 32-bit LSB shared object, Intel 80386, version
1 (FreeBSD), dynamically linked, not stripped

> * Can you try LD_PRELOAD-ing the library?

Ahh, there's something. I'm getting an 'Undefined symbol' error. The symbol
is defined as a 'extern unsigned short' in the header file, and 'unsigned
short' in the main C file for the library.

I'll look into this some more, thanks.

-Jim Stapleton


jpd

unread,
Jul 22, 2008, 10:58:07 AM7/22/08
to
On Tue, 22 Jul 2008 08:41:21 -0400,

S James S Stapleton <staple...@osu.edu> wrote:
[attribution of quote missing]

>> Bit of a pity the OP didn't get the hint, but no surprise, really.
>
> The hint that the group I should go to is in the title? Got that, [...]

You didn't, apparently, figure out why I put it there, instead of
somewhere usually regarded as more convenient.


> Anyway, the rudeness was in the title. [...]

Seeing how you make rather a mess of the accepted ``polite format''
of usenet messages -- I so far haven't seen a post by you that didn't
fell short in some interesting way -- I like how you complain on the
judgement you yourself passed on my followup.

Why do you complain about a question answered the Subject: line when
put there and not in the message body?

S James S Stapleton

unread,
Jul 22, 2008, 11:40:24 AM7/22/08
to
> You didn't, apparently, figure out why I put it there, instead of
> somewhere usually regarded as more convenient.

Putting it in a place that I can read without even opening the post...
There's a place more convinient?

> I so far haven't seen a post by you that didn't
> fell short in some interesting way

My first post wasn't impolite. It was maybe ignorant on where exactly to
look, I thought I was fairly appologetic about potentially being in the
wrong place, but given I'm doing this on a FreeBSD system, it was at least a
semi-decent place. It's not like I was posting it on comp.os.windows or
something.

My replies to the people that helped me, as far as I can tell, were polite.

My replies to you were not. I'll accept that, one of my failings, I admit,
is that I tend to lash back at people who are rude to me. I appologize, for
it, even if my responses are not unreasonable.

> Why do you complain about a question answered the Subject: line when
> put there and not in the message body?

I didn't. Look back, I complained about the 'you misspelled' portion, and
the fact that you insinuated that I wouldn't be able to find it there (and
it was the first thing I noticed). The rest of the complaint was how you
handled it in the body of the text.

And I'll bite, what was your hint putting it in the subject line?

-Jim Stapleton

jpd

unread,
Jul 24, 2008, 2:50:13 PM7/24/08
to
On Tue, 22 Jul 2008 11:40:24 -0400,

S James S Stapleton <staple...@osu.edu> wrote:
[snip!]

> I didn't. Look back, I complained about the 'you misspelled' portion,

Which you did. You assumed a group with a certain function did not exist
because you couldn't find it by the name you tried, but it does exist
with a slightly different name. A misspelling.


> and the fact that you insinuated that I wouldn't be able to find
> it there (and it was the first thing I noticed). The rest of the
> complaint was how you handled it in the body of the text.
>
> And I'll bite, what was your hint putting it in the subject line?

You'll bite? After you ``apologized'' while explaining you're not
meaning it because you're convinced you know better? Well, since we're
being civilised and all, I'm sure you can find the correct alternatives,
once you stop deciding the rest of the universe must be at fault and
therefore rude. A mere reading of RFC1855 could go a long way, really.

S James S Stapleton

unread,
Jul 24, 2008, 3:35:48 PM7/24/08
to
Please, calm down. You are reading way to much into everything I've said
while being condescending about it. That isn't necessary. I never said the
correct group didn't exist, I merely said I couldn't find it, and if this
wasn't the right place, could someoen please direct me. I never even said I
didn't make any mistakes - I sure as hell did. However, I DID NOT make the
mistakes you assumed I made. My mistakes were due to missing cognitive
associations, and therefore not knowing where to look, and a short temper
with people who are condescending.

Being condescending doesn't help anyone, unless you want them to quit - that
doesn't help the community at all. Regardless, I'll look at that RFC, and
thanks for the info.

-Jim Stapleton


S James S Stapleton

unread,
Jul 24, 2008, 3:40:53 PM7/24/08
to
> My mistakes were due to missing cognitive associations, and therefore not
> knowing where to look, and a short temper with people who are
> condescending.

Oh, and I expressed myself poorly, I said 'there is no...' and named a
specific group name (which doesn't exist), as what I thought was a
straightforward example of a group I was looking for. I'll admit I rather
screwed up on that one. But I would never had considered looking for
'programmer' - that strikes me as a job-hiring list name rather than a help
list, the cognitive association issue I mentioned.


JYA

unread,
Jul 25, 2008, 5:05:22 AM7/25/08
to
Hi

On 2008-07-25 05:35:48 +1000, "S James S Stapleton"

<staple...@osu.edu> said:
>
> Being condescending doesn't help anyone, unless you want them to quit - that
> doesn't help the community at all. Regardless, I'll look at that RFC, and
> thanks for the info.

Most of the time I find jpd extremely rude, and worse totally
non-constructive just throwing is $0.02 here and there.

I'd just ignore him...
It's very rare for him to provide a valuable answer. Usually, his
answers can usually be summarised with
"you idiot this is a stupid question, why are you trying to do is dumb
and you shouldn't". Leaving short of explaining what actually would be
a better way.

Back to your question:
dlopen takes the full path of the dll file ...
like dlopen("/usr/local/lib/libmylib.so" ...

Make sure you have the permissions to access the library.

Are you sure it's dlopen generating that error?
it sounds more like you're calling a function with an invalid handler.
Like you call dlopen which returns null and then you call dlclose with null.

Or something like that.

Jean-Yves

--
They who would give up an essential liberty for temporary security,
deserve neither liberty or security (Benjamin Franklin)

Conrad J. Sabatier

unread,
Aug 9, 2008, 9:29:38 PM8/9/08
to
On Mon, 21 Jul 2008 16:50:56 +0000, jpd wrote:
>
> There, all fixed now. Provided you can find my answer.

Actually, um...you misspelled "misspelled". :-)

--
At present there is not a single credible established religion in the
world.
-- George Bernard Shaw, Irish-born English playwright

0 new messages