Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when read /3/0/6 #131

Closed
ieei0214 opened this issue Mar 30, 2016 · 2 comments
Closed

Segmentation fault when read /3/0/6 #131

ieei0214 opened this issue Mar 30, 2016 · 2 comments

Comments

@ieei0214
Copy link
Contributor

Always crash in coap_serialize_message().

Starting program: /data/lwm2m/wakaama/build_client/lwm2mclient -h "leshan.eclipse.org" -p "5683" -4
Trying to bind LWM2M Client to port 56830
LWM2M Client "testlwm2mclient" started on port 56830

Opening connection to server at leshan.eclipse.org:5683
Sending 153 bytes to [5.39.83.206]:5683
44 02 49 11 11 49 10 87 B2 72 64 11 28 3D 05 65 D.I..I...rd.(=.e
70 3D 74 65 73 74 6C 77 6D 32 6D 63 6C 69 65 6E p=testlwm2mclien
74 03 62 3D 55 06 6C 74 3D 33 30 30 FF 3C 2F 3E t.b=U.lt=300.</>
3B 72 74 3D 22 6F 6D 61 2E 6C 77 6D 32 6D 22 3B ;rt="oma.lwm2m";
63 74 3D 31 35 34 33 2C 3C 2F 31 2F 30 3E 2C 3C ct=1543,</1/0>,<
2F 33 2F 30 3E 2C 3C 2F 35 2F 30 3E 2C 3C 2F 36 /3/0>,</5/0>,</6
2F 30 3E 2C 3C 2F 31 30 32 34 2F 31 30 3E 2C 3C /0>,</1024/10>,<
2F 31 30 32 34 2F 31 31 3E 2C 3C 2F 31 30 32 34 /1024/11>,</1024
2F 31 32 3E 2C 3C 2F 34 2F 30 3E 2C 3C 2F 37 2F /12>,</4/0>,</7/
30 3E 2C 3C 2F 32 2F 30 3E 0>,</2/0>
22 bytes received from [5.39.83.206]:5683
64 41 49 11 11 49 10 87 82 72 64 0A 38 73 78 79 dAI..I...rd.8sxy
44 7A 6A 62 67 76 Dzjbgv
15 bytes received from [5.39.83.206]:5683
45 01 4D 06 7D 2F F7 C6 E1 B1 33 01 30 01 36 E.M.}/....3.0.6

Program received signal SIGSEGV, Segmentation fault.
__memmove_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:131
131 ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: No such file or directory.
(gdb) bt
#0 __memmove_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:131
#1 0x000000000041d31e in coap_serialize_message ()
#2 0x0000000000414032 in message_send ()
#3 0x0000000000413e02 in lwm2m_handle_packet ()
#4 0x0000000000406618 in main ()

(gdb)

@dnav
Copy link
Contributor

dnav commented Mar 30, 2016

This is a bug I (partially) fixed in branch lwm2m_data_rework.
The serialization fails and returns -1. But the object_read() function treats the result as a size_t and does not detect the failure, putting a NULL pointer as the payload with a very long length.
Serialization fails because we try to serialize a multiple resource in text format. I'm working on this.

@dnav
Copy link
Contributor

dnav commented Apr 5, 2016

fixed by #130

@dnav dnav closed this as completed Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants