ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm writing a simple libc interposition library for some library calls like open(), connect(), etc. However, it didn't seem to work on php's mysql module in particular. I created a simple php script which creates a connection to a mysql database, then closes it. However, none of the connect() calls showed up in my trace log produced by my interposition library. strace does show the connect() system call took place. I also used ltrace to see if the actual libc connect() was called, but it didn't show up. So it leads to the thinking of maybe the mysql module in php is statically linked. But running 'file' on the module said differently. 'ldd' also showed that it links to libc.
Is php compiled so that it's statically linked by default? If not, what else might cause it to make system calls without calling the corresponding libc functions?
I'm writing a simple libc interposition library for some library calls like open(), connect(), etc. However, it didn't seem to work on php's mysql module in particular. I created a simple php script which creates a connection to a mysql database, then closes it. However, none of the connect() calls showed up in my trace log produced by my interposition library. strace does show the connect() system call took place. I also used ltrace to see if the actual libc connect() was called, but it didn't show up. So it leads to the thinking of maybe the mysql module in php is statically linked. But running 'file' on the module said differently. 'ldd' also showed that it links to libc.
Is php compiled so that it's statically linked by default? If not, what else might cause it to make system calls without calling the corresponding libc functions?
I'm using Fedora 11 64-bit version.
Thank you.
You told us nothing about what you did to make your library visible to the application.
I am particularly interested in your (in)actions regarding LD_LIBRARY_PATH, LD_RUN_PATH environment libraries.
You told us nothing about what you did to make your library visible to the application.
I am particularly interested in your (in)actions regarding LD_LIBRARY_PATH, LD_RUN_PATH environment libraries.
Sorry for the lack of information in the original post. I used LD_PRELOAD to load my library when starting the application.
As a side note, I used my library on mysql-query-browser and it seemed to catch all the library calls from mysql client library. This might help to narrow the problem down to PHP's mysql module or the way it links to mysql client library.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.