Hi Seb,

Am 19.01.2014 um 16:42 schrieb Sebastian Kuzminsky <[email protected]>:

> I'm trying to get ubc ready to merge, and i'm running into a problem
> that i'd like help debugging.
> 
> I have a machine (Precise, x86, with memleak's RTAI kernel) that runs
> the ubc branch fine when configured for rip, but throws errors when
> installed from the debian packages i've made (with the seb/ubc3-deb branch).
> 
> Here's the output for the RTAI flavor:
> 
>> 0 09:33:47 seb@precise-rtai-x86 /home/seb> which linuxcnc
>> /usr/bin/linuxcnc
>> 0 09:33:48 seb@precise-rtai-x86 /home/seb> dpkg -s linuxcnc | grep Version
>> Version: 1:2.6.0~pre~seb.ubc3.deb~8579fcd
>> 0 09:33:51 seb@precise-rtai-x86 /home/seb> DEBUG=5 linuxcnc -l
>> LINUXCNC - 2.6.0~pre~seb-ubc3-deb~8579fcd
>> Machine configuration directory is '/home/seb/linuxcnc/configs/sim.axis'
>> Machine configuration file is 'axis.ini'
>> Starting LinuxCNC...
>> io started
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded

This particular error happens if a HAL userland application (io in that case) 
fails to init the thread-dependent userland side of RTAPI. That code is in the 
ulapi-<flavor>.so shared object; in the RIP builds those files are in lib/:

./lib/ulapi-xenomai.so
./lib/ulapi-rtai-kernel.so
./lib/ulapi-xenomai-kernel.so
./lib/ulapi-posix.so

it is loaded in rtapi/ulapi_autoload.c with dlopen(), hence dlopen path 
resolution applies

Assuming the .so's are built, it comes down to where they are installed 
(/usr/lib/linuxcnc?) and tell ldconfig about it (maybe a linuxcnc entry in 
/etc/ld.conf.d)

- Michael







>> halcmd loadusr io started
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> Shutting down and cleaning up LinuxCNC...
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> realtime unload: notice: attempting to unload shmdrv
>> Cleanup done
>> LinuxCNC terminated with an error.  You can find more information in the log:
>>    /home/seb/linuxcnc_debug.txt
>> and 
>>    /home/seb/linuxcnc_print.txt
>> as well as in the output of the shell command 'dmesg' and in the terminal
>> 255 09:33:58 seb@precise-rtai-x86 /home/seb> 
> 
> And the relevant bit from the log:
> 
>> Jan 19 09:33:54 precise-rtai-x86 msgd:0: startup instance=inst0 pid=31317 
>> flavor=rtai-kernel rtlevel=5 usrlevel=5 halsize=512000 shm=shmdrv gcc=4.6.3 
>> git=unknown
>> Jan 19 09:33:54 precise-rtai-x86 kernel: I-pipe: head domain RTAI registered.
>> Jan 19 09:33:54 precise-rtai-x86 kernel: RTAI[hal]: compiled with gcc 
>> version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) .
>> Jan 19 09:33:54 precise-rtai-x86 kernel: RTAI[hal]: mounted 
>> (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
>> Jan 19 09:33:54 precise-rtai-x86 kernel: SYSINFO: CPUs 2, LINUX APIC IRQ 
>> 2312, TIM_FREQ 62514702, CLK_FREQ 2095130000, CPU_FREQ 2095130000
>> Jan 19 09:33:54 precise-rtai-x86 kernel: RTAI_APIC_TIMER_IPI: RTAI DEFINED 
>> 2314, VECTOR 2314; LINUX_APIC_TIMER_IPI: RTAI DEFINED 2312, VECTOR 2312
>> Jan 19 09:33:54 precise-rtai-x86 kernel: TIMER NAME: lapic; VARIOUSLY FOUND 
>> APIC FREQs: 62514702, 62514702, 59840000
>> Jan 19 09:33:54 precise-rtai-x86 kernel: RTAI[malloc]: global heap size = 
>> 131072 bytes, <BSD>.
>> Jan 19 09:33:54 precise-rtai-x86 kernel: , <uses LINUX SYSCALLs>, kstacks 
>> pool size = 524288 bytes.
>> Jan 19 09:33:54 precise-rtai-x86 kernel: RTAI[sched]: hard timer type/freq = 
>> APIC/62514702(Hz); default timing: periodic; linear timed lists.
>> Jan 19 09:33:54 precise-rtai-x86 kernel: RTAI[sched]: Linux timer freq = 
>> 1000 (Hz), TimeBase freq = 2095130000 hz.
>> Jan 19 09:33:54 precise-rtai-x86 kernel: RTAI[sched]: timer setup = 999 ns, 
>> resched latency = 2943 ns.
>> Jan 19 09:33:54 precise-rtai-x86 kernel: ***** WARNING: GLOBAL HEAP NEITHER 
>> SHARABLE NOR USABLE FROM USER SPACE (use the vmalloc option for RTAI malloc) 
>> *****
>> Jan 19 09:33:54 precise-rtai-x86 kernel: RTAI[math]: loaded.
>> Jan 19 09:33:54 precise-rtai-x86 msgd:0: :0:kernel RTAPI:0 rtai-kernel 
>> unknown init
>> Jan 19 09:33:54 precise-rtai-x86 msgd:0: rt:0:kernel RTAPI:0 Init complete
>> Jan 19 09:33:55 precise-rtai-x86 msgd:0: rt:0:kernel HAL_LIB:0 loading RT 
>> support gd=fa7f8000
>> Jan 19 09:33:55 precise-rtai-x86 msgd:0: rt:0:kernel RTAPI:0 initing module 
>> HAL_LIB
>> Jan 19 09:33:55 precise-rtai-x86 msgd:0: rt:0:kernel RTAPI:0 module 
>> 'HAL_LIB' loaded, ID: 1
>> Jan 19 09:33:55 precise-rtai-x86 msgd:0: rt:0:kernel RTAPI: using new shmem 1
>> Jan 19 09:33:55 precise-rtai-x86 msgd:0: rt:0:kernel RTAPI: shmem 01 created 
>> by module 01, key: 4279346, size: 512000
>> Jan 19 09:33:55 precise-rtai-x86 msgd:0: rt:0:kernel HAL_LIB:0 kernel lib 
>> installed successfully
>> Jan 19 09:33:57 precise-rtai-x86 msgd:0: msgd:0: SIGTERM - shutting down
>> Jan 19 09:33:57 precise-rtai-x86 msgd:0: normal shutdown - global segment 
>> detached
>> Jan 19 09:33:58 precise-rtai-x86 kernel: RTAI[math]: unloaded.
>> Jan 19 09:33:58 precise-rtai-x86 kernel: RTAI[malloc]: unloaded.
>> Jan 19 09:33:58 precise-rtai-x86 kernel: RTAI[sched]: unloaded (forced 
>> hard/soft/hard transitions: traps 0, syscalls 0).
>> Jan 19 09:33:58 precise-rtai-x86 kernel: I-pipe: head domain RTAI 
>> unregistered.
>> Jan 19 09:33:58 precise-rtai-x86 kernel: RTAI[hal]: unmounted.
> 
> And the output for the posix flavor:
> 
>> 255 09:33:58 seb@precise-rtai-x86 /home/seb> DEBUG=5 FLAVOR=posix linuxcnc -l
>> LINUXCNC - 2.6.0~pre~seb-ubc3-deb~8579fcd
>> Machine configuration directory is '/home/seb/linuxcnc/configs/sim.axis'
>> Machine configuration file is 'axis.ini'
>> Starting LinuxCNC...
>> io started
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd loadusr io started
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> Shutting down and cleaning up LinuxCNC...
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> halcmd: hal_init() failed: -22
>> NOTE: 'rtapi' module must be loaded
>> Cleanup done
>> LinuxCNC terminated with an error.  You can find more information in the log:
>>    /home/seb/linuxcnc_debug.txt
>> and
>>    /home/seb/linuxcnc_print.txt
>> as well as in the output of the shell command 'dmesg' and in the terminal
> 
> And the log from the posix flavor startup:
> 
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: startup instance=inst0 pid=31524 
>> flavor=posix rtlevel=5 usrlevel=5 halsize=512000 shm=Posix gcc=4.6.3 
>> git=unknown
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi_app:31526:user master:0 
>> started pid=31526 gcc=4.6.3 git=unknown
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi_app:31526:user rtapi_app: 
>> handle:0 retrieved posix unknown
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi:-1:rt RTAPI:0  posix unknown 
>> init
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi_app:31526:user rtapi: loaded 
>> from rtapi.so
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi:-1:rt HAL_LIB:0 loading RT 
>> support gd=0xb7353000p
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi:-1:rt RTAPI: initing module 
>> HAL_LIB
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi:-1:rt RTAPI: module 'HAL_LIB' 
>> loaded, ID: 32769
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi:-1:rt HAL_LIB:0 kernel lib 
>> installed successfully
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi_app:31526:user hal_lib: 
>> loaded from hal_lib.so
>> Jan 19 09:40:04 precise-rtai-x86 msgd:0: rtapi_app:31526:user rtapi_app:0 
>> initialization complete
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: msgd:0: rtapi_app exit detected - 
>> shutting down
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: rtapi:31526:rt HAL_LIB:0 removing 
>> RT support
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: rtapi:31526:rt rtapi_exit: freed 
>> module slot 1, was HAL_LIB
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: rtapi:31526:rt HAL_LIB:0 RT support 
>> removed successfully
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: rtapi_app:31526:user  'hal_lib' 
>> unloaded
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: rtapi:31526:rt RTAPI:0 exit
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: rtapi_app:31526:user  'rtapi' 
>> unloaded
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: rtapi_app:31526:user master:0 exit 0
>> Jan 19 09:40:06 precise-rtai-x86 msgd:0: normal shutdown - global segment 
>> detached
> 
> I bet it's something stupid and simple i'm doing wrong in the packaging,
> but i'm not seeing what it is.
> 
> 
> -- 
> Sebastian Kuzminsky
> 
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to