gf-complete alignment constraints
Hi Kevin,
I've hit the following stack trace (and I can reproduce it which is nice ;-)
#0 __GI_exit (status=1) at exit.c:104 #1 0x00007ffff18f3312 in gf_set_region_data (rd=0x7fffd9b8b0a0, gf=0x485dd40, src=0x4a7b31f, dest=0x4d25800, bytes=2048, val=143, xor=1, align=16) at erasure-code/jerasure/gf-complete/src/gf.c:817 #2 0x00007ffff1932364 in gf_w8_split_multiply_region_sse (gf=0x485dd40, src=0x4a7b31f, dest=0x4d25800, val=143, bytes=2048, xor=1) at erasure-code/jerasure/gf-complete/src/gf_w8.c:1071 #3 0x00007ffff18db9cc in galois_w08_region_multiply (region=0x4a7b31f "", multby=143, nbytes=2048, r2=0x4d25800 "root:x:0:\ndaemon:x:1:\nbin:x:2:\nsys:x:3:\nadm:x:4:loic,swift,syslog\ntty:x:5:\ndisk:x:6:\nlp:x:7:\nmail:x:8:\nnews:x:9:\nuucp:x:10:\nman:x:12:\nproxy:x:13:\nkmem:x:15:\ndialout:x:20:\nfax:x:21:\nvoice:x:22:\ncdrom:x"..., add=1) at erasure-code/jerasure/jerasure/src/galois.c:295 #4 0x00007ffff18ddb42 in jerasure_matrix_dotprod (k=2, w=8, matrix_row=0x47fa558, src_ids=0x0, dest_id=3, data_ptrs=0x7fffd9b8b260, coding_ptrs=0x7fffd9b8b270, size=2048) at erasure-code/jerasure/jerasure/src/jerasure.c:626
https://github.com/ceph/gf-complete/blob/v1/src/gf.c#L811 indeed checks that src=0x4a7b31f, dest=0x4d25800 are aligned and finds they are not. If I'm not mistaken src comes from https://github.com/ceph/jerasure/blob/v2/src/galois.c#L294 which will allocate it via https://github.com/ceph/jerasure/blob/v2/src/galois.c#L292 i.e https://github.com/ceph/jerasure/blob/v2/src/galois.c#L191 and then https://github.com/ceph/jerasure/blob/v2/src/galois.c#L175 which does a malloc that does not enforce alignment.
Should we relax the requirements or make sure https://github.com/ceph/jerasure/blob/v2/src/galois.c#L175 uses a logic similar to https://github.com/ceph/ceph/blob/giant/src/common/buffer.cc#L235 ?
Cheers
Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
A message that is not in the archive (sent off-list or not yet received): CA+AFVBhkg6C9+seEYFdm34_yi++aV-XHPXw2iiLm9mj+=QMJ+w@mail.gmail.com
Quoted 3 lines · Kevin Greenan
Hey Loic,
Makes sense. I can have a look tonight.
I'm actually mistaken, confused the first argument with the second one :-/ I'll keep looking.
Quoted 25 lines
Thanks!
-kevinOn Mon, Dec 1, 2014 at 11:15 AM, Loic Dachary <[email protected] <mailto:[email protected]>> wrote:
Hi Kevin, I've hit the following stack trace (and I can reproduce it which is nice ;-) #0 __GI_exit (status=1) at exit.c:104 #1 0x00007ffff18f3312 in gf_set_region_data (rd=0x7fffd9b8b0a0, gf=0x485dd40, src=0x4a7b31f, dest=0x4d25800, bytes=2048, val=143, xor=1, align=16) at erasure-code/jerasure/gf-complete/src/gf.c:817 #2 0x00007ffff1932364 in gf_w8_split_multiply_region_sse (gf=0x485dd40, src=0x4a7b31f, dest=0x4d25800, val=143, bytes=2048, xor=1) at erasure-code/jerasure/gf-complete/src/gf_w8.c:1071 #3 0x00007ffff18db9cc in galois_w08_region_multiply (region=0x4a7b31f "", multby=143, nbytes=2048, r2=0x4d25800 "root:x:0:\ndaemon:x:1:\nbin:x:2:\nsys:x:3:\nadm:x:4:loic,swift,syslog\ntty:x:5:\ndisk:x:6:\nlp:x:7:\nmail:x:8:\nnews:x:9:\nuucp:x:10:\nman:x:12:\nproxy:x:13:\nkmem:x:15:\ndialout:x:20:\nfax:x:21:\nvoice:x:22:\ncdrom:x"..., add=1) at erasure-code/jerasure/jerasure/src/galois.c:295 #4 0x00007ffff18ddb42 in jerasure_matrix_dotprod (k=2, w=8, matrix_row=0x47fa558, src_ids=0x0, dest_id=3, data_ptrs=0x7fffd9b8b260, coding_ptrs=0x7fffd9b8b270, size=2048) at erasure-code/jerasure/jerasure/src/jerasure.c:626 https://github.com/ceph/gf-complete/blob/v1/src/gf.c#L811 indeed checks that src=0x4a7b31f, dest=0x4d25800 are aligned and finds they are not. If I'm not mistaken src comes from https://github.com/ceph/jerasure/blob/v2/src/galois.c#L294 which will allocate it via https://github.com/ceph/jerasure/blob/v2/src/galois.c#L292 i.e https://github.com/ceph/jerasure/blob/v2/src/galois.c#L191 and then https://github.com/ceph/jerasure/blob/v2/src/galois.c#L175 which does a malloc that does not enforce alignment. Should we relax the requirements or make sure https://github.com/ceph/jerasure/blob/v2/src/galois.c#L175 uses a logic similar to https://github.com/ceph/ceph/blob/giant/src/common/buffer.cc#L235 ? Cheers -- Loïc Dachary, Artisan Logiciel Libre
Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
You can ignore this thread, the problem is not in gf-complete or jerasure ;-)
Sorry for the noise
Quoted 35 lines · Loic Dachary
Quoted 3 lines · Kevin Greenan
Hey Loic,
Makes sense. I can have a look tonight.
I'm actually mistaken, confused the first argument with the second one :-/ I'll keep looking.
Quoted 25 lines
Thanks!
-kevinOn Mon, Dec 1, 2014 at 11:15 AM, Loic Dachary <[email protected] <mailto:[email protected]>> wrote:
Hi Kevin, I've hit the following stack trace (and I can reproduce it which is nice ;-) #0 __GI_exit (status=1) at exit.c:104 #1 0x00007ffff18f3312 in gf_set_region_data (rd=0x7fffd9b8b0a0, gf=0x485dd40, src=0x4a7b31f, dest=0x4d25800, bytes=2048, val=143, xor=1, align=16) at erasure-code/jerasure/gf-complete/src/gf.c:817 #2 0x00007ffff1932364 in gf_w8_split_multiply_region_sse (gf=0x485dd40, src=0x4a7b31f, dest=0x4d25800, val=143, bytes=2048, xor=1) at erasure-code/jerasure/gf-complete/src/gf_w8.c:1071 #3 0x00007ffff18db9cc in galois_w08_region_multiply (region=0x4a7b31f "", multby=143, nbytes=2048, r2=0x4d25800 "root:x:0:\ndaemon:x:1:\nbin:x:2:\nsys:x:3:\nadm:x:4:loic,swift,syslog\ntty:x:5:\ndisk:x:6:\nlp:x:7:\nmail:x:8:\nnews:x:9:\nuucp:x:10:\nman:x:12:\nproxy:x:13:\nkmem:x:15:\ndialout:x:20:\nfax:x:21:\nvoice:x:22:\ncdrom:x"..., add=1) at erasure-code/jerasure/jerasure/src/galois.c:295 #4 0x00007ffff18ddb42 in jerasure_matrix_dotprod (k=2, w=8, matrix_row=0x47fa558, src_ids=0x0, dest_id=3, data_ptrs=0x7fffd9b8b260, coding_ptrs=0x7fffd9b8b270, size=2048) at erasure-code/jerasure/jerasure/src/jerasure.c:626 https://github.com/ceph/gf-complete/blob/v1/src/gf.c#L811 indeed checks that src=0x4a7b31f, dest=0x4d25800 are aligned and finds they are not. If I'm not mistaken src comes from https://github.com/ceph/jerasure/blob/v2/src/galois.c#L294 which will allocate it via https://github.com/ceph/jerasure/blob/v2/src/galois.c#L292 i.e https://github.com/ceph/jerasure/blob/v2/src/galois.c#L191 and then https://github.com/ceph/jerasure/blob/v2/src/galois.c#L175 which does a malloc that does not enforce alignment. Should we relax the requirements or make sure https://github.com/ceph/jerasure/blob/v2/src/galois.c#L175 uses a logic similar to https://github.com/ceph/ceph/blob/giant/src/common/buffer.cc#L235 ? Cheers -- Loïc Dachary, Artisan Logiciel Libre
Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre
A message that is not in the archive (sent off-list or not yet received): CA+AFVBi2zLfMLFX7sx+ZhTpjn5buFhkj+s7-+gyQfWojfrJrrA@mail.gmail.com
Quoted 1 line · Kevin Greenan
No problem. Let me know if you need any help!
Thanks ! When investigating this problem I stumbled upon exit(1) in gf-complete and came up with a patch to replace them with assert(0):
https://github.com/ceph/gf-complete/pull/1/files
When exit(1) is called Ceph just stops with no useful information (the stderr does not in the ceph logs) while assert(0) is caught and shows a nice stack trace. It's not high priority though ;-)
Cheers
Quoted 50 lines
-kevin
On Mon, Dec 1, 2014 at 2:31 PM, Loic Dachary <[email protected] <mailto:[email protected]>> wrote:
You can ignore this thread, the problem is not in gf-complete or jerasure ;-) Sorry for the noise On 01/12/2014 22:47, Loic Dachary wrote: > > > On 01/12/2014 22:01, Kevin Greenan wrote: >> Hey Loic, >> >> Makes sense. I can have a look tonight. > > I'm actually mistaken, confused the first argument with the second one :-/ I'll keep looking. > >> >> Thanks! >> -kevin >> >> On Mon, Dec 1, 2014 at 11:15 AM, Loic Dachary <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>> wrote: >> >> Hi Kevin, >> >> I've hit the following stack trace (and I can reproduce it which is nice ;-) >> >> #0 __GI_exit (status=1) at exit.c:104 >> #1 0x00007ffff18f3312 in gf_set_region_data (rd=0x7fffd9b8b0a0, gf=0x485dd40, src=0x4a7b31f, dest=0x4d25800, bytes=2048, val=143, xor=1, align=16) at erasure-code/jerasure/gf-complete/src/gf.c:817 >> #2 0x00007ffff1932364 in gf_w8_split_multiply_region_sse (gf=0x485dd40, src=0x4a7b31f, dest=0x4d25800, val=143, bytes=2048, xor=1) at erasure-code/jerasure/gf-complete/src/gf_w8.c:1071 >> #3 0x00007ffff18db9cc in galois_w08_region_multiply (region=0x4a7b31f "", multby=143, nbytes=2048, r2=0x4d25800 "root:x:0:\ndaemon:x:1:\nbin:x:2:\nsys:x:3:\nadm:x:4:loic,swift,syslog\ntty:x:5:\ndisk:x:6:\nlp:x:7:\nmail:x:8:\nnews:x:9:\nuucp:x:10:\nman:x:12:\nproxy:x:13:\nkmem:x:15:\ndialout:x:20:\nfax:x:21:\nvoice:x:22:\ncdrom:x"..., add=1) at erasure-code/jerasure/jerasure/src/galois.c:295 >> #4 0x00007ffff18ddb42 in jerasure_matrix_dotprod (k=2, w=8, matrix_row=0x47fa558, src_ids=0x0, dest_id=3, data_ptrs=0x7fffd9b8b260, coding_ptrs=0x7fffd9b8b270, size=2048) at erasure-code/jerasure/jerasure/src/jerasure.c:626 >> >> https://github.com/ceph/gf-complete/blob/v1/src/gf.c#L811 indeed checks that src=0x4a7b31f, dest=0x4d25800 are aligned and finds they are not. If I'm not mistaken src comes from https://github.com/ceph/jerasure/blob/v2/src/galois.c#L294 which will allocate it via https://github.com/ceph/jerasure/blob/v2/src/galois.c#L292 i.e https://github.com/ceph/jerasure/blob/v2/src/galois.c#L191 and then https://github.com/ceph/jerasure/blob/v2/src/galois.c#L175 which does a malloc that does not enforce alignment. >> >> Should we relax the requirements or make sure https://github.com/ceph/jerasure/blob/v2/src/galois.c#L175 uses a logic similar to https://github.com/ceph/ceph/blob/giant/src/common/buffer.cc#L235 ? >> >> Cheers >> -- >> Loïc Dachary, Artisan Logiciel Libre >> >> > -- Loïc Dachary, Artisan Logiciel Libre
Signature · 1 line
Loïc Dachary, Artisan Logiciel Libre