Am 23.08.2014 um 17:21 schrieb Bas de Bruijn <
b...@basdebruijn.com>:
>
> On 23 Aug 2014, at 17:16, Bas de Bruijn <
b...@basdebruijn.com> wrote:
>
>>
>>
>> On Saturday, August 23, 2014 5:08:16 PM UTC+2, andy pugh wrote:
>> On 23 August 2014 16:02, Michael Haberler wrote:
>>
>> > Since Bas uses Xenomai user threads, modules are just shared libraries which go away as soon as rtapi_app exits.
>>
>> I wonder if that is the problem? The BSPI driver uses, for example:
>>
>> EXPORT_SYMBOL_GPL(hm2_tram_add_bspi_frame);
>>
>> To make the function available to other modules, but possibly _only_
>> to modules?
>>
>> running gdp as per Michaels suggestion got me:
>> Illegal process-id: pidof rtapi:0.
you can debug issues in RT only as long as RT is running (meaning the rtapi_app and rtapi_msgd processes, which show up in ps as rtapi:0 and msgd:0) .
If one of those already died, gdb naturally cannot attach to a dead process. However, the log should note the fact of the problem and where a core file was written.
example (I killed rtapi:0 on purpose with a segfault signal - 'kill -11 `pidof rtapi:0`' as root since RT runs with elevated privilegs):
Aug 23 17:38:31 amd64 msgd:0: rtapi_app:12894:user signal 11 - 'Segmentation fault' received, dumping core (current dir=/home/mah/machinekit)
So there is a core file which you can do post-mortem analysis with gdb on, the stacktrace should tell where the error occurred (in this case in the main loop since rtapi_app was waiting for RTAPI commands at that time; in the case of a faulty RT component it will show where the segfault occurred in the component):
sudo gdb libexec/rtapi_app_xenomai /home/mah/machinekit/core # (or wherever that core was dropped)
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<
http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/mah/machinekit/libexec/rtapi_app_xenomai...done.
warning: core file may not match specified executable file.
[New LWP 12894]
[New LWP 12895]
[New LWP 12896]
warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `rtapi:0 '.
Program terminated with signal 11, Segmentation fault.
#0 0x00007fcc7b5005c3 in *__GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:87
87 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
(gdb) backtrace
#0 0x00007fcc7b5005c3 in *__GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:87
#1 0x00007fcc7c7c8aea in zmq_poll () from /usr/lib/x86_64-linux-gnu/libzmq.so.3
#2 0x00007fcc7ca3f82c in zloop_start () from /usr/lib/x86_64-linux-gnu/libczmq.so.1
#3 0x0000000000404f78 in main () at rtapi/xenomai/rtapi_app.cc:975
(gdb) q
I'll write up a note on debugging RT issues with gdb.
meanwhile please try the 7i65 patch, and verify it stops bringing down the house - I'll add it then.
- Michael
>> (gdb) continue
>> The program is not being run.
>>
>> this made me aware of the following in the terminal output
>> emcTaskOnce: extract(task_instance): KeyError: ('task',)
>>
>> emcTaskOnce: no Python Task() instance available, using default iocontrol-based task methods
>> usrmotintf: ERROR: rtapi init failed
>> emcMotionInit: ini_hal_init fail
>> /home/machinekit/machinekit/bin/milltask (pid 4950) died on signal 11, backtrace stored in /tmp/backtrace.4950
>>
>> /tmp/backtrace.4950 holds:
>> stack trace for /home/machinekit/machinekit/bin/milltask pid=4950 signal=11
>> ptrace: Operation not permitted.
>> /home/machinekit/linuxcnc/configs/by_interface.mesa.hm2-stepper/4950: No such file or directory.
>> No thread selected
>> No stack.
>>
>
> just got a mail of a reply from PCW on the forum thread.
>
http://www.linuxcnc.org/index.php/english/forum/27-driver-boards/28259-final-stages-of-custom-firmware-for-5i20-card/50209
>
> note this recent 7I65 patch:
>
psha.org.ru/irc/%23emc-devel/2014-05-09.html#16:36:29
>
>> Bas
>>
>>
>> --
>> atp
>> If you can't fix it, you don't own it.
>>
http://www.ifixit.com/Manifesto
>
>