command line ... root@smurf:/home/ls/src/emc/emc2-dev/src/hal# chrt 99 ./shm_interface_test Error while shmget Semaphore value is 0 Waiting one second, then until semaphore gets released Segmenteringsfel
dmesg ... [ 3579.723705] shm_interface_t[2462]: segfault at ffffffffa76ad000 ip 0000000000400d14 sp 00007fff128c4600 error 6 in shm_interface_test[400000+2000] I tried running with gdb but didn't get anything interesting, and it's not a lot. I tried strace also arch_prctl(ARCH_SET_FS, 0x7fcf1a3d9700) = 0 mprotect(0x7fcf19b98000, 16384, PROT_READ) = 0 mprotect(0x7fcf19da8000, 4096, PROT_READ) = 0 mprotect(0x7fcf19fc0000, 4096, PROT_READ) = 0 mprotect(0x7fcf1a3f8000, 4096, PROT_READ) = 0 munmap(0x7fcf1a3dc000, 103274) = 0 set_tid_address(0x7fcf1a3d99d0) = 2483 set_robust_list(0x7fcf1a3d99e0, 0x18) = 0 futex(0x7fffd6bb89fc, FUTEX_WAKE_PRIVATE, 1) = 0 futex(0x7fffd6bb89fc, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7fcf1a3d9700) = -1 EAGAIN (Resource temporarily unavailable) rt_sigaction(SIGRTMIN, {0x7fcf19daf860, [], SA_RESTORER|SA_SIGINFO, 0x7fcf19db8f60}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0x7fcf19daf8f0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7fcf19db8f60}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 shmget(0xcafe, 88, 0666) = 2883607 shmat(2883607, 0, 0) = ? statfs("/dev/shm", {f_type=0x1021994, f_bsize=4096, f_blocks=127182, f_bfree=127181, f_bavail=127181, f_files=127182, f_ffree=127179, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 futex(0x7fcf19fc52bc, FUTEX_WAKE_PRIVATE, 2147483647) = 0 open("/dev/shm/sem.emcsem1", O_RDWR|O_NOFOLLOW) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=32, ...}) = 0 brk(0) = 0xc9f000 brk(0xcc0000) = 0xcc0000 mmap(NULL, 32, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x7fcf1a3f4000 close(3) = 0 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcf1a3f3000 write(1, "Semaphore value is 0\n", 21Semaphore value is 0 ) = 21 write(1, "Waiting one second, then until s"..., 55Waiting one second, then until semaphore gets released ) = 55 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 nanosleep({1, 0}, 0x7fffd6bb8860) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Segmenteringsfel And a small guess ... I'm running 64 bit ? ... I have not had time to look to much at the code, since I have been ill this week, but It seems to run. I have mostly been busy trying to get an USB driver running for my hardware, sorry but limited time. I do believe that shm_interface_test ran a couple of times .... Tell me if I can run any test, but at the moment I am actually more concearned about RT-Preempt EMC :-D ... which is a reason to be really happy. Have you tried the mailinglist for rt-preempt about the timing ? it's on http://osadl.org/ , or lkml.org ... I knot the hpet timers have undergone some work. / regards, Lars Segerlund. 2011/6/19 Michael Abel <michael.a...@isw.uni-stuttgart.de>: > > Hi Lars, > > I walked a bit trough the code and tried some things out. There is already > cleanup code to avoid this problem, but the cleanup works only when emc is > started as root. It seems just like a problem with permissions. I recommend > to start emc as root to avoid the problems. > > In case of problems it's also possible to remove the shm by hand with these > commands: > > ipcrm -M 0x48414c32 #(hal shm) > ipcrm -M 0x0000cafe #(shm interface) > > Can you please tell me more about the segfaulting shm_tester? I have no > problems with this program here... > Thanks! > > regards Michael > > "Lars Segerlund" <lars.segerl...@gmail.com> schrieb: >> I am seing the same thing, after running emc & your shm_tester a >> couple of times, ipcs gets some cruft, and I can not start emc again >> ... shm_tester segfaults .... >> >> Trying to investigate .... >> >> / regards Lars Segerlund >> >> 2011/6/18 Michael Abel <michael.a...@isw.uni-stuttgart.de>: >>> >>> Hello Guys, >>> >>> I probably found the problem, why you sometimes have to call halcmd as >>> root to get emc started again. But I don't have a bugfix up to now. >>> >>> It seems like the complete hal shared memory is not given back to the os >>> when emc is closed and my shm_tester is still running. For that reason > you >>> can still access the memory when emc has quit. When halcmd is started >>> from the root account, the memory is also still there, but its possible >>> to start emc again. >>> >>> This is printed after emc has quit: >>> >>> $ halcmd -V status >>> HAL: initializing component 'halcmd26165' >>> HAL: component 'halcmd26165' initialized, ID = 26165 >>> HAL locking status: >>> current lock value 0 (00) >>> HAL_LOCK_NONE - nothing is locked >>> HAL memory status >>> used/total shared memory: 48238/262000 >>> active/recycled components: 1/12 >>> active/recycled pins: 0/417 >>> active/recycled parameters: 0/65 >>> active/recycled aliases: 0/0 >>> active/recycled signals: 36/0 >>> active/recycled functions: 0/17 >>> active/recycled threads: 1/0 >>> HAL: removing component 26165 >>> HAL: component 26165 removed, name = 'halcmd26165' >>> >>> >>> One can also see that there is shared memory left with ipcs: >>> >>> ipcs -m -p | grep <old_pid_of_rtapi_app> >>> >>> Does somebody know, how the rtai version of emc is handling hal shared >>> memory? Is it still there after closing emc? >>> >>> Greetings, >>> Michael >>> >>> >>> >>> >>> > ------------------------------------------------------------------------------ >>> EditLive Enterprise is the world's most technically advanced content >>> authoring tool. Experience the power of Track Changes, Inline Image >>> Editing and ensure content is compliant with Accessibility Checking. >>> http://p.sf.net/sfu/ephox-dev2dev >>> _______________________________________________ >>> Emc-developers mailing list >>> Emc-developers@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/emc-developers >>> >> >> > ------------------------------------------------------------------------------ >> EditLive Enterprise is the world's most technically advanced content >> authoring tool. Experience the power of Track Changes, Inline Image >> Editing and ensure content is compliant with Accessibility Checking. >> http://p.sf.net/sfu/ephox-dev2dev >> _______________________________________________ >> Emc-developers mailing list >> Emc-developers@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/emc-developers >> > > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers