Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.2k
Open
Description
Crash report
What happened?
The following code will segfault on Python 3.13, 3.14 and main (3.15).
importosos.pathconf(-1,1)
Backtrace
Program received signal SIGSEGV, Segmentation fault.#0 __pathconf (file=0x0, name=name@entry=1) at ../sysdeps/unix/sysv/linux/pathconf.c:58#1 0x00005555561fd98d in os_pathconf_impl (module=0x7ccff6fecd20, path=0x7bfff5d00040, name=1) at ./Modules/posixmodule.c:14335#2 os_pathconf (module=<optimized out>, args=0x7bfff5dfff28, nargs=<optimized out>, kwnames=<optimized out>) at ./Modules/clinic/posixmodule.c.h:10539#3 0x0000555555bfa45c in cfunction_vectorcall_FASTCALL_KEYWORDS (func=func@entry=0x7c7ff7065bc0, args=args@entry=0x7bfff5dfff28, nargsf=nargsf@entry=9223372036854775810, kwnames=kwnames@entry=0x0) at Objects/methodobject.c:465#4 0x0000555555ad5f80 in _PyObject_VectorcallTstate (tstate=0x555556a159c8 <_PyRuntime+360584>, callable=0x7c7ff7065bc0, args=0x7bfff5dfff28, nargsf=9223372036854775810, kwnames=0x0) at ./Include/internal/pycore_call.h:136#5 0x0000555555e7399d in _Py_VectorCallInstrumentation_StackRefSteal (callable=..., arguments=<optimized out>, total_args=2, kwnames=..., call_instrumentation=<optimized out>, frame=<optimized out>, this_instr=<optimized out>, tstate=<optimized out>) at Python/ceval.c:769#6 0x0000555555eaf560 in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, throwflag=<optimized out>) at Python/generated_cases.c.h:1817#7 0x0000555555e72838 in _PyEval_EvalFrame (tstate=0x555556a159c8 <_PyRuntime+360584>, frame=0x7e8ff6fe5220, throwflag=0) at ./Include/internal/pycore_ceval.h:118#8 _PyEval_Vector (tstate=<optimized out>, func=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, kwnames=0x0) at Python/ceval.c:2132#9 0x0000555555e72255 in PyEval_EvalCode (co=<optimized out>, globals=<optimized out>, locals=0x7c7ff70893c0) at Python/ceval.c:680#10 0x000055555613d66f in run_eval_code_obj (tstate=tstate@entry=0x555556a159c8 <_PyRuntime+360584>, co=co@entry=0x7d1ff7019650, globals=globals@entry=0x7c7ff70893c0, locals=locals@entry=0x7c7ff70893c0) at Python/pythonrun.c:1366#11 0x000055555613c83c in run_mod (mod=<optimized out>, filename=<optimized out>, globals=<optimized out>, locals=<optimized out>, flags=<optimized out>, arena=<optimized out>, interactive_src=<optimized out>, generate_new_source=<optimized out>) at Python/pythonrun.c:1469#12 0x0000555556136e3d in pyrun_file (fp=fp@entry=0x7d4ff6fef800, filename=filename@entry=0x7ccff6ffbbf0, start=start@entry=257, globals=globals@entry=0x7c7ff70893c0, locals=locals@entry=0x7c7ff70893c0, closeit=closeit@entry=1, flags=0x7bfff5e1eb10) at Python/pythonrun.c:1294#13 0x000055555613499d in _PyRun_SimpleFileObject (fp=<optimized out>, filename=<optimized out>, closeit=<optimized out>, flags=<optimized out>) at Python/pythonrun.c:518#14 0x0000555556133d0e in _PyRun_AnyFileObject (fp=fp@entry=0x7d4ff6fef800, filename=filename@entry=0x7ccff6ffbbf0, closeit=closeit@entry=1, flags=flags@entry=0x7bfff5e1eb10) at Python/pythonrun.c:81#15 0x00005555561b215b in pymain_run_file_obj (program_name=0x7caff7027bc0, filename=0x7ccff6ffbbf0, skip_source_first_line=0) at Modules/main.c:410#16 pymain_run_file (config=0x5555569e0a48 <_PyRuntime+143624>) at Modules/main.c:429#17 0x00005555561b0224 in pymain_run_python (exitcode=0x7bfff5e1e700) at Modules/main.c:691#18 Py_RunMain () at Modules/main.c:772#19 0x00005555561b1127 in pymain_main (args=<optimized out>) at Modules/main.c:802#20 0x00005555561b1298 in Py_BytesMain (argc=<optimized out>, argv=0x7fffffffdb48) at Modules/main.c:826#21 0x00007ffff7c2a575 in __libc_start_call_main (main=main@entry=0x55555590bc40 <main>, argc=argc@entry=2, argv=argv@entry=0x7fffffffdb48) at ../sysdeps/nptl/libc_start_call_main.h:58#22 0x00007ffff7c2a628 in __libc_start_main_impl (main=0x55555590bc40 <main>, argc=2, argv=0x7fffffffdb48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdb38) at ../csu/libc-start.c:360#23 0x00005555558224f5 in _start ()CPython versions tested on:
CPython main branch, 3.14, 3.13
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.15.0a6+ (heads/main-dirty:5e61a16c105, Feb 24 2026, 19:33:58) [Clang 21.1.2 (2ubuntu6)]
Linked PRs
- gh-145335: validate file descriptor in os.fpathconf and os.pathconf #145341
- gh-145335: Fix crash when passing -1 as fd in os.pathconf #145390
- [3.13] gh-145335: Fix crash when passing -1 as fd in os.pathconf (GH-145390) #145432
- [3.14] gh-145335: Fix crash when passing -1 as fd in os.pathconf (GH-145390) #145433
- gh-145335: Fix os functions when passing fd -1 as path #145439