Skip to contentSkip to conversation

udev inotify problem (illegal instruction in arm)

PATCH New ing. Federico Fuga 1 participant 1 message Nov 15, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udev inotify problem (illegal instruction in arm)

Hi,

I finnally traced the problem I had with udev on an em-x270 board, that caused the udevd to crash when executed with an illegal instruction exception.

When executed, udevd crashes in udev_sysdeps.h line 116 (see the gdb dump)

Core was generated by `./udevd'.
Program terminated with signal 4, Illegal instruction. #0 0x40016cc0 in syscall () from /lib/libc.so.0 (gdb) bt
#0 0x40016cc0 in syscall () from /lib/libc.so.0 #1 0x0000a9b4 in main (argc=<value optimized out>,
argv=<value optimized out>, envp=<value optimized out>) at udev_sysdeps.h:116
(gdb)

we see in that file:

/* needed until /usr/include/sys/inotify.h is working */

#ifdef __UCLIBC__

#include <sys/inotify.h>

#else

static inline int inotify_init(void)

{

        return syscall(__NR_inotify_init);

}

static inline int inotify_add_watch(int fd, const char *name, uint32_t mask)

{

        return syscall(__NR_inotify_add_watch, fd, name, mask);

}

#endif /* __GLIBC__ */

As we can see from the comment, the call through the syscall is needed since glibc is (probably) broken on defining the inotify_init and add_watch function.

But under uclibc it seems to work, (sorry, just few test made), so I propose to change the #ifndef GLIBC to an #ifdef UCLIBC.

So the attached patch.

I will keep you informed about the tests, but at least now udevd doesn't crash anymore.

Regard,

ing. Federico Fuga

-------------- next part --------------
A non-text attachment was scrubbed...
Name: udev-inotify-uclibc.patch
Type: text/x-patch
Size: 315 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20071115/b80044f7/attachment.bin