[issue36236] Python crash on macOS when CWD is invalid

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for sorting this out, Victor! -- resolution: -> fixed ___ Python tracker ___ ___

[issue36236] Python crash on macOS when CWD is invalid

2019-03-24 Thread STINNER Victor
STINNER Victor added the comment: > The fix for 3.7 works too: no more crashing. Thanks, everyone! I planned to test, but I had no access to macOS last years. Thanks for testing Ned. Good to hear that the bug is now fixed in 3.7 and master. --

[issue36236] Python crash on macOS when CWD is invalid

2019-03-24 Thread Ned Deily
Ned Deily added the comment: The fix for 3.7 works too: no more crashing. Thanks, everyone! -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread STINNER Victor
STINNER Victor added the comment: Pablo: Oh ok, thanks for testing. I fixed 3.7 as well. Would you mind to validate my fix? -- ___ Python tracker ___

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset f7959a9fe7e7e316899c60251e29390c4ed0307a by Victor Stinner in branch '3.7': bpo-36236: Handle removed cwd at Python init (GH-12450) https://github.com/python/cpython/commit/f7959a9fe7e7e316899c60251e29390c4ed0307a --

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +12404 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Yup: ~ ❯ cd /tmp /tmp ❯ mkdir check /tmp ❯ cd check /tmp/check ❯ rm -rf ../check /tmp/check ❯ python3.7 -m pdb Fatal Python error: pymain_compute_path0: memory allocation failed ValueError: character U+e0895f00 is not in range [U+; U+10]

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread STINNER Victor
STINNER Victor added the comment: Pablo: is Python 3.7 affected by the issue? -- ___ Python tracker ___ ___ Python-bugs-list

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset fc96e5474a7bda1c5dec66420e4467fc9f7ca968 by Victor Stinner in branch 'master': bpo-36236: Fix _PyPathConfig_ComputeSysPath0() for empty argv (GH-12441) https://github.com/python/cpython/commit/fc96e5474a7bda1c5dec66420e4467fc9f7ca968

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: It seems to work: ❯ uname -a Darwin C02VL073HTDG 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64 ❯ pwd /tmp/check /tmp/check ❯ rm -rf ../check /tmp/check ❯ ~/github/cpython/python.exe -m

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +12396 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread STINNER Victor
STINNER Victor added the comment: Can someone please on macOS to confirm that the bug is fixed? -- ___ Python tracker ___ ___

[issue36236] Python crash on macOS when CWD is invalid

2019-03-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset dcf617152e1d4c4a5e7965733928858a9c0936ca by Victor Stinner in branch 'master': bpo-36236: Handle removed cwd at Python init (GH-12424) https://github.com/python/cpython/commit/dcf617152e1d4c4a5e7965733928858a9c0936ca --

[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +12379 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Yup. But what is the best way to signal the caller that _PyPathConfig_ComputeArgv0 has failed because _Py_wgetcwd has failed without changing the API massively? Right now if _PyPathConfig_ComputeArgv0 returns null is assumed that is due to a memory

[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread STINNER Victor
STINNER Victor added the comment: Oh. It seems like I misunderstood the issue. I read "argv0" as sys.argv[0], but _PyPathConfig_ComputeArgv0 is used to insert a value at the start of sys.path. That's different... If the current directory has been removed, sys.path should just be left

[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: If we set argv0 to ".": if (_Py_wgetcwd(fullpath, Py_ARRAY_LENGTH(fullpath))) { argv0 = fullpath; n = wcslen(argv0); } else { argv0 = L"."; n = 1;

[issue36236] Python crash on macOS when CWD is invalid

2019-03-18 Thread STINNER Victor
STINNER Victor added the comment: > Omitting it from sys.path in that case makes sense to me, but I'm not sure > what sys.argv[0] should be set to. I propose to use ".". It would be consistent with platforms which doesn't implement realpath: if (have_module_arg) { #if

[issue36236] Python crash on macOS when CWD is invalid

2019-03-16 Thread Nick Coghlan
Nick Coghlan added the comment: Omitting it from sys.path in that case makes sense to me, but I'm not sure what sys.argv[0] should be set to. -- ___ Python tracker ___

[issue36236] Python crash on macOS when CWD is invalid

2019-03-12 Thread STINNER Victor
Change by STINNER Victor : -- versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36236] Python crash on macOS when CWD is invalid

2019-03-12 Thread STINNER Victor
STINNER Victor added the comment: _Py_wgetcwd() call has been introduced by the following commit: commit ee3784594b33c72c3fdca6a71892d22f14045ab6 Author: Nick Coghlan Date: Sun Mar 25 23:43:50 2018 +1000 bpo-33053: -m now adds *starting* directory to sys.path (GH-6231) (#6236)

[issue36236] Python crash on macOS when CWD is invalid

2019-03-08 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36236] Python crash on macOS when CWD is invalid

2019-03-08 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +12224 stage: -> patch review ___ Python tracker ___ ___

[issue36236] Python crash on macOS when CWD is invalid

2019-03-08 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This is happening because _Py_wgetcwd returns NULL (although the underliying getcwd system call populates the `fullpath` variable correctly) but its caller, _PyPathConfig_ComputeArgv0, does not check the return value:

[issue36236] Python crash on macOS when CWD is invalid

2019-03-08 Thread László Kiss Kollár
New submission from László Kiss Kollár : CPython crashes with "pymain_compute_path0: memory allocation failed" when attempting to execute it with a library module from a previously deleted directory. To reproduce: cd ~/tmp/python_crash rm -rf ~/tmp/python_crash python3.7 -m pdb Fatal