[sheepdog] GLIBC issue
Bruno Silva
bruno.ufpe at gmail.com
Mon Nov 12 17:45:46 CET 2012
correction.
"I’ve substituted the three functions for wrappers that call directly the
system call. "
2012/11/12 Bruno Silva <bruno.ufpe at gmail.com>
> Morita,
>
> First of all, thanks a lot for your answer.
>
> Actually, I have tried your suggestion, but without success. Apparently,
> there is another function that belongs to the newer GLIBC and is not part
> of the older one.
> “Glibc 2.7 doesn't contain timerfd, signalfd, and eventfd”. I’ve
> substituted the three wrapper functions that call directly the system call.
> For instance,
>
> #include <sys/syscall.h>
> #include <unistd.h>
> #include <fcntl.h>
> #include <stdint.h>
>
> #ifndef __NR_eventfd2
> #if defined(__x86_64__)
> #define __NR_eventfd2 290
> #elif defined(__i386__)
> #define __NR_eventfd2 328
> #else
> #error "Can't define __NR_eventfd2 for your architecture."
> #endif
> #endif
>
>
> typedef uint64_t eventfd_t;
>
> #define EFD_SEMAPHORE 1
> #define EFD_CLOEXEC 02000000
> #define EFD_NONBLOCK 04000
>
> int eventfd(unsigned int, int);
> int eventfd_read(int, eventfd_t *);
> int eventfd_write(int, eventfd_t);
>
> inline int eventfd_read(int fd, eventfd_t *value)
> {
> return (sizeof(*value) == read(fd, value, sizeof(*value))) ? 0 : -1;
> }
>
> inline int eventfd(unsigned int initval, int flags)
> {
> return syscall(__NR_eventfd2, initval, flags);
> }
>
> inline int eventfd_write(int fd, eventfd_t value)
> {
> return (sizeof(value) == write(fd, &value, sizeof(value))) ? 0 : -1;
> }
>
> The code just works on local machine. It doesn’t work on the older GLIBC
> machine and for some reason the GLIBC dependency remains. I put this mark
> <<<<<<<<< GLIBC DEPENDENCY >>>>>>>>> to show the dependecy.
>
> #ldd –v sheep
>
> root at ubuntu:/opt/apps/corosync/sbin# ldd -v sheep
> linux-gate.so.1 => (0xb777c000)
> libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb774d000)
> libcpg.so.4 => /usr/lib/libcpg.so.4 (0xb7745000)
> libcfg.so.4 => /usr/lib/libcfg.so.4 (0xb773d000)
> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7593000)
> /lib/ld-linux.so.2 (0xb777d000)
> libcoroipcc.so.4 => /usr/lib/libcoroipcc.so.4 (0xb758c000)
>
> Version information:
> ./sheep:
> libcfg.so.4 (COROSYNC_CFG_0.82) => /usr/lib/libcfg.so.4
> libcpg.so.4 (COROSYNC_CPG_1.0) => /usr/lib/libcpg.so.4
> libpthread.so.0 (GLIBC_2.1) => /lib/i386-linux-gnu/libpthread.so.0
> libpthread.so.0 (GLIBC_2.2) => /lib/i386-linux-gnu/libpthread.so.0
> libpthread.so.0 (GLIBC_2.3.2) =>
> /lib/i386-linux-gnu/libpthread.so.0
> libpthread.so.0 (GLIBC_2.0) => /lib/i386-linux-gnu/libpthread.so.0
> libc.so.6 (GLIBC_2.3) => /lib/i386-linux-gnu/libc.so.6
>
> <<<<<<<<< GLIBC DEPENDENCY >>>>>>>>>
> libc.so.6 (GLIBC_2.10) => /lib/i386-linux-gnu/libc.so.6
> <<<<<<<<< GLIBC DEPENDENCY >>>>>>>>>
>
> libc.so.6 (GLIBC_2.2) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.3.2) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.7) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.1) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.4) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.3.4) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libc.so.6
> /lib/i386-linux-gnu/libpthread.so.0:
> ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
> ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
> ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
> libc.so.6 (GLIBC_2.3.2) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.1.3) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.1) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_PRIVATE) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.2) => /lib/i386-linux-gnu/libc.so.6
> /usr/lib/libcpg.so.4:
> libc.so.6 (GLIBC_2.3.4) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.1.3) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.4) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libc.so.6
> libcoroipcc.so.4 (COROSYNC_COROIPCC_3.0) =>
> /usr/lib/libcoroipcc.so.4
> libpthread.so.0 (GLIBC_2.0) => /lib/i386-linux-gnu/libpthread.so.0
> /usr/lib/libcfg.so.4:
> libc.so.6 (GLIBC_2.3.4) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.1.3) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.4) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libc.so.6
> libcoroipcc.so.4 (COROSYNC_COROIPCC_3.0) =>
> /usr/lib/libcoroipcc.so.4
> libpthread.so.0 (GLIBC_2.0) => /lib/i386-linux-gnu/libpthread.so.0
> /lib/i386-linux-gnu/libc.so.6:
> ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
> ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
> ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
> /usr/lib/libcoroipcc.so.4:
> libc.so.6 (GLIBC_2.1.3) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.4) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libc.so.6
> libc.so.6 (GLIBC_2.3.4) => /lib/i386-linux-gnu/libc.so.6
> libpthread.so.0 (GLIBC_2.2) => /lib/i386-linux-gnu/libpthread.so.0
> libpthread.so.0 (GLIBC_2.1) => /lib/i386-linux-gnu/libpthread.so.0
> libpthread.so.0 (GLIBC_2.0) => /lib/i386-linux-gnu/libpthread.so.0
>
>
>
>
> 2012/10/22 Gustavo Callou <grac at cin.ufpe.br>
>
>> Outro caminho... p rodar o sheepdog
>> ---------- Forwarded message ----------
>> From: "MORITA Kazutaka" <morita.kazutaka at lab.ntt.co.jp>
>> Date: Oct 21, 2012 10:56 PM
>> Subject: Re: [sheepdog] GLIBC issue
>> To: "Gustavo Callou" <grac at cin.ufpe.br>
>> Cc: <sheepdog at lists.wpkg.org>
>>
>> At Fri, 19 Oct 2012 14:44:00 -0300,
>>
>> Gustavo Callou wrote:
>> >
>> > Dear Sheepdog Development Team,
>> >
>> > I’ve been conducting experiments with Sheepdog. I have already tested
>> it
>> > with Ubuntu 12.04 machines and the Sheepdog worked well. I would like to
>> > conduct other experiments using a specific environment that uses GLIBC
>> 2.7.
>> > I know that Sheepdog requires the version 2.9 or later of the GLIBC.
>> > However, in this particular case, I’m not able to update the version of
>> the
>> > GLIBC. I was wondering if you could provide me some suggestions to deal
>> > with such issue. Thanks a lot in advance.
>>
>> Glibc 2.7 doesn't contain timerfd, signalfd, and eventfd. If your
>> kernel supports them, I think you can use Sheepdog by defining all
>> relevant functions and structures, for example, as follows.
>>
>> #define __NR_signalfd 282
>>
>> int signalfd(int fd, const sigset_t *mask, int flags)
>> {
>> return syscall(__NR_signalfd, fd, mask, flags);
>> }
>>
>>
>> Thanks,
>>
>> Kazutaka
>>
>
>
>
> --
> Bruno Silva
> Engenheiro da Computação.
>
--
Bruno Silva
Engenheiro da Computação.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20121112/26c24d69/attachment-0003.html>
More information about the sheepdog
mailing list