Hi guys,
I've cross compiled Kamailio (4.1.6) for ARM (Wandboard-IMX6). Everything seems works fine, but when I try to enable rtpproxy-ng module and Alignment trap error occurred just during rtpp_test (exchanging ping-ponge message betweek rtpproxy and rtpproxy-ng module of Kamailio)
rtpengine[2258]: Got valid command from 127.0.0.1:50470: ping - { "command": "ping" } rtpengine[2258]: Returning to SIP proxy: d6:result4:ponge user.err kernel: [66832.254887] Alignment trap: not handling instruction edc30b08 at [<40b3a130>] user.alert kernel: [66832.262030] Unhandled fault: alignment exception (0x801) at 0x4033a782 local0.err kamailio: ERROR: <core> [daemonize.c:307]: daemonize(): Main process exited before writing to pipe
In x86 architecture same packages works correctly without any problem.
Does anybody encountered this kind of error?
Marino
----- Marino Mileti -- View this message in context: http://sip-router.1086192.n5.nabble.com/Kamailio-for-ARM-with-rtpproxy-ng-tp... Sent from the Users mailing list archive at Nabble.com.
On 10/23/14 05:28, Marino Mileti wrote:
Hi guys,
I've cross compiled Kamailio (4.1.6) for ARM (Wandboard-IMX6). Everything seems works fine, but when I try to enable rtpproxy-ng module and Alignment trap error occurred just during rtpp_test (exchanging ping-ponge message betweek rtpproxy and rtpproxy-ng module of Kamailio)
rtpengine[2258]: Got valid command from 127.0.0.1:50470: ping - { "command": "ping" } rtpengine[2258]: Returning to SIP proxy: d6:result4:ponge user.err kernel: [66832.254887] Alignment trap: not handling instruction edc30b08 at [<40b3a130>] user.alert kernel: [66832.262030] Unhandled fault: alignment exception (0x801) at 0x4033a782 local0.err kamailio: ERROR: <core> [daemonize.c:307]: daemonize(): Main process exited before writing to pipe
In x86 architecture same packages works correctly without any problem.
Which version of rtpengine is that? There are some places in the code where misaligned pointers might be a problem and one such instance was fixed recently. If this is the most recent version, I can try to fix the pointer alignment if you can figure out where exactly it happens.
cheers
Version is 3.3.0.0 mr3.5.0.0
I've seen that the problem is during the "ping-pong test" when the value of bencode_item is assigned
The error is on __bencode_dictionary_init, and the istruction is : dict->value=0
I've read ARM documentation and it says to add __attribute__((packed)) to value definition inside bencode_item struct. In my case i've done:
long long int value __attribute__((packed));
I've tried and it works. I don't know if this is the right solution. What do you think about it? Richard Fuchs wrote
Which version of rtpengine is that? There are some places in the code where misaligned pointers might be a problem and one such instance was fixed recently. If this is the most recent version, I can try to fix the pointer alignment if you can figure out where exactly it happens.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@.sip-router
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
----- Marino Mileti -- View this message in context: http://sip-router.1086192.n5.nabble.com/Kamailio-for-ARM-with-rtpproxy-ng-tp... Sent from the Users mailing list archive at Nabble.com.
On 10/23/14 11:32, Marino Mileti wrote:
Version is 3.3.0.0 mr3.5.0.0
I've seen that the problem is during the "ping-pong test" when the value of bencode_item is assigned
The error is on __bencode_dictionary_init, and the istruction is : dict->value=0
I've read ARM documentation and it says to add __attribute__((packed)) to value definition inside bencode_item struct. In my case i've done:
long long int value __attribute__((packed));
I've tried and it works. I don't know if this is the right solution. What do you think about it?
Interesting. I'm not sure why this is required for this value, but hey, if it works... Let me know if you run into any more trouble.
cheers
Richard Fuchs wrote
Interesting. I'm not sure why this is required for this value, but hey, if it works... Let me know if you run into any more trouble.
Bad news..the __attribute__((packed)) modification allows only the kernel to fixup the alignment trap but it still exist and i don't know if this can be a problem during calls..
Do you have some suggest in order to fix this issue?
----- Marino Mileti -- View this message in context: http://sip-router.1086192.n5.nabble.com/Kamailio-for-ARM-with-rtpproxy-ng-tp... Sent from the Users mailing list archive at Nabble.com.
On 10/27/14 06:57, Marino Mileti wrote:
Richard Fuchs wrote
Interesting. I'm not sure why this is required for this value, but hey, if it works... Let me know if you run into any more trouble.
Bad news..the __attribute__((packed)) modification allows only the kernel to fixup the alignment trap but it still exist and i don't know if this can be a problem during calls..
Do you have some suggest in order to fix this issue?
Unfortunately my understanding of ARM alignment restrictions is very limited, in fact so limited that I don't understand why this particular instruction even is a problem to begin with. My only suggestions would be to either declare the entire struct as packed, or try adding some gcc flags to the makefile (-munaligned-access or -mno-unaligned-access, apparently it depends on what kind of kernel you're running), recompile the entire source and see if that fixes anything. Other than that, I'm at a loss.
cheers