Skip to content

Segmentation fault with Free Module Element during multiplication #40282

Open
@whoami730

Description

@whoami730

Steps To Reproduce

sage: R.<x> = QQ[]
sage: M = span( [[x, x^2+1], [1/x, x^3]], R)
sage: B = M._FreeModule_submodule_with_basis_pid__basis
sage: B[0]
(1/x, x^3)
sage: B[0][0] * x
1
sage: B[0] * x

Expected Behavior

Should not crash but provide the correct output as (1, x^4)

Actual Behavior

Crashes (segmentation fault) with following stack trace -

------------------------------------------------------------------------
/home/sahil/miniforge3/envs/sage-dev/lib/python3.12/site-packages/cysignals/signals.cpython-312-x86_64-linux-gnu.so(+0x8ecc) [0x705464fa3ecc]
/home/sahil/miniforge3/envs/sage-dev/lib/python3.12/site-packages/cysignals/signals.cpython-312-x86_64-linux-gnu.so(+0x8f99) [0x705464fa3f99]
/home/sahil/miniforge3/envs/sage-dev/lib/python3.12/site-packages/cysignals/signals.cpython-312-x86_64-linux-gnu.so(+0xb8f7) [0x705464fa68f7]
/lib/x86_64-linux-gnu/libc.so.6(+0x45810) [0x705465845810]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/rings/fraction_field_element.cpython-312-x86_64-linux-gnu.so(+0x2b614) [0x70541bdd1614]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/modules/free_module_element.cpython-312-x86_64-linux-gnu.so(+0x34c37) [0x705410994c37]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/coerce_actions.cpython-312-x86_64-linux-gnu.so(+0x1486e) [0x705410a3f86e]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/categories/action.cpython-312-x86_64-linux-gnu.so(+0xecd0) [0x70546433dcd0]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/categories/action.cpython-312-x86_64-linux-gnu.so(+0x12ee7) [0x705464341ee7]
python3(+0x21204b) [0x6452a2c1d04b]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/coerce_actions.cpython-312-x86_64-linux-gnu.so(+0x18260) [0x705410a43260]
python3(+0x1ff5c5) [0x6452a2c0a5c5]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/coerce_actions.cpython-312-x86_64-linux-gnu.so(+0x1e8f6) [0x705410a498f6]
python3(+0x21204b) [0x6452a2c1d04b]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/parent.cpython-312-x86_64-linux-gnu.so(+0x3d1ed) [0x7054647f01ed]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/parent.cpython-312-x86_64-linux-gnu.so(+0x286c5) [0x7054647db6c5]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/coerce.cpython-312-x86_64-linux-gnu.so(+0x378b5) [0x7054644f78b5]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/coerce.cpython-312-x86_64-linux-gnu.so(+0x19ec4) [0x7054644d9ec4]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/coerce.cpython-312-x86_64-linux-gnu.so(+0x2431d) [0x7054644e431d]
/home/sahil/kaam-ki-cheezein/repozzz/sage/build/cp312/src/sage/structure/element.cpython-312-x86_64-linux-gnu.so(+0x1a8aa) [0x705464f078aa]
python3(PyNumber_Multiply+0x49) [0x6452a2c61ed9]
python3(+0x1139e4) [0x6452a2b1e9e4]
python3(PyEval_EvalCode+0xa1) [0x6452a2cbb4f1]
python3(+0x2ccc8c) [0x6452a2cd7c8c]
python3(+0x1133a7) [0x6452a2b1e3a7]
python3(+0x2c4b0f) [0x6452a2ccfb0f]
python3(+0x2c5db7) [0x6452a2cd0db7]
python3(+0x11418b) [0x6452a2b1f18b]
python3(PyEval_EvalCode+0xa1) [0x6452a2cbb4f1]
python3(+0x2eaafa) [0x6452a2cf5afa]
python3(+0x2e57b5) [0x6452a2cf07b5]
python3(+0x2e2850) [0x6452a2ced850]
python3(_PyRun_SimpleFileObject+0x1ce) [0x6452a2ced56e]
python3(_PyRun_AnyFileObject+0x44) [0x6452a2ced2a4]
python3(Py_RunMain+0x3a2) [0x6452a2cea1c2]
python3(Py_BytesMain+0x37) [0x6452a2ca55d7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2a338) [0x70546582a338]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b) [0x70546582a3fb]
python3(+0x29a47d) [0x6452a2ca547d]
------------------------------------------------------------------------
Attaching gdb to process id <>.

Additional Information

No response

Environment

  • OS: Ubuntu 25.04
  • Sage Version: 10.7.beta6

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions