Skip to content

MPM silently fails when /tmp directory lacks execute permission #147

@bryanjia222

Description

@bryanjia222

Problem Description

MATLAB Package Manager (MPM) silently fails when the /tmp directory lacks execute permission, exiting without any error messages or output, making it extremely difficult for users to diagnose the issue.

Environment Information

  • Operating System: Linux (Ubuntu 24.04)
  • Architecture: x86_64

Steps to Reproduce

  1. Download and setup MPM:

    wget https://www.mathworks.com/mpm/glnxa64/mpm
    chmod +x mpm
  2. Set /tmp directory to noexec:

    sudo mount -o remount,noexec /tmp
  3. Run any MPM command:

    ./mpm --version
    ./mpm install --release=R2025a --destination=~/matlab --products=MATLAB

Actual Behavior

  • MPM command executes and immediately returns to command prompt
  • No output, error messages, or logs are displayed
  • Program fails silently with no indication of the failure reason

Expected Behavior

MPM should:

  1. Detect the execute permission status of the /tmp directory
  2. If /tmp directory lacks execute permission, display a clear error message such as:
    Error: MPM requires execute permission on temporary directory /tmp
    Please ensure /tmp has exec permission or set TMPDIR to a directory with exec permission
    
  3. Provide solution suggestions

Diagnostic Information

Analysis using strace revealed:

  • Program attempts to create and execute temporary files in /tmp/mwse_* directories
  • Due to lack of exec permission on /tmp, the program exits abnormally
  • Exit status is not the normal exit_group(0)

Current Workaround

The current workaround is:

# Temporary fix
sudo mount -o remount,exec /tmp

# Or set a different temporary directory
export TMPDIR=/path/to/writable/executable/dir

Metadata

Metadata

Labels

bugSomething isn't workingmpmMATLAB Package Manager related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions