Hello again, I did what you said, changed the open/close to non real time, removed every portion of code that is not related with the fault (the read_rt is still there since is where the problem arrises and also another ioctl to start timer since the open/close are moved out of real time context). There is also the wait ioctl to show that the code works when wait is done inside ioctl. The problem persists, but no hangs perceived. Just the application returns too fast and there is the kernel message on NULL pointer derreference, so I also tried to recompile with another kernel version, the vanilla 2.6.38-8 from kernel.org and the adeos patch (on the previous tests I was using the same with additional ubuntu patches). Even now the app returns imediately after call read with rtdm_event_wait and there is the same kernel log. I dont think there is any memory corruption due to the module code since there is no dynamic allocations, little pointer operations mainly related to the context hadler witch is allocated by xenomai on rtdm_dev_register. I send you the new tarball.
Thanks for your support. -- Carlos Novaes. Em qui 11 ago 2011, às 12:00:16, Gilles Chanteperdrix escreveu: > On 08/11/2011 04:31 PM, Carlos Eduardo de Brito Novaes wrote: > > Here it comes. > > I found out that if wait is called inside an IOCTL, there is no hangs at > > all, everything work as expected, except from te fact that it seens a > > litle bit strange (to me) to use ioctl to read or write, I would expect > > to use the correspondent rad and write functions and ioctl to setup > > something. I tried to reduce the code, in the tarball there are one > > Makefile, one c file for the module and one c file for the app. There is > > one define line on the module file, comment it ou to get the hangs. The > > app will simply open the device, issue an wait ioctl (dummy if the > > module is compiled to wait in read_rt) and the do the actual reading (it > > hangs on my system if i tell the module to wait on the read_rt > > function). > > > > Here comes the kernel log from one run that does the error but > > fortunately does not hang the entire system. > > Yes, you can use rtdm_event_wait in read or write. The fact that it > hangs or results in bugs is probably due to the fact that you are > corrupting some memory. Your testcase contains too much code. If you > want to test rtdm_event_wait / rtdm_event_pulse, simply do one driver, > with one ioctl which does the rtdm_event_wait, and the timer which does > the rtdm_event_pulse. > > The copy_to_user in the read callback overflows the source area, but > that is not your problem. > > Also, do not use open_rt and close_rt in new code as they are deprecated.
testcase_wait_hang.tar.bz2
Description: application/bzip-compressed-tar
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
