Hi Didier, Thanks for the response.
You are right.I was able to solve the problem. by doing two things. First in d_generic.c packet was being accessed using (uint16*) typecast. The crash was happening here. I changed two byte access. another issue i faced after this was feedback, in bidirectional decompressor case. i stopped that by allocating decompressor with NULL. My system is point to point . What are the advantages of bidirectional decompressor? Thanks again, Harpreet On Tue, 2009-11-24 at 11:45 +0100, Didier Barvaux wrote: > Hi, > > > I am trying to used the rohc source code in my application for > > uclinux. > > > > I have done initialization of comp and decomp and crc tables as > > described in the instructions. > > > > I give 84 byte ip packet to rohc_compress function. > > this works fine and does not crash and does shows rohc_size less than > > 84. > > > > for testing purpose i called rohc_decompress function immediately > > after the rohc compress but decompress function crashes the > > application when it tries to read the IP-ID from the ROHC_packet > > given as input. > > > > [...] > > I tested the code you put in your email on my Linux system without any > problem. No crash at all. Your problem may come from : > - a problem of the ROHC library that appends only on uclinux, > - a difference between your program and mine for compressor and > decompressor initialisation. > > In order to analyse the problem further, could you please run the test > program I attached to my email and send me the output ? > > You may compile it and run it as follow: > $ gcc -g -Wall -Werror -c -o test.o test.c > $ gcc -lrohc_common -lrohc_comp -lrohc_decomp -lm test.o -o test > $ ./test > [rohc_comp.c:67 rohc_alloc_compressor()] creating compressor > 0x45 0x00 0x00 0x54 0x00 0x00 0x40 0x00 > 0x40 0x01 0x85 0x42 0xc6 0xa8 0x14 0x0a > 0xc6 0xa8 0x14 0x0c 0x08 0x00 0x12 0xa4 > 0xeb 0x02 0x00 0x00 0x40 0x7a 0xb9 0xde > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 > [rohc_comp.c:175 rohc_compress()] size of IP packet = 84 bytes > [rohc_comp.c:198 rohc_compress()] IP protocol = 1 > [rohc_comp.c:203 rohc_compress()] no profile found, using default IP > profile > [rohc_comp.c:1121 c_find_context()] no context was found > [rohc_comp.c:1035 c_create_context()] take the first unused context > (CID = 0) > [rohc_comp.c:1075 c_create_context()] context (CID = 0) created > (num_used = 1) > [rohc_comp.c:269 rohc_compress()] selected compression profile = IP / > Compressor (0x0004) > [rohc_comp.c:1302 c_piggyback_get()] add 0 byte(s) of feedback data > [rohc_comp.c:287 rohc_compress()] compress the packet #1 > [c_generic.c:844 c_generic_encode()] SN = 1 > [c_generic.c:6120 changed_dynamic_both_hdr()] check for changed fields > in the outer IP header > [c_generic.c:862 c_generic_encode()] send_static = 0, send_dynamic = 0 > [c_generic.c:870 c_generic_encode()] ip_id = 0x0000, context_sn = 1 > [c_generic.c:2230 update_variables()] ip_id delta = 0xffffffff / > 4294967295 > [c_generic.c:2231 update_variables()] ip_id bits = -1 > [c_generic.c:2241 update_variables()] sn bits=-1 > [c_generic.c:2579 decide_packet()] IR state > [c_generic.c:2804 code_IR_packet()] code IR packet (CID = 0) > [cid.c:57 code_cid_values()] CID = 0 => no add-CID > [c_generic.c:2821 code_IR_packet()] type of packet + D flag = 0xfd > [c_generic.c:2825 code_IR_packet()] profile ID = 0x04 > [c_generic.c:2831 code_IR_packet()] CRC = 0x00 for CRC calculation > [c_generic.c:3096 code_ipv4_static_part()] version = 0x40 > [c_generic.c:3101 code_ipv4_static_part()] protocol = 0x01 > [c_generic.c:3111 code_ipv4_static_part()] src addr = c6 a8 14 0a > [c_generic.c:3119 code_ipv4_static_part()] dst addr = c6 a8 14 0c > [c_generic.c:3305 code_ipv4_dynamic_part()] TOS = 0x00, TTL = 0x40, > IP-ID = 0x0000, df_rnd_nbo = 0xa0 (DF = 1, RND = 0, NBO = 1) > [c_generic.c:2890 code_IR_packet()] SN = 1 -> 0x0001 > [c_generic.c:2896 code_IR_packet()] CRC (header length = 20, crc = 0xaa) > [rohc_comp.c:362 rohc_compress()] ROHC size = 84 (feedback = 0, header > = 20, payload = 64), output buffer size = 1024 > ip_size = 84 & rohc_size = 84 > 0xfd 0x04 0xaa 0x40 0x01 0xc6 0xa8 0x14 > 0x0a 0xc6 0xa8 0x14 0x0c 0x00 0x40 0x00 > 0x00 0xa0 0x00 0x01 0x08 0x00 0x12 0xa4 > 0xeb 0x02 0x00 0x00 0x40 0x7a 0xb9 0xde > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 0x00 0x00 > [rohc_decomp.c:399 rohc_decompress()] decompress the packet #1 > [rohc_decomp.c:550 d_decode_feedback_first()] skip 0 byte(s) of padding > [rohc_decomp.c:846 rohc_ir_packet_crc_ok()] size of IR packet header : > 20 > [rohc_decomp.c:865 rohc_ir_packet_crc_ok()] CRC OK (crc = 0xaa, > profile_id = 4, largecid = 0, addcidUsed = 0, ir_size = 20) > [d_generic.c:1465 d_generic_decode_ir()] decode an IR packet > [d_generic.c:1769 d_decode_static_ip4()] IP Version = 4 > [d_generic.c:1775 d_decode_static_ip4()] Protocol = 0x01 > [d_generic.c:1781 d_decode_static_ip4()] Source Address = 0x0a14a8c6 > [d_generic.c:1787 d_decode_static_ip4()] Destination Address = > 0x0c14a8c6 > [d_generic.c:1927 d_decode_dynamic_ip4()] TOS = 0x00 > [d_generic.c:1933 d_decode_dynamic_ip4()] TTL = 0x40 > [d_generic.c:1939 d_decode_dynamic_ip4()] IP-ID = 0x0000 > [d_generic.c:1952 d_decode_dynamic_ip4()] DF = 1, RND = 0, NBO = 1 > [d_generic.c:5316 build_uncompressed_ip4()] IP-ID = 0x0000 > [d_generic.c:5320 build_uncompressed_ip4()] IHL = 0x5 > [d_generic.c:5325 build_uncompressed_ip4()] Total Length = 0x0054 (IHL > * 4 + 64) > [d_generic.c:5328 build_uncompressed_ip4()] IP checksum = 0x8542 > [d_generic.c:5683 update_inter_packet()] current time = 1699587878 and > last time = 0 > [d_generic.c:5697 update_inter_packet()] inter_arrival_time = 0 and > current arrival delta is = 0 > [d_generic.c:1666 d_generic_decode_ir()] ROHC payload (length = 64 > bytes) starts at offset 20 > [rohc_decomp.c:411 rohc_decompress()] state in decompressor = 3 > [rohc_decomp.c:484 rohc_decompress()] feedback curr -12 > [rohc_decomp.c:491 rohc_decompress()] feedback curr 0 > [rohc_comp.c:124 rohc_free_compressor()] free contexts > [rohc_comp.c:128 rohc_free_compressor()] free feedback buffer > $ echo $? > 0 > > Regards, > > Didier Barvaux > Viveris Technologies > > _______________________________________________ > Mailing list: https://launchpad.net/~rohc > Post to : [email protected] > Unsubscribe : https://launchpad.net/~rohc > More help : https://help.launchpad.net/ListHelp -- Software Engineer 1Spatial Australia +61 3 52616840 _______________________________________________ Mailing list: https://launchpad.net/~rohc Post to : [email protected] Unsubscribe : https://launchpad.net/~rohc More help : https://help.launchpad.net/ListHelp

