That said, a /usr/local installation is generally problematic. You need to provide usable values for many files and directories which usually does not exist.
Of course, this is not to say that mode2 should segfault. If you look into the CONTRIBUTE.md document you will find instructions how to generate a stacktrace. If you could provide that, it should be possible to fix this.
Also in CONTRIBUTE.md you will find instructions how to run things straight off the build tree. That could be a starter for you, a basic work-around.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
staticstructdriver*visit_plugin(constchar*path,drv_guest_funcfunc,void*arg)// Apply func(hw, arg) for all drivers found in plugin on path.{structdriver**drivers;structdriver*result=(structdriver*)NULL;(void)dlerror();if(last_plugin!=NULL)dlclose(last_plugin);last_plugin=dlopen(path,RTLD_NOW);
it hangs in dlopen, path appears correct "/usr/lib/lirc/plugins/usbx.so" (the first found).
martin@Ace:lirc-git$ file /usr/lib/lirc/plugins/usbx.so
/usr/lib/lirc/plugins/usbx.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x9705611c85f35cede2ad5960a13920a6ceb0551c, not stripped
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
since device == NULL there. This happens if and only if no -d (--device) argument is given. So a simple work around is to always use a device argument.
device is a file-local ("static") variable, which probably was set in a previous version.
One problem with this patch is that the driver will not see the difference between a explicit device set by user and misssing --device option.
I think the proper fix is to patch default_open in driver.c. This is common code for both lircd and mode2, and gives the driver the opportunity to override the behaviour using it's own open() implementation. I have such a patch under way.
Sorry Alec, the programming style in
the main routines is not at all easy to follow, at least not for me :-).
Just the main routines? ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is strace http://pastebin.com/wsAaq83T
I can't reproduce this.
That said, a /usr/local installation is generally problematic. You need to provide usable values for many files and directories which usually does not exist.
Of course, this is not to say that mode2 should segfault. If you look into the CONTRIBUTE.md document you will find instructions how to generate a stacktrace. If you could provide that, it should be possible to fix this.
Also in CONTRIBUTE.md you will find instructions how to run things straight off the build tree. That could be a starter for you, a basic work-around.
Ok, I'll try to investigate (need some time)
Last edit: metsys 2014-12-12
I've just been looking at what appears to be the same problem with the latest from git
b0b70d8ee25261f717d17f0dce165855fef6bfd8
martin@Ace:tools$ uname -a
Linux Ace 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2+deb7u2 x86_64 GNU/Linux
martin@Ace:tools$ cat /etc/issue
Debian GNU/Linux 7
martin@Ace:tools$ /usr/bin/mode2 -Hudp
Segmentation fault
martin@Ace:tools$ ./mode2 --plugindir=../plugins/.libs -Hudp
Segmentation fault
With the debugger I get as far as:
it hangs in dlopen, path appears correct "/usr/lib/lirc/plugins/usbx.so" (the first found).
martin@Ace:lirc-git$ file /usr/lib/lirc/plugins/usbx.so
/usr/lib/lirc/plugins/usbx.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x9705611c85f35cede2ad5960a13920a6ceb0551c, not stripped
The program crashes in line 166:
since device == NULL there. This happens if and only if no -d (--device) argument is given. So a simple work around is to always use a device argument.
device is a file-local ("static") variable, which probably was set in a previous version.
Possible fix:
(This fix is not at all clean. Sorry Alec, the programming style in the main routines is not at all easy to follow, at least not for me :-).)
One problem with this patch is that the driver will not see the difference between a explicit device set by user and misssing --device option.
I think the proper fix is to patch default_open in driver.c. This is common code for both lircd and mode2, and gives the driver the opportunity to override the behaviour using it's own open() implementation. I have such a patch under way.
Just the main routines? ;)
This was fixed by the [tickets:#90] fix [81b7b2].
Related
Tickets:
#90Commit: [81b7b2]