开发者

Linux futex 5.4 OS Kernel version 2.6.9 giving issues

We have migrated a C++ RHEL 5.4 app from RH 6.2 and found that application has broken. One of our investigations lead to findings that the code in 5.4 box refers 'futex'. Note out app is compiled using 32 bit compiler option -

grep futex tool_strace.txt

futex(0xff8ea454, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0xf6d1f4fc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0xf6c10a4c, FUTEX_WAKE_PRIVATE, 2147483647) = 0

As per http://www.akkadia.org/drepper/assumekernel.html I added the code on 5.4 build -

setenv("LD_ASSUME_KERNEL" , "2开发者_JAVA百科.4.1" , 1); // to use Linux Threads 

But the strace dump still shows me 'futex' being called.

All the addresses ff8ea454, f6d1f4fc and f6c10a4c are 32 bit addresses. So if my assumption is right how can I code that 'futex' calls can be suppressed or be not called at all.

Is there any known issue with futex calls?


I believe the following to be true:

  1. LD_ASSUME_KERNEL has to be set before your program starts to have any effect.
  2. futex is used to implement any type of locks, so you can't avoid it.
  3. You shouldn't need LD_ASSUME_KERNEL when you are compiling your own code, as it should use newer interfaces as appropriate.
  4. 2.4.1 is an ancient kernel version to be trying to work as. Given your mentioning of 32 bit compiles, suggests you are on an AMD64 architecture machine, and that may not even support libraries for going back that far.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜