Bila anda mendapati error

$ ./standard-notes-3.6.8-linux-x86_64.AppImage
A JavaScript error occurred in the main process
Uncaught Exception:
Error: /tmp/.org.chromium.Chromium.pMekKh: failed to map segment from shared object
    at process.func [as dlopen] (electron/js2c/asar.js:140:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1034:18)
    at Object.func [as .node] (electron/js2c/asar.js:149:18)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/tmp/.mount_standaO2Elbb/resources/app.asar/node_modules/keytar/lib/keytar.js:1:14)
    at Module._compile (internal/modules/cjs/loader.js:967:30)

bila dilihat baris Error: /tmp/.org.chromium.Chromium.pMekKh: failed to map segment from shared object aplikasi electron yang dijalankan mau menjalankan proses di /tmp yang merupakan temporary folder (Tong sampah) di Linux.

Cek seperti apa folder /tmp tersebut di mount

grep tmp  /etc/fstab

tmpfs folder
dari output diatas, kita ketahui /tmp di mount dengan rw,noexec,nosuid. noexec disini untuk membatasi folder /tmp tidak bisa digunakan untuk menjalankan script, karena biasanya script kiddies menjalankan script dari sini.

Solusi failed to map segment from shared object

Setelah kita ketahui permasalahannya, saatnya untuk menjalankan solusinya. Linux memiliki variable TMPDIR yang bisa digunakan untuk menggantikan folder temporary, buat terlebih dahulu folder tersebut di tempat yang bisa menjalankan proses execute, read dan write. Contohnya di home directory anda

# buat folder tmp
mkdir ~/tmp
TMPDIR=~/tmp

karena variable ini masih bersifat sementara, jadi bisa dijalankan dengan dua format

# langsung di shell tempat anda menjalankan
# TMPDIR=~/tmp
./standard-notes-3.6.8-linux-x86_64.AppImage
# dengan menambahkan variable TMPDIR
TMPDIR=~/tmp ./standard-notes-3.6.8-linux-x86_64.AppImage

output aplikasi tersebut berjalan

> TMPDIR=~/tmp ./standard-notes-3.6.8-linux-x86_64.AppImage 
extServer: Server started at http://127.0.0.1:45653/
12:16:48.066 › Checking for update
12:16:48.152 › Generated new staging user ID: 6d4eebad-c920-5012-9538-cb25f85e8ab0
12:16:48.898 › Checking for update (already in progress)
12:16:49.080 › Found version 3.6.9 (url: standard-notes-3.6.9-linux-x86_64.AppImage)
BackupsManager: Data backup successfully saved: 2021-05-13T05-16-49.847Z.txt
PackageManager: received sync event for: Extensions (undefined) (deleted: undefined)
PackageManager: received sync event for: Batch Manager (undefined) (deleted: undefined)
PackageManager: received sync event for: Extensions (undefined) (deleted: undefined), Batch Manager (undefined) (deleted: undefined)
PackageManager: received sync event for: Extensions (undefined) (deleted: undefined), Batch Manager (undefined) (deleted: undefined)
BackupsManager: Data backup successfully saved: 2021-05-13T05-17-21.886Z.txt

Agar variable TMPDIR tersebut permanent, tambahkan kedalam ~/.bashrc

echo "export TMPDIR=~/tmp" >> ~/.bashrc

lalu reload bashrc

source ~/.bashrc

Last Updated on 8 September 2021 by tommy

Leave a comment

Your email address will not be published. Required fields are marked *