Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on macOS Python 3.12 #155

Open
pavpanchekha opened this issue May 29, 2024 · 3 comments
Open

Segmentation fault on macOS Python 3.12 #155

pavpanchekha opened this issue May 29, 2024 · 3 comments

Comments

@pavpanchekha
Copy link

I'm using Python 3.12.3 (installed through Homebrew) on macOS 14.5 and seem to be getting a segmentation fault when trying to import playsound:

$ python3.12 --version
Python 3.12.3
$ python3.12 -m playsound
segmentation fault: 11

The same doesn't happen on Python 3.11:

$ python3.11 --version
Python 3.11.9
$ python3.11 -m playsound
Traceback (most recent call last):
  ...
IndexError: list index out of range

I am using playsound version 1.3.0, installed via pip, for both Python versions. The stack trace is kinda long but in case it's useful here it is:

Click this text to see the full stack trace
Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   Python                        	       0x1013b6be8 PyObject_CallOneArg + 68
1   Python                        	       0x1014ca5dc _PyErr_CreateException + 68
2   Python                        	       0x1014ca84c _PyErr_SetObject + 128
3   Python                        	       0x1014cc3fc PyErr_Format + 104
4   _objc.cpython-312-darwin.so   	       0x100e4d6d8 class_getattro + 1084
5   Python                        	       0x10140c668 PyObject_GetAttr + 68
6   Python                        	       0x10140c5a0 PyObject_GetAttrString + 88
7   _objc.cpython-312-darwin.so   	       0x100e4ddd0 class_setattro + 72
8   Python                        	       0x10140ca84 PyObject_SetAttr + 124
9   Python                        	       0x10140c970 PyObject_SetAttrString + 144
10  _objc.cpython-312-darwin.so   	       0x100e4cdf4 PyObjCClass_New + 960
11  _objc.cpython-312-darwin.so   	       0x100e4cb50 PyObjCClass_New + 284
12  _objc.cpython-312-darwin.so   	       0x100e4cb50 PyObjCClass_New + 284
13  _objc.cpython-312-darwin.so   	       0x100e4cb50 PyObjCClass_New + 284
14  _objc.cpython-312-darwin.so   	       0x100e67d18 PyObjC_RegisterMethodMapping + 72
15  _objc.cpython-312-darwin.so   	       0x100e0b538 PyObjC_setup_nsdecimal + 236
16  _objc.cpython-312-darwin.so   	       0x100e491d8 PyInit__objc + 368
17  Python                        	       0x1014e2540 _PyImport_LoadDynamicModuleWithSpec + 524
18  Python                        	       0x1014e1944 _imp_create_dynamic + 168
19  Python                        	       0x1014070a8 cfunction_vectorcall_FASTCALL + 96
20  Python                        	       0x1014ac3c0 _PyEval_EvalFrameDefault + 50548
21  Python                        	       0x1013b7e30 object_vacall + 212
22  Python                        	       0x1013b7d10 PyObject_CallMethodObjArgs + 104
23  Python                        	       0x1014df160 PyImport_ImportModuleLevelObject + 1084
24  Python                        	       0x10149add8 builtin___import__ + 172
25  Python                        	       0x1014071b0 cfunction_vectorcall_FASTCALL_KEYWORDS + 92
26  Python                        	       0x1014ac3c0 _PyEval_EvalFrameDefault + 50548
27  Python                        	       0x1013b7e30 object_vacall + 212
28  Python                        	       0x1013b7d10 PyObject_CallMethodObjArgs + 104
29  Python                        	       0x1014df080 PyImport_ImportModuleLevelObject + 860
30  Python                        	       0x1014a7fa4 _PyEval_EvalFrameDefault + 33112
31  Python                        	       0x10149fbdc PyEval_EvalCode + 184
32  Python                        	       0x10149c47c builtin_exec + 416
33  Python                        	       0x1014071b0 cfunction_vectorcall_FASTCALL_KEYWORDS + 92
34  Python                        	       0x1014ac3c0 _PyEval_EvalFrameDefault + 50548
35  Python                        	       0x1013b7e30 object_vacall + 212
36  Python                        	       0x1013b7d10 PyObject_CallMethodObjArgs + 104
37  Python                        	       0x1014df160 PyImport_ImportModuleLevelObject + 1084
38  Python                        	       0x1014a7fa4 _PyEval_EvalFrameDefault + 33112
39  Python                        	       0x10149fbdc PyEval_EvalCode + 184
40  Python                        	       0x10149c47c builtin_exec + 416
41  Python                        	       0x1014071b0 cfunction_vectorcall_FASTCALL_KEYWORDS + 92
42  Python                        	       0x1014ac3c0 _PyEval_EvalFrameDefault + 50548
43  Python                        	       0x1013b7e30 object_vacall + 212
44  Python                        	       0x1013b7d10 PyObject_CallMethodObjArgs + 104
45  Python                        	       0x1014df160 PyImport_ImportModuleLevelObject + 1084
46  Python                        	       0x1014a7fa4 _PyEval_EvalFrameDefault + 33112
47  Python                        	       0x10149fbdc PyEval_EvalCode + 184
48  Python                        	       0x10149c47c builtin_exec + 416
49  Python                        	       0x1014071b0 cfunction_vectorcall_FASTCALL_KEYWORDS + 92
50  Python                        	       0x1014ac3c0 _PyEval_EvalFrameDefault + 50548
51  Python                        	       0x1013b7e30 object_vacall + 212
52  Python                        	       0x1013b7d10 PyObject_CallMethodObjArgs + 104
53  Python                        	       0x1014df160 PyImport_ImportModuleLevelObject + 1084
54  Python                        	       0x1014a7fa4 _PyEval_EvalFrameDefault + 33112
55  Python                        	       0x10149fbdc PyEval_EvalCode + 184
56  Python                        	       0x10149c47c builtin_exec + 416
57  Python                        	       0x1014071b0 cfunction_vectorcall_FASTCALL_KEYWORDS + 92
58  Python                        	       0x1014ac3c0 _PyEval_EvalFrameDefault + 50548
59  Python                        	       0x1013b7e30 object_vacall + 212
60  Python                        	       0x1013b7d10 PyObject_CallMethodObjArgs + 104
61  Python                        	       0x1014df160 PyImport_ImportModuleLevelObject + 1084
62  Python                        	       0x1014a7fa4 _PyEval_EvalFrameDefault + 33112
63  Python                        	       0x10149fbdc PyEval_EvalCode + 184
64  Python                        	       0x10149c47c builtin_exec + 416
65  Python                        	       0x1014071b0 cfunction_vectorcall_FASTCALL_KEYWORDS + 92
66  Python                        	       0x1014aa80c _PyEval_EvalFrameDefault + 43456
67  Python                        	       0x1015218b0 pymain_run_module + 200
68  Python                        	       0x1015212c8 Py_RunMain + 720
69  Python                        	       0x1015214b0 Py_BytesMain + 40
70  dyld                          	       0x1847aa0e0 start + 2360

I can try to debug more using the Python GDB scripts if it's helpful or not a known bug.

@jowodo
Copy link

jowodo commented Nov 3, 2024

have you tried downgrading to pip install playsound==1.2.2?

@pavpanchekha
Copy link
Author

Downgrading to playsound 1.2.2 seems to work:

$ python3.12 --version   
Python 3.12.7
$ python3.12 -m playsound
$

The lack of an output means it didn't segfault.

@jowodo
Copy link

jowodo commented Nov 4, 2024

Unfortunately, I couldn't get playsound running on my macos 14.05 because AppKit is not found.
The current implementation assumes python2.7. Installing PyObjC might work. I'll test later ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants