From: Barry S. <ba...@ba...> - 2023-12-05 11:46:35
|
On 29/11/2023 13:02, Matti Viljamaa wrote: > On a closer inspection it seems related to the line: > > simple.func_with_callback( callback_bad, 'fred' ) > > because replacing that with a direct call: > > call_back('fred') > > works as expected: > > ... > TEST: call C++ with Python callback_good > callback_good with 'callback_args string' > PASS callback_good returned 'good result' > TEST: call C++ with Python callback_bad > callback_bad with 'fred' > PASS callback_bad: error callback_bad error > TEST: call C++ with Python callback_raise_simple_error > callback_bad with 'callback_args string' > Abort trap (core dumped) > > Is there some problem with raising exceptions with the > simple.func_with_callback? > > However, I also think there might be a problem with: > > TEST: call C++ with Python callback_good > callback_good with 'callback_args string' > PASS callback_good returned 'good result' > > because I think it shouldn't show 'callback_args string' > > On Wed, Nov 29, 2023 at 1:15 PM Matti Viljamaa > <mav...@gm...> wrote: > > I am attempting to build pycxx-7.1.8 for OpenBSD 7.4-current. > > I am following the Unix installation guide at: > > https://cxx.sourceforge.net/ > > The final line: > > make -f linux.mak clean test > > or > > gmake -f linux.mak clean test > > in OpenBSD > > fails to > > ... > TEST: call C++ with Python callback_bad > callback_bad with 'callback_args string' > Abort trap (core dumped) > gmake: *** [linux.mak:86: test] Error 134 > > Upon inspecting test_simple.py I've noticed that it seems to be > linked to raising ValueError, because commenting out line 31: > > raise ValueError( 'callback_bad error' ) > > in test_simple.py makes test_simple.py progress to the next test. > Now I see: > > ... > TEST: call C++ with Python callback_bad > callback_bad with 'callback_args string' > FAILED callback_bad None > TEST: call C++ with Python callback_raise_simple_error > callback_bad with 'callback_args string' > Abort trap (core dumped) > > However, since the Abort traps continue showing, I speculate that > this is about something more. Possible reasons: > > * pycxx-7.1.8 is not compatible with Python 3.10 (or a particular > subversion) > * something is different in OpenBSD compared to Linux > > Any ideas? > This is how to run the failing test on its own to debug it: : 11:44:26 worthy ~/Projects/pycxx-trunk : [1] barry $ PYTHONPATH=obj gdb python3.10 GNU gdb (Fedora Linux) 13.2-11.fc39 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from python3.10... Reading symbols from /home/barry/.cache/debuginfod_client/5ba318aef33a2277a4c3e2fef48addf050553288/debuginfo... (gdb) import simple Undefined command: "import". Try "help". (gdb) run Starting program: /usr/bin/python3.10 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Python 3.10.13 (main, Aug 28 2023, 00:00:00) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import simple sizeof(int) 4 sizeof(long) 8 sizeof(Py_hash_t) 8 sizeof(Py_ssize_t) 8 >>> def callback_bad( arg ): ... raise ValueError( 'callback_bad error' ) ... >>> simple.func_with_callback( callback_bad, 'fred' ) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 2, in callback_bad ValueError: callback_bad error >>> > > _______________________________________________ > CXX-Users mailing list > CXX...@li... > https://lists.sourceforge.net/lists/listinfo/cxx-users |