I am using a Raspberry Pi:

pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.3 (stretch)
Release:        9.3
Codename:       stretch

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

pi@raspberrypi:~ $ chromium-browser --version
Chromium 60.0.3112.89 Built on Ubuntu 14.04, running on Raspbian 9.3

I want to run a python script whenever the Raspberry Pi boots up and also open the Chromium browser to interact with the user for the running python script. Here is how I do so:

In /home/pi/.config/lxsession/LXDE-pi folder there is a file called autostart in which I added @lxterminal at the bottom of the file. This line opens terminal automatically whenever the Raspberry Pi boots up.

Then I added python /home/pi/dev/server.py & chromium-browser --kiosk http://localhost:5000 at the bottom of the .bashrc file right before the last line. This runs my python script (which runs 3 Threads) AND opens chromium browser in fullscreen and opens http://localhost:5000 URL.

This whole thing makes my program to be run and do what I expect from it. But there's a problem when the program starts to work. Ok, when my Raspberry Pi boots up, I get what I want and it works for a while, but then after a random time which varies from 30 seconds up to 10 minutes, I get the error.

- SocketIO and Flask [ONLINE] 
- Fingerprint worker [ONLINE] 
- RFID worker        [ONLINE] 
[1771:1771:0521/104736.708166:ERROR:sandbox_linux.cc(344)] InitializeSandbox() called with multiple threads in process gpu-process.
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_innerself.run()
...[Some Traceback]...
[1:8:0521/104851.968154:FATAL:memory_linux.cc(35)] Out of memory.
#0 0x000002157eb0 <unknown>
#1 0x00000216f210 <unknown>
#2 0x00000218f9ec <unknown>
#3 0x0000021e517c <unknown>
#4 0x00000284e2a4 <unknown>
#5 0x000002a10db4 <unknown>
#6 0x000002a114a8 <unknown>
#7 0x0000028a7878 <unknown>
#8 0x0000028a2820 <unknown>
#9 0x00000284a18c <unknown>
#10 0x00000284a5d0 <unknown>
#11 0x0000029eec9c <unknown>
#12 0x00000272089c <unknown>
#13 0x000002c3cefc <unknown>
#14 0x000002c3c4b8 <unknown>
#15 0x000002c3a8dc <unknown>
#16 0x000002c3a6c0 <unknown>
#17 0x000002f09d4c <unknown>
#18 0x000002f099bc <unknown>
#19 0x000002f090f0 <unknown>
#20 0x000002f06b20 <unknown>
#21 0x000002f360b4 <unknown>
#22 0x00000479de20 <unknown>
#23 0x00000479d200 <unknown>
#24 0x0000021bb930 <unknown>
#25 0x0000021b7948 <unknown>

Received signal 6
#0 0x000002157eb0 <unknown>
#1 0x000002157e20 <unknown>
#2 0x00007553f6c0 <unknown>
#3 0x00007553e45c gsignal
[end of stack trace]
Calling _exit(1). Core file will not be generated.

Where is the problem and how can I solve that?

  • 2
    "Then I added python /home/pi/dev/server.py & chromium-browser --kiosk localhost:5000 at the bottom of the .bashrc" -> That's not what .bashrc is for. That this is an OOM error implies you're repeatedly spawning chromium instances via that, because .bashrc may be run any number of times. It is not a system initialisation script, see INVOCATION in man bash. – goldilocks Jul 22 '19 at 20:50