zcbsxb / libjingle

Automatically exported from code.google.com/p/libjingle
0 stars 0 forks source link

Alignment traps when compiled for ARM target #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile libjingle-0.5.1 and examples with arm_v5t_le-g++ (g++ 4.2.0)
2. Run call or login examples on ARM target
3. Observe Alignment Trap

What is the expected output? What do you see instead?
I expect the examples to work exactly like they do when compiled on my native 
Linux host (Fedora 10, g++ 4.3.2). On this platform the call example works 
great. I'm simply trying to run the same example on the ARM target.

What version of the product are you using? On what operating system?
libjingle-0.5.1 on Linux 2.6.18 (arm926ejs)

Please provide any additional information below.
I corrected one alignment issue in nethelpers.cc::SafeGetHostByName where the 
pointer manipulation resulted in an alignment problem. However once I corrected 
this, other alignment traps and bus errors occur. 

Original issue reported on code.google.com by cdsem...@gmail.com on 19 Nov 2010 at 9:48

GoogleCodeExporter commented 9 years ago
Libjingle should work on ARM target. Could you please attach any screen log or 
file log for further investigation?

Original comment by jun...@google.com on 23 Nov 2010 at 12:15

GoogleCodeExporter commented 9 years ago
I've attached a small program that illustrates the issue with libjingle on ARM. 
I've just taken the SafeGetHostByName function from nethelpers.cc and made it 
run stand-alone. When compiled for the ARM, the program generates an aligment 
trap when adjusting the pointers based on the string passed in (in this 
example, and in the libjingle code, the string is "talk.l.google.com". I also 
included the output when compiled and run on an x86 Linux host. 

Compile for the ARM, login to ARM-based board and execute....
$ arm_v5t_le-g++ -Wall -o h.arm trap.cc 
$ telnet 192.168.1.86
Trying 192.168.1.86...
Connected to 192.168.1.86.
Escape character is '^]'.

MontaVista(R) Linux(R) Professional Edition 5.0.0 (0801921)
Linux/armv5tejl 2.6.18_pro500-davinci

192.168.1.86 login: root
# ./h.arm 
SafeGetHostByName:18 - looking up hostname:talk.l.google.com (17 characters)
Alignment trap: h.arm (1193) PC=0x000088f8 Instr=0xe5823000 Address=0x0001217e 
FSR 0x813
Bus error
#

The same code compiled on x86 Linux host runs OK:
$ g++ -Wall -o h trap.cc 
$ ./h
SafeGetHostByName:18 - looking up hostname:talk.l.google.com (17 characters)
hostent - h_name:talk.l.google.com h_addrtype:2 h_length:4
hostent - h_addr_list[0]:0x7d2d7d4a - 74.125.45.125

Original comment by cdsem...@gmail.com on 23 Nov 2010 at 3:40

Attachments:

GoogleCodeExporter commented 9 years ago
This issue should be fixed in 0.5.5+. Please reopen if you can still repro in 
newer version of libjingle.

Original comment by jun...@google.com on 31 Oct 2011 at 6:04