Re: External functions returning C_DOUBLE are called twice (bug?)
- Posted by ghaberek (admin) Dec 17, 2020
- 1146 views
Stack trace showing the call is coming from inside the house that call_routine() macro as I suspected:
$ gdb /home/greg/Projects/OpenEuphoria/euphoria/source/build/eui GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1 Reading symbols from /home/greg/Projects/OpenEuphoria/euphoria/source/build/eui...done. (gdb) break hello Function "hello" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (hello) pending. (gdb) run libmytest.e Starting program: /home/greg/Projects/OpenEuphoria/euphoria/source/build/eui libmytest.e [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Breakpoint 1, 0x00007ffff701f62e in hello () from ./libmytest.so (gdb) bt #0 0x00007ffff701f62e in hello () from ./libmytest.so #1 0x0000555555952aa3 in dcall_x86_64 (func=func@entry=140737337488938, xmm=xmm@entry=0x7fffffffb2e0, r=r@entry=0x7fffffffb320) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_callc.c:1015 #2 0x0000555555953273 in call_c (func=<optimized out>, proc_ad=<optimized out>, arg_list=-9223360308729739510) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_callc.c:1486 #3 0x000055555594e9a5 in do_exec (start_pc=0x555555d84098) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_execute.c:5179 #4 0x000055555594642f in Execute (start_index=0x555555d84098) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_execute.c:1839 #5 0x0000555555957c29 in start_backend (x=-9223360308729746296) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_machine.c:2911 #6 0x00005555559581ee in machine (opcode=65, x=-9223360308729746296) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_machine.c:3216 #7 0x00005555555cd442 in _69BackEnd (_il_file_68425=0) at /home/greg/Projects/OpenEuphoria/euphoria/source/build/intobj/backend.c:4276 #8 0x0000555555651f51 in _2BackEnd (_x_192=0) at /home/greg/Projects/OpenEuphoria/euphoria/source/build/intobj/mode.c:170 #9 0x00005555555e966e in _75main () at /home/greg/Projects/OpenEuphoria/euphoria/source/build/intobj/main.c:1134 #10 0x00005555557d3c47 in main (argc=2, argv=0x7fffffffe528) at /home/greg/Projects/OpenEuphoria/euphoria/source/build/intobj/main-.c:22331 (gdb) cont Continuing. Hello! Your number was 123.456 Breakpoint 1, 0x00007ffff701f62e in hello () from ./libmytest.so (gdb) bt #0 0x00007ffff701f62e in hello () from ./libmytest.so #1 0x0000555555952a15 in icall_x86_64 (func=func@entry=140737337488938, xmm=xmm@entry=0x7fffffffb2e0, r=r@entry=0x7fffffffb320, args=args@entry=6) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_callc.c:1005 #2 0x000055555595328f in call_c (func=<optimized out>, proc_ad=<optimized out>, arg_list=-9223360308729739510) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_callc.c:1486 #3 0x000055555594e9a5 in do_exec (start_pc=0x555555d84098) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_execute.c:5179 #4 0x000055555594642f in Execute (start_index=0x555555d84098) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_execute.c:1839 #5 0x0000555555957c29 in start_backend (x=-9223360308729746296) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_machine.c:2911 #6 0x00005555559581ee in machine (opcode=65, x=-9223360308729746296) at /home/greg/Projects/OpenEuphoria/euphoria/source/be_machine.c:3216 #7 0x00005555555cd442 in _69BackEnd (_il_file_68425=0) at /home/greg/Projects/OpenEuphoria/euphoria/source/build/intobj/backend.c:4276 #8 0x0000555555651f51 in _2BackEnd (_x_192=0) at /home/greg/Projects/OpenEuphoria/euphoria/source/build/intobj/mode.c:170 #9 0x00005555555e966e in _75main () at /home/greg/Projects/OpenEuphoria/euphoria/source/build/intobj/main.c:1134 #10 0x00005555557d3c47 in main (argc=2, argv=0x7fffffffe528) at /home/greg/Projects/OpenEuphoria/euphoria/source/build/intobj/main-.c:22331 (gdb) cont Continuing. Hello! Your number was 123.456 Got back: 246.912 warning: Temporarily disabling breakpoints for unloaded shared library "./libmytest.so" [Inferior 1 (process 6091) exited normally] (gdb) quit
-Greg