On 12/17/2010 10:40 AM, Carsten Haitzler (The Rasterman) wrote: > On Fri, 17 Dec 2010 10:38:06 +0100 Pierre Cassimans <cazz...@gmail.com> said: > >> On 12/17/2010 07:06 AM, Carsten Haitzler (The Rasterman) wrote: >>> On Thu, 16 Dec 2010 20:29:58 +0100 Pierre Cassimans <cazz...@gmail.com> >>> said: >>> >>> huh? that looks like this is doing unaligned stuff: >>> >>> params->y = TO_INT(ADD(want_y, >>> MUL(SUB(want_h, FROM_INT(params->h)), >>> desc->align.y))); >>> >>> so we have: >>> >>> TO_INT >>> ADD >>> MUL >>> SUB >>> FROM_INT >>> >>> ie: >>> >>> #define TO_INT(a) eina_f32p32_int_to(a) >>> #define ADD(a, b) eina_f32p32_add(a, b) >>> #define MUL(a, b) eina_f32p32_mul(a, b) >>> #define SUB(a, b) eina_f32p32_sub(a, b) >>> #define FROM_INT(a) eina_f32p32_int_from(a) >>> >>> which are: >>> >>> static inline int32_t >>> eina_f32p32_int_to(Eina_F32p32 v) >>> { >>> return (int32_t)(v >> 32); >>> } >>> static inline Eina_F32p32 >>> eina_f32p32_add(Eina_F32p32 a, Eina_F32p32 b) >>> { >>> return a + b; >>> } >>> #define eina_fp32p32_llabs(a) ((a < 0) ? -(a) : (a)) >>> static inline Eina_F32p32 >>> eina_f32p32_mul(Eina_F32p32 a, Eina_F32p32 b) >>> { >>> /* Prevent overflow and do '(a * b) >> 32' */ >>> /* Basically do: Eina_F16p16 * Eina_F16p16 = Eina_F32p32 */ >>> Eina_F32p32 up; >>> Eina_F32p32 down; >>> Eina_F32p32 result; >>> uint64_t as, bs; >>> Eina_F32p32 sign; >>> >>> sign = a ^ b; >>> as = eina_fp32p32_llabs(a); >>> bs = eina_fp32p32_llabs(b); >>> >>> up = (as >> 16) * (bs >> 16); >>> down = (as & 0xFFFF) * (bs & 0xFFFF); >>> >>> result = up + (down >> 32); >>> >>> return sign < 0 ? - result : result; >>> } >>> static inline Eina_F32p32 >>> eina_f32p32_sub(Eina_F32p32 a, Eina_F32p32 b) >>> { >>> return a - b; >>> } >>> static inline Eina_F32p32 >>> eina_f32p32_int_from(int32_t v) >>> { >>> return (Eina_F32p32)(v) << 32; >>> } >>> >>> that's been in edje for a long time - it's fixed point math.. now have a >>> look at that. nowhere there is it doing any "pointer funk" which would be a >>> cause for unaligned accesses. what looks wrong is the bt - func params >>> specifically look wrong. smells like something is inlined and gdb is >>> getting it wrong. but... for now lets assume that the fixed point math >>> above is what is triggering it... i dont see how. it's been there for ages. >>> i cant read/see a potential unaligned access. unless the source inputs like >>> params pointer is wrong or desc. they are pointing to unaligned data. i'd >>> find that most peculiar if they were. >>> >>>> Hi, >>>> >>>> As told on IRC, when i run elementary_test, I get plenty of Alignment >>>> trap errors in dmesg. It also takes 3 minutes to start it up on an HP >>>> Ipaq h2200. >>>> >>>> I tried to debug the problem with gdb, and this is what I got. If not >>>> enough info please ask me for more. I'm ready to learn how to really >>>> give you good debug info :-) >>>> >>>> versions are all svn 54526 >>>> >>>> Linux h2200 2.6.21-hh20 #1 PREEMPT Fri Dec 25 06:15:37 CET 2009 armv5tel >>>> unknown >>>> >>>> [ 3412.430000] Alignment trap: elementary_test (1341) PC=0x4042bbe0 >>>> Instr=0xe1c581d0 Address=0x00140f64 FSR 0x013 >>>> >>>> Program received signal SIGINT, Interrupt. >>>> _edje_part_recalc_single_aspect (ed=0x0, ep=0xfffffffb, desc=0x0, >>>> chosen_desc=0x142614, rel1_to_x=0x57, rel1_to_y=0x0, >>>> rel2_to_x=0x4048df10, >>>> rel2_to_y=0x2f6d6c65, confine_to=0x0, params=0x6574692f) at >>>> edje_calc.c:607 >>>> 607 edje_calc.c: No such file or directory. >>>> in edje_calc.c >>>> >>>> (gdb) l *0x04042bbe0 >>>> 0x4042bbe0 is in _edje_part_recalc_single (edje_calc.c:604). >>>> 599 in edje_calc.c >>>> >>>> Hope this helps >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Lotusphere 2011 >>>> Register now for Lotusphere 2011 and learn how >>>> to connect the dots, take your collaborative environment >>>> to the next level, and enter the era of Social Business. >>>> http://p.sf.net/sfu/lotusphere-d2d >>>> _______________________________________________ >>>> enlightenment-devel mailing list >>>> enlightenment-devel@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel >>>> >>> >>> >> >> hmmm :-( >> >> this is the procedure i follow to give the information: >> If I start gdb elementary_test, the program runs and gdb doesn't stop, >> but looking at dmesg i see the alignment traps happen. >> >> So i >> - start elementary_test >> - start gdb >> - look to dmesg to get pid and address >> - attach <pid> >> - l *<address> >> >> and then i get the output i gave you. >> >> Is my procedure wrong? do I have to add something else? >> i always get the same output, except for the line numbers: >> <address> is in _edje_part_recalc_single (edje_calc.c:***). >>>> *** in edje_calc.c > > ooh.. wait.. you could be catching it at any point. no - you want to DISABLE > alignment fixups in your kernel to make sure elementary_test segv's on > unaligned access and have it running under gdb at the time. >
ok echo 5 > /proc/cpu/alignment did the trick. here is the new bt Program received signal SIGBUS, Bus error. _edje_part_recalc_single_aspect (ed=0x0, ep=0x0, desc=0x0, chosen_desc=0x906ec, rel1_to_x=0x150, rel1_to_y=0x0, rel2_to_x=0x4048df10, rel2_to_y=0x2f6d6c65, confine_to=0x0, params=0x2f657361) at edje_calc.c:427 427 edje_calc.c: No such file or directory. in edje_calc.c (gdb) bt #0 _edje_part_recalc_single_aspect (ed=0x0, ep=0x0, desc=0x0, chosen_desc=0x906ec, rel1_to_x=0x150, rel1_to_y=0x0, rel2_to_x=0x4048df10, rel2_to_y=0x2f6d6c65, confine_to=0x0, params=0x2f657361) at edje_calc.c:427 #1 _edje_part_recalc_single (ed=0x0, ep=0x0, desc=0x0, chosen_desc=0x906ec, rel1_to_x=0x150, rel1_to_y=0x0, rel2_to_x=0x4048df10, rel2_to_y=0x2f6d6c65, confine_to=0x0, params=0x2f657361) at edje_calc.c:1312 #2 0x4042df24 in _edje_part_recalc (ed=0x40022ee0, ep=0x912c8, flags=-1093060952) at edje_calc.c:1810 #3 0x40430e70 in _edje_recalc_do (ed=0x86ac0) at edje_calc.c:268 #4 0x4046928c in _edje_smart_resize (obj=<value optimized out>, w=<value optimized out>, h=1) at edje_smart.c:224 #5 0x4082a61c in evas_object_resize (obj=0x86998, w=1, h=1) at evas_object_main.c:511 #6 0x40050624 in _smart_reconfigure (sd=0x86858) at elm_widget.c:2425 #7 0x4082a61c in evas_object_resize (obj=0x86708, w=1, h=1) at evas_object_main.c:511 #8 0x4004b118 in elm_win_resize_object_add (obj=0x85bd8, subobj=0x86708) at elm_win.c:1127 #9 0x00013c44 in my_win_main (argc=<value optimized out>, argv=<value optimized out>) at test.c:201 #10 elm_main (argc=<value optimized out>, argv=<value optimized out>) at test.c:404 ---Type <return> to continue, or q <return> to quit--- #11 0x40d9b038 in __libc_start_main () from /lib/libc.so.6 #12 0x00013b00 in _start () ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel