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

anki: "Segmentation fault: 11" on macOS #40956

Open
ariutta opened this issue May 23, 2018 · 11 comments
Open

anki: "Segmentation fault: 11" on macOS #40956

ariutta opened this issue May 23, 2018 · 11 comments
Labels
6.topic: darwin Running or building packages on Darwin

Comments

@ariutta
Copy link
Contributor

ariutta commented May 23, 2018

@the-kenny

Issue description

Installed anki on macOS. When I run anki from the Terminal, I get

Segmentation fault: 11

and a window saying "python quit unexpectedly" (see Report at the bottom of this issue).

Steps to reproduce

From command line:

nix-env -iA nixpkgs.anki
anki

Technical details

Results from nix-shell -p nix-info --run "nix-info -m":

 - system: `"x86_64-darwin"`
 - host os: `Darwin 16.7.0, macOS 10.12.6`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 1.11.16`
 - channels(andersriutta): `"nixos-17.09.3254.967e40787c5, nixpkgs-18.09pre140705.090b7cc8f1b"`
 - channels(root): `"nixpkgs-18.03pre122585.b212125b541"`
 - nixpkgs: `/Users/andersriutta/.nix-defexpr/channels/nixpkgs`

The "python quit unexpectedly" error report:

Process:               python2.7 [37680]
Path:                  /nix/*/python
Identifier:            python2.7
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        bash [691]
Responsible:           python2.7 [37680]
User ID:               501

Date/Time:             2018-05-22 19:34:43.678 -0700
OS Version:            Mac OS X 10.12.6 (16G1314)
Report Version:        12


Time Awake Since Boot: 1700 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   CoreFoundation                	0x000000010bc4dd94 CFStringGetLength + 4
1   QtCore                        	0x000000010d44b8ae QCFString::toQString(__CFString const*) + 46
2   QtCore                        	0x000000010d44b9c3 QCFString::operator QString() const + 67
3   QtGui                         	0x000000010e241d6f QApplicationPrivate::appName() const + 287
4   QtGui                         	0x000000010e242443 qt_init(QApplicationPrivate*, int) + 1395
5   QtGui                         	0x000000010e2b74f9 QApplicationPrivate::construct() + 201
6   QtGui                         	0x000000010e2b76cb QApplication::QApplication(int&, char**, int) + 91
7   QtGui.so                      	0x000000010dc4c2a4 init_type_QApplication(_sipSimpleWrapper*, _object*, _object*, _object**, _object**, _object**) + 196
8   sip.so                        	0x000000010c87d563 sipSimpleWrapper_init + 195
9   libpython2.7.dylib            	0x000000010ba6702c wrap_init + 12
10  libpython2.7.dylib            	0x000000010ba07e61 PyObject_Call + 97
11  libpython2.7.dylib            	0x000000010bab3f54 PyEval_CallObjectWithKeywords + 164
12  libpython2.7.dylib            	0x000000010ba1d3e9 wrapperdescr_call + 217
13  libpython2.7.dylib            	0x000000010ba07e61 PyObject_Call + 97
14  libpython2.7.dylib            	0x000000010baabfca PyEval_EvalFrameEx + 9530
15  libpython2.7.dylib            	0x000000010baa9803 PyEval_EvalCodeEx + 1635
16  libpython2.7.dylib            	0x000000010ba2e504 function_call + 372
17  libpython2.7.dylib            	0x000000010ba07e61 PyObject_Call + 97
18  libpython2.7.dylib            	0x000000010ba150f2 instancemethod_call + 178
19  libpython2.7.dylib            	0x000000010ba07e61 PyObject_Call + 97
20  libpython2.7.dylib            	0x000000010ba66f9f slot_tp_init + 175
21  libpython2.7.dylib            	0x000000010ba630e9 type_call + 313
22  libpython2.7.dylib            	0x000000010ba07e61 PyObject_Call + 97
23  libpython2.7.dylib            	0x000000010baabfca PyEval_EvalFrameEx + 9530
24  libpython2.7.dylib            	0x000000010bab4631 fast_function + 337
25  libpython2.7.dylib            	0x000000010baabdd9 PyEval_EvalFrameEx + 9033
26  libpython2.7.dylib            	0x000000010bab4631 fast_function + 337
27  libpython2.7.dylib            	0x000000010baabdd9 PyEval_EvalFrameEx + 9033
28  libpython2.7.dylib            	0x000000010baa9803 PyEval_EvalCodeEx + 1635
29  libpython2.7.dylib            	0x000000010baa9192 PyEval_EvalCode + 34
30  libpython2.7.dylib            	0x000000010bad69ed PyRun_FileExFlags + 157
31  libpython2.7.dylib            	0x000000010bad6510 PyRun_SimpleFileExFlags + 816
32  libpython2.7.dylib            	0x000000010baeaa8c Py_Main + 3452
33  libdyld.dylib                 	0x00007fffc336c235 start + 1

Thread 1:
0   libsystem_kernel.dylib        	0x00007fffc349b44e __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fffc358548e _pthread_wqthread + 1023
2   libsystem_pthread.dylib       	0x00007fffc358507d start_wqthread + 13

Thread 2:
0   libsystem_kernel.dylib        	0x00007fffc349b44e __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fffc358548e _pthread_wqthread + 1023
2   libsystem_pthread.dylib       	0x00007fffc358507d start_wqthread + 13

Thread 3:
0   libsystem_pthread.dylib       	0x00007fffc3585070 start_wqthread + 0
1   ???                           	0x6d68537365636e65 0 + 7883642902799412837

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x6e35c5cc0da700bc  rbx: 0x006e6f6874797065  rcx: 0x0000000000000000  rdx: 0x0000000000003fd0
  rdi: 0x006e6f6874797065  rsi: 0x006e6f6874797065  rbp: 0x00007fff5420bb30  rsp: 0x00007fff5420bb30
   r8: 0x0000000000000000   r9: 0x0000000000000f6d  r10: 0x0000000000000001  r11: 0x0000000000000003
  r12: 0x0000000000000001  r13: 0x000000010d5b73b0  r14: 0x00007fff5420bb80  r15: 0x00007fff5420bb80
  rip: 0x000000010bc4dd94  rfl: 0x0000000000010206  cr2: 0x0000700006067c38
  
Logical CPU:     2
Error Code:      0x00000000
Trap Number:     13
@matthewbauer
Copy link
Member

matthewbauer commented May 23, 2018

I looked into this a while back and ultimately could not find the issue. I think it has something to do with mixing CoreFoundation SDKs (10.11 vs 10.12).

@ariutta
Copy link
Contributor Author

ariutta commented May 24, 2018

Yeah, it's confusing. Do you know whether it works on v10.11?

@matthewbauer
Copy link
Member

Actually can you try the suggestion in #21681? I think that still works.

@ariutta
Copy link
Contributor Author

ariutta commented May 25, 2018

I ran this from the command line:

DYLD_FRAMEWORK_PATH=/System/Library/Frameworks `nix-build '<nixpkgs>' -A anki --no-out-link`/bin/anki

and this time, Anki did open. However, I got a message in the terminal:

2018-05-24 16:56:57.564 python[724:8044] modalSession has been exited prematurely - check for a reentrant call to endModalSession:

and Anki displayed this message:
anki-error

Could these issues be unrelated to the initial issue? When I couldn't get Anki working via Nix, I installed it using the Anki for Mac DMG. Is there a lockfile or something that could be causing these new messages?

@ariutta
Copy link
Contributor Author

ariutta commented May 25, 2018

Appears to be the message from here in the code.

@matthewbauer
Copy link
Member

Yeah try this:

rm -rf ~/Library/Application\ Support/Anki2

@ariutta
Copy link
Contributor Author

ariutta commented May 25, 2018

Thanks. I tried deleting the Anki2 directory, and I got the normal setup prompts (language, etc.) without the "Please ensure..." message. But when I closed and re-opened, I got the "Please ensure..." message again.

@ariutta
Copy link
Contributor Author

ariutta commented May 25, 2018

I also got the "Please ensure..." message when I tried starting Anki with with an option specifying my profile:

DYLD_FRAMEWORK_PATH=/System/Library/Frameworks nix-build '<nixpkgs>' -A anki --no-out-link/bin/anki -p andersriutta

When I open Anki while holding down shift (skip automatic syncing and addon loading), I get an Import window, but I don't get the "Please ensure..." message.

Maybe related: inside the DMG from ankiweb, there are files like

  • Anki.app/Contents/Info.plist (has variables like PyRuntimeLocations and PythonExecutable)
  • Anki.app/Contents/Resources/__boot__.py
  • Anki.app/Contents/Resources/ankiqtmac.py

Do we need to start Anki using those files instead of just running the command you specified?

@ariutta
Copy link
Contributor Author

ariutta commented May 25, 2018

The keepassxc package is an example of a QT application that works well on macOS. Anything from there that would be applicable to this Anki package?

@prusnak prusnak added the 6.topic: darwin Running or building packages on Darwin label May 9, 2020
@stale
Copy link

stale bot commented Nov 5, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 5, 2020
@euank
Copy link
Member

euank commented Apr 12, 2023

I updated the anki package (#221229), and now it doesn't even build on macOS at all 😬

Anki these days uses "qtwebengine" to render basically everything, and, well, I believe both qt5's and qt6's qtwebengine are broken (see #183383 for qt5, I don't know that there's an issue for qt6's).

Once nixpkg's qtwebengine builds on macOS, it's possible anki will work, but the first step is qtwebengine.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

4 participants