Open shared object with native client

31 views
Skip to first unread message

David Rönn Jansson

unread,
Oct 27, 2016, 4:30:20 AM10/27/16
to Native-Client-Discuss

In my nexe, that I've created with the Native Client SDK, I'm trying to load a shared object using dlopen(). When I try that I receive the error: libxxxx.so.1.6: failed to load code from shared object: Invalid argument


When I search for information about the error I don't find much, but some answers indicate that it's not loaded because it doesn't validate in Native clients check. (see further down about validation) Also, I thought I just should mention: I can see in the access log of the webserver that it's fetching the file, "GET /glibc/Release/lib64/libxxxx.so.1.6 HTTP/1.1" 200


If I try to validate libtts_engine.so I receive the following output: $ nacl_sdk/pepper_49/tools/ncval libxxxx.so.1.6

1b4844: Text segment size (0x1b4844) is not multiple of bundle size. Invalid.

I believe this is a bad sign. Have I misunderstood something if I say that this means that the libxxxx.so.1.6 file doesn't pass the validation of native client?


If I run the same code, except that I'm trying to load the file "libeightball_x86_64.so" that is compiled from /nacl_sdk/example/tutorial/dlopen it loads and runs without problem.


When I did the test above, I have added libxxxx.so.1.6 and all of the libraries used by libxxxx.so.1.6 in the manifest file (.nmf) of the project.


Have any of you had problems linking precompiled, third-party libraries together with your Native client applications?

Bennet Yee (余仕斌)

unread,
Oct 27, 2016, 1:33:46 PM10/27/16
to Native Client Discuss
if the precompiled, third-party libraries were not compiled with the native client compilers or some other modified compilers to ensure that the generated code will satisfy the native client validation rules, then the dlopen will fail.  everybody should have problems with such libraries.  the reason is simple: if dlopen allows injecting code that do not follow the native client rules, then this would be a trivial sandbox bypass.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.
To post to this group, send email to native-client-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.



--
bennet s yee
i usually don't capitalize due to mild tendonitis
Reply all
Reply to author
Forward
0 new messages