2010년 3월 11일 목요일

CentOS 5.2, Xen에서 Zaptel 커널 패닉 발생

XEN VM에 ZAPTEL 올리면 커널 패닉이 발생한다.

=====================================================================================

Waiting for zap to come online...OK
Loading zaptel hardware modules:No hardware timing source found in /proc/zaptel, loading ztdummy
----------- [cut here ] --------- [please bite here ] ---------
Kernel BUG at kernel/timer.c:332
invalid opcode: 0000 [1] SMP
last sysfs file: /class/zaptel/zapctl/dev
CPU 0
Modules linked in: ztdummy(U) zaptel(U) crc_ccitt ip_conntrack_netbios_ns ipt_REJECT xt_state ip_conntrack nf             netlink iptable_filter ip_tables ip6t_REJECT xt_tcpudp ip6table_filter ip6_tables x_tables ipv6 xfrm_nalgo cr             ypto_api dm_mirror dm_multipath scsi_dh scsi_mod parport_pc lp parport pcspkr xennet dm_raid45 dm_message dm_             region_hash dm_log dm_mod dm_mem_cache xenblk ext3 jbd uhci_hcd ohci_hcd ehci_hcd
Pid: 858, comm: modprobe Tainted: G      2.6.18-164.11.1.el5xen #1
RIP: e030:[<ffffffff8021cdd8>]  [<ffffffff8021cdd8>] __mod_timer+0x19/0xbe
RSP: e02b:ffff88001ccebe18  EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffff8070a8a0 RCX: 00000000fffef569
RDX: 00000000000000fa RSI: 00000000fffef56e RDI: ffffffff8070a8a0
RBP: ffff88001d36e000 R08: 00000000ffffffff R09: 0000000000000020
R10: 0000000000000000 R11: 0000000000000000 R12: 000000000002ed20
R13: 00000000fffef56e R14: 000000000f2262d8 R15: 00002aefc84c3010
FS:  00002aefc8a0d6e0(0000) GS:ffffffff805ca000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000
Process modprobe (pid: 858, threadinfo ffff88001ccea000, task ffff88001fb5e100)
Stack:  000000000002ed20  00002aefc84c3010  0000000000000000  ffff88001d36e000
 000000000002ed20  00002aefc84c3010  000000000f2262d8  ffffffff8039c1bb
 ffff88001ccebeef  0000000000000400
Call Trace:
 [<ffffffff8039c1bb>] rtc_do_ioctl+0x1c5/0x701
 [<ffffffff882bbec6>] :zaptel:zt_register+0x17a/0x27f
 [<ffffffff80289d67>] __cond_resched+0x1c/0x44
 [<ffffffff80264945>] _spin_lock_irq+0x9/0x14
 [<ffffffff80262fd7>] wait_for_completion+0xa1/0xaa
 [<ffffffff80264945>] _spin_lock_irq+0x9/0x14
 [<ffffffff882ec2fb>] :ztdummy:init_module+0x1be/0x23a
 [<ffffffff802a2028>] sys_init_module+0xaf/0x1f2
 [<ffffffff80260106>] system_call+0x86/0x8b
 [<ffffffff80260080>] system_call+0x0/0x8b


Code: 0f 0b 68 e9 58 49 80 c2 4c 01 48 8d 74 24 08 48 89 df 45 31
RIP  [<ffffffff8021cdd8>] __mod_timer+0x19/0xbe
 RSP <ffff88001ccebe18>
 <0>Kernel panic - not syncing: Fatal exception

================================================================================================

요로코롬 발생되서 손놓고 있따가. ASTERISK 는 잘되길래 냅눴는데

FREEPBX하면서 문제가 되길래 다시 볼수 밖에 음썼다.. ㅠㅠ 이게 그냥 일반 머신에서는 ASTERISK 리스타트시에 잘 올라오고 변경된 설정이 잘 저장이 되는데 유독 VM에서만 안되는것이었따.

 

그리하여 찾아낸게 아래의 페이지였다

 

http://www.odindev.com/content/troubles-zaptel-centos-52-xen

I've been doing a lot of work with Asterisk lately and have been having and issues A)getting the zaptel 1.4 module to compile and B) Zaptel module causing a CentOS 5.2 Xen server to crash on load.  After much searching and deciphering, here's what I had to do to get things working...

I've been doing a lot of work with Asterisk lately and have been having and issues A)getting the zaptel 1.4 module to compile and B) Zaptel module causing a CentOS 5.2 Xen server to crash on load. After much searching and deciphering, here's what I had to do to get things working...

My first troubles were even getting the Zaptel 1.4 module source code to compile. I kept getting an 'You do not have sources for 2.6....' errors. The error is self explanatory meaning I'm not compiling against the correct kernel sources. But I had already did a 'yum install kernel-devel' and created a symbolic link for '/usr/src/linux/' to '/usr/src/kernels/2.6.18-92.1.6.el5xen-i686/' (yum doesn't install the sources in the standard directory). So what gives?

Since this box is a virtualized xen install, I learned I had to actually install 'yum install kernel-xen-devel' to get the modified xen sources for my kernel. Awesome, I'm past my first compile error.

Then I started getting a 'conflicting types for bool' error. Great. After much googling I stumbled across this page @ http://bugs.digium.com/view.php?id=12889. It sounds like a bug. So I download the attached .diff file and 'patch < centos52_fix.diff' inside the source directory of zaptel (/usr/src/zaptel). It didn't recognize the file path and asked me to enter one so I typed the path to the file to be changed 'kernel/xpp/xdefs.h' and it picked up and applied. Whew...what's next?

The zaptel module now completes the './compile' and I finish up with a 'make' and 'make install' and 'make config'. So far so good. I tried to start the module with '/etc/init.d/zaptel start' and immediately the server panics and crashes. Not good.

After toiling with google again I found url @ http://pbxinaflash.com/forum/archive/index.php?t-595.html "it will crash your domU when it tries to load the ztdummy module so if you can comment that out of the install first that would be good. Otherwise you have to boot the domU in single user mode and fix it. To fix it, just edit /usr/src/zaptel/kernel/ztdummy.c and comment out #define USE_RTC, then cd /usr/src/zaptel and "make install"."

So I ended up having to edit the source file for ztdummy.c (above) around lines 57-67. Here's my changed section:
[code] #if defined(__i386__) || defined(__x86_64__) #if LINUX_VERSION_CODE >= VERSION_CODE(2,6,13) /* The symbol hrtimer_forward is only exported as of 2.6.22: */ #if defined(CONFIG_HIGH_RES_TIMERS) && LINUX_VERSION_CODE >= VERSION_CODE(2,6,22) #define USE_HIGHRESTIMER #else /* #define USE_RTC */ #endif #else #if 0 /* #define USE_RTC */ #endif #endif #endif [/code]

After commenting out the two USE_RTC lines, I reconfigured, make, make install. No complaints on the compile so I started the module with '/etc/init.d/zaptel start' and...

[OK]

The module loaded. Doing a 'zttest' detected ztdummy on my system returned a 99.99%.

What a day...

 

뻘겋게 표시 되어있는 라인을 보면 주석 표시가 추가적으로 되어있는 부분이 있따. 

이부분을 작업을 해주고 리부팅을 해보면 커널패닉 발생 없이 ZAPTEL이 시작되믄서 올라온다

ㅠㅠ 감동인것이다.

 

-_- 지랄맞은.... 삽질 한참 했네

댓글 없음:

댓글 쓰기