coin-or / coin-or/CyLP

Tab completion in ipython causes SIGABRT

Open
#222 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JetBrains MPS
Stars
192
Forks
70
PR merge metrics
No merged PRs in 30d

Description

Appears similar to but distinct from #134
Coincidentally, here ipython terminates with _exit code_ 134.

Running:
`> ipython`
```python
from cylp.cy import CyClpSimplex

s = CyClpSimplex()
s. # Press TAB
```
Output:
`ClpSimplexPrimal or ClpSimplexDual must have been called with correct startFinishOption`

Note that I do NOT see this in a regular python REPL; only with ipython.

Here running on an ARM mac:
`Python 3.12.4`
`cylp==0.92.3`
`numpy==1.26.4`

In case it's useful, `lldb`:

```bash
> lldb python
ru(lldb) target create "python"
Current executable set to '/.../bin/python' (arm64).
(lldb) run -c 'from IPython import start_ipython; start_ipython()'
Process 70989 launched: '/.../bin/python' (arm64)
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 10:07:17) [Clang 14.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.33.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from cylp.cy import CyClpSimplex

In [2]: s = CyClpSimplex()

/-- tab pressed right after `s.`; "ClpSimplex...." is output
|
V
In [3]: s.ClpSimplexPrimal or ClpSimplexDual must have been called with correct startFinishOption
Process 70989 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x0000000198b99388 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
-> 0x198b99388 <+8>: b.lo 0x198b993a8 ; <+40>
0x198b9938c <+12>: pacibsp
0x198b99390 <+16>: stp x29, x30, [sp, #-0x10]!
0x198b99394 <+20>: mov x29, sp
Target 0: (python) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
* frame #0: 0x0000000198b99388 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x0000000198bd288c libsystem_pthread.dylib`pthread_kill + 296
frame #2: 0x0000000198adbc60 libsystem_c.dylib`abort + 124
frame #3: 0x0000000104363e98 libClp.1.14.10.dylib`ClpSimplex::getBasics(int*) (.cold.1) + 24
frame #4: 0x00000001042fd224 libClp.1.14.10.dylib`ClpSimplex::getBasics(int*) + 256
frame #5: 0x0000000104548fe0 CyClpSimplex.cpython-312-darwin.so`__pyx_getprop_4cylp_2cy_12CyClpSimplex_12CyClpSimplex_basicVariables(_object*, void*) + 1888
frame #6: 0x00000001000ea460 python`PyObject_GenericGetAttr + 1020
frame #7: 0x000000010019674c python`builtin_getattr + 156
frame #8: 0x00000001001ce7b0 python`_PyEval_EvalFrameDefault + 204604
frame #9: 0x00000001000804a8 python`method_vectorcall + 304
frame #10: 0x00000001001cff38 python`_PyEval_EvalFrameDefault + 210628
frame #11: 0x00000001002d7a70 python`partial_vectorcall + 272
frame #12: 0x00000001001cff38 python`_PyEval_EvalFrameDefault + 210628
frame #13: 0x00000001000804a8 python`method_vectorcall + 304
frame #14: 0x00000001001cff38 python`_PyEval_EvalFrameDefault + 210628
frame #15: 0x000000010008042c python`method_vectorcall + 180
frame #16: 0x00000001002d7a70 python`partial_vectorcall + 272
frame #17: 0x00000001001cb314 python`_PyEval_EvalFrameDefault + 191136
frame #18: 0x000000010007c314 python`PyObject_CallOneArg + 128
frame #19: 0x00000001001be6b4 python`_PyEval_EvalFrameDefault + 138816
frame #20: 0x0000000100098b60 python`gen_iternext + 144
frame #21: 0x00000001000a9e44 python`list_extend + 544
frame #22: 0x00000001000a99c4 python`list_vectorcall + 340
frame #23: 0x00000001001cb314 python`_PyEval_EvalFrameDefault + 191136
frame #24: 0x0000000100098b60 python`gen_iternext + 144
frame #25: 0x00000001001c8644 python`_PyEval_EvalFrameDefault + 179664
frame #26: 0x0000000100098b60 python`gen_iternext + 144
frame #27: 0x00000001001c8644 python`_PyEval_EvalFrameDefault + 179664
frame #28: 0x0000000100098ee8 python`gen_send_ex2 + 196
frame #29: 0x0000000100097f3c python`gen_send_ex + 52
frame #30: 0x000000010009a0e4 python`async_gen_asend_send + 132
frame #31: 0x00000001001aa024 python`_PyEval_EvalFrameDefault + 55216
frame #32: 0x0000000100098ee8 python`gen_send_ex2 + 196
frame #33: 0x0000000100097f3c python`gen_send_ex + 52
frame #34: 0x000000010009a0e4 python`async_gen_asend_send + 132
frame #35: 0x00000001001aa024 python`_PyEval_EvalFrameDefault + 55216
frame #36: 0x0000000100098ee8 python`gen_send_ex2 + 196
frame #37: 0x00000001025710dc _asyncio.cpython-312-darwin.so`task_step_impl + 436
frame #38: 0x0000000102571f80 _asyncio.cpython-312-darwin.so`task_step + 60
frame #39: 0x000000010007b160 python`_PyObject_MakeTpCall + 376
frame #40: 0x00000001001f2764 python`context_run + 104
frame #41: 0x00000001000e345c python`cfunction_vectorcall_FASTCALL_KEYWORDS + 92
frame #42: 0x00000001001cf910 python`_PyEval_EvalFrameDefault + 209052
frame #43: 0x00000001000804a8 python`method_vectorcall + 304
frame #44: 0x00000001001cff38 python`_PyEval_EvalFrameDefault + 210628
frame #45: 0x00000001000804a8 python`method_vectorcall + 304
frame #46: 0x00000001001cff38 python`_PyEval_EvalFrameDefault + 210628
frame #47: 0x000000010019a644 python`PyEval_EvalCode + 260
frame #48: 0x000000010023fa54 python`run_mod + 288
frame #49: 0x00000001002423c0 python`PyRun_SimpleStringFlags + 176
frame #50: 0x0000000100267768 python`Py_RunMain + 800
frame #51: 0x0000000100268be4 python`pymain_main + 552
frame #52: 0x0000000100005000 python`main + 56
frame #53: 0x0000000198832b98 dyld`start + 6076
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the crash from the IPython session using CyClpSimplex and `s.` followed by Tab, then compare it with a regular Python REPL. Use the lldb backtrace as the starting point, especially `CyClpSimplex_basicVariables` and the `getBasics` call in libClp. Done means tab completion no longer aborts the process while normal attribute lookup still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.