Open kseuro opened 4 months ago
Thanks for reporting this. The only thing I can think of is the python configuration. Can you make sure that the python related environment variables are the same on your vscode terminal and on your Iterm2? I know that VSCode sometimes sets some python environment automatically.
Thanks for the reply.
When I enter which python
in iTerm
or VSCode, after activating the max
conda environment I installed via this guide, I get miniconda3/envs/max/bin/python
.
It's a bit confusing because I can run other .mojo
scripts using VSCode's built-in terminal; for instance, this reproduction of the MatMul example consistently works in iTerm
and VSCode. The above posted merge sort will occasionally crash in VSCode but always succeed in iTerm
. So how can it be that the scripts are sometimes executed successfully and sometimes encounter a segfault? I'm no expert but this feels like a system level problem.
Could you run env
on both terminals and share the output here? Feel free to erase sensitive information. This might help us get to the core of the issue
Sure, here is the output of env
. I've replaced my user path with the placeholder ..
.
TERM_PROGRAM=tmux
TERM=screen-256color
SHELL=/bin/bash
TMPDIR=/var/folders/y_/r_vf3lkx5h1_2ldljw8z99xm0000gn/T/
CONDA_SHLVL=8
TERM_PROGRAM_VERSION=3.4
CONDA_PROMPT_MODIFIER=(max)
OLDPWD=../projects/modular/max
TERM_SESSION_ID=w0t0p0:5A443A7B-A3FB-4F7B-BEF1-BA2501BD110F
USER=..
COMMAND_MODE=unix2003
CONDA_EXE=../miniconda3/bin/conda
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.gNk9uvBdP4/Listeners
__CF_USER_TEXT_ENCODING=0x0:0:0
CONDA_PREFIX_5=../miniconda3
TERM_FEATURES=T3LrMSc7UUw9Ts3BFGsSyHNoSxF
CONDA_PREFIX_4=../miniconda3/envs/max
CONDA_PREFIX_7=../miniconda3
TMUX=/private/tmp/tmux-501/default,14905,0
CONDA_PREFIX_6=../miniconda3/envs/max
_CE_CONDA=
CONDA_PREFIX_1=../miniconda3
TERMINFO_DIRS=/Applications/iTerm.app/Contents/Resources/terminfo:/usr/share/terminfo
PATH=../.modular/pkg/packages.modular.com_max/bin:../.modular/pkg/packages.modular.com_max/bin:../.modular/pkg/packages.modular.com_max/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/opt/llvm/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:../.modular/pkg/packages.modular.com_max/bin:../miniconda3/envs/max/bin:../miniconda3/condabin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/opt/llvm/bin:/Applications/iTerm.app/Contents/Resources/utilities
CONDA_PREFIX_3=../miniconda3
CONDA_PREFIX_2=../miniconda3/envs/max
LaunchInstanceID=01BD2081-B110-4464-A91E-9D62746AECF3
__CFBundleIdentifier=com.googlecode.iterm2
CONDA_PREFIX=../miniconda3/envs/max
PWD=../projects/modular/max/examples/inference/bert-python-torchscript
LANG=en_US.UTF-8
XPC_FLAGS=0x0
TMUX_PANE=%0
_CE_M=
XPC_SERVICE_NAME=0
SHLVL=2
HOME=..
COLORFGBG=15;0
LC_TERMINAL_VERSION=3.5.3
ITERM_SESSION_ID=w0t0p0:5A443A7B-A3FB-4F7B-BEF1-BA2501BD110F
LOGNAME=..
CONDA_PYTHON_EXE=../miniconda3/bin/python
MODULAR_HOME=../.modular
CONDA_DEFAULT_ENV=max
LC_TERMINAL=iTerm2
SECURITYSESSIONID=186ac
COLORTERM=truecolor
_=/usr/bin/env
Cool. Could you also share the env of the other terminal? I'm looking for discrepancies that can explain the issue.
Bug description
Running a mojo script using VSCode's integrated terminal produces a segmentation fault but that same script runs successfully if executed using either
iTerm
or the MacTerminal
application.Stack Trace
Executing the same script (detailed below) ends with two different outcomes.
VSCode Terminal
iTerm or Terminal App
Steps to reproduce
Minimal Code Example
System information