{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/rocksdb/issues/606","labels_url":"https://api.github.com/repos/facebook/rocksdb/issues/606/labels{/name}","comments_url":"https://api.github.com/repos/facebook/rocksdb/issues/606/comments","events_url":"https://api.github.com/repos/facebook/rocksdb/issues/606/events","html_url":"https://github.com/facebook/rocksdb/issues/606","id":76549594,"number":606,"title":"undefined symbol: clock_gettime","user":{"login":"pshareghi","id":7822007,"avatar_url":"https://avatars.githubusercontent.com/u/7822007?v=3","gravatar_id":"","url":"https://api.github.com/users/pshareghi","html_url":"https://github.com/pshareghi","followers_url":"https://api.github.com/users/pshareghi/followers","following_url":"https://api.github.com/users/pshareghi/following{/other_user}","gists_url":"https://api.github.com/users/pshareghi/gists{/gist_id}","starred_url":"https://api.github.com/users/pshareghi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pshareghi/subscriptions","organizations_url":"https://api.github.com/users/pshareghi/orgs","repos_url":"https://api.github.com/users/pshareghi/repos","events_url":"https://api.github.com/users/pshareghi/events{/privacy}","received_events_url":"https://api.github.com/users/pshareghi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":91,"created_at":"2015-05-15T01:29:15Z","updated_at":"2015-10-10T22:38:26Z","closed_at":null,"body":"Using\r\n Centos 6\r\n GCC 4.9 using devtools-3\r\n Java 7\r\n Kernel 2.6.32-504.12.2.el6.x86_64\r\n\r\nI am getting the following error after running a test for a while.\r\n/usr/java/latest/bin/java: symbol lookup error: /tmp/librocksdbjni2974434001434564758..so: undefined symbol: clock_gettime\r\n\r\nThe same test runs fine on RocksDb 3.6. My investigation shows that librt.so is not linked with RocksDb correctly. My test (with 3.10.2) worked correctly after I ran\r\nexport LD_PRELOAD=/lib64/rtkaio/librt.so.1\r\n\r\nTo investigate the 3.10.2 library, I ran nm\r\n$nm /tmp/librocksdbjni2974434001434564758..so | grep clock\r\n0000000000332260 T _ZNSt6chrono3_V212steady_clock3nowEv\r\n000000000037e33c R _ZNSt6chrono3_V212steady_clock9is_steadyE\r\n0000000000332230 T _ZNSt6chrono3_V212system_clock3nowEv\r\n000000000037e33d R _ZNSt6chrono3_V212system_clock9is_steadyE\r\n                 U clock_gettime\r\n\r\nI ran nm on the older rocksdb-3.6\r\nnm /tmp/librocksdbjni1323312933457066341..so |grep clock\r\n0000000000287390 T _ZNSt6chrono3_V212steady_clock3nowEv\r\n00000000002c783c R _ZNSt6chrono3_V212steady_clock9is_steadyE\r\n0000000000287360 T _ZNSt6chrono3_V212system_clock3nowEv\r\n00000000002c783d R _ZNSt6chrono3_V212system_clock9is_steadyE\r\n\r\nYou can see that clock_gettime is undefined in 3.10.2 highlighted in the result of first nm command. Looking at the code, the single call to this function is only included in the C++ code if OS_LINUX or OS_FREEBSD is defined.\r\n\r\nJudging from the above nm results, do you think, in 3.6, none of the two flags above were set, where as in 3.10, somehow at least one gets set?"},"comment":{"url":"https://api.github.com/repos/facebook/rocksdb/issues/comments/147131103","html_url":"https://github.com/facebook/rocksdb/issues/606#issuecomment-147131103","issue_url":"https://api.github.com/repos/facebook/rocksdb/issues/606","id":147131103,"user":{"login":"yhchiang","id":6447975,"avatar_url":"https://avatars.githubusercontent.com/u/6447975?v=3","gravatar_id":"","url":"https://api.github.com/users/yhchiang","html_url":"https://github.com/yhchiang","followers_url":"https://api.github.com/users/yhchiang/followers","following_url":"https://api.github.com/users/yhchiang/following{/other_user}","gists_url":"https://api.github.com/users/yhchiang/gists{/gist_id}","starred_url":"https://api.github.com/users/yhchiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhchiang/subscriptions","organizations_url":"https://api.github.com/users/yhchiang/orgs","repos_url":"https://api.github.com/users/yhchiang/repos","events_url":"https://api.github.com/users/yhchiang/events{/privacy}","received_events_url":"https://api.github.com/users/yhchiang/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T22:38:26Z","updated_at":"2015-10-10T22:38:26Z","body":"Thanks @jwlent55 and @dmittendorf, I will cherry-pick the change and build again."}}