Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lets discuss which shared memory .so library would be downloaded and stored in to resulting ArchlLinux container #228

Closed
JanuszChmiel opened this issue May 4, 2020 · 44 comments

Comments

@JanuszChmiel
Copy link

Yes, It is here. I have spent many many hours while working with ArchLinux. It is really Linux distribution for vide range of users, advanced users, server admins and programmers. BUt There are many applications, which require shared memory. And even their developers have prepared its source code so it contain also alternative development techniques, which do not stricly depend on shared memory, if shared memory will not be available, apps will run slowly. SOme apps even refuse to run if shared memory is not supported.
We do not have to forget, that we must find universal shared memory library. Termux contain one. But it is not for Libc on regulalLinux distros. So there are two shared memory concepts, I do not know about others.
The most reliable and stable is Thepart of Debian no root source code.
It is little compiled .so library. I have intensively tested it with mate and many apps including PCManfm file manager and with Orca.
Sure. Very complex shared memory routines, when app allocate and free too much memory regions are not supported by this .so library. The good example of such app is x11vnc if somebody would try to run it without -noshm option.

Debian no root source is here and excellent .so libraryesto add shared memory support are The part of The source code.

Next shared memory technique is The part of Userland source code.
I do not know its extact name. When I have ttried shared memory library from Pelia it really do its best to support shared memory operations as possible.
You can load this library in The case when some app will call it by adding The following line to /etc/profile or inside other Bash script.

If you want SHM extension to work in Linux chroot - download file libandroid-shmem.so from here:
https://github.com/pelya/cuntubuntu/tree/master/dist
copy it to chroot, set executable flag, and execute this in chroot before other commands:
export LD_PRELOAD=/path/to/libandroid-shmem.so

Hapy working with apps which need shared memory.

@github-actions
Copy link

github-actions bot commented May 4, 2020

Thank you for contributing to make this project better😎 Keep up and follow to solve this issue.

@github-actions
Copy link

github-actions bot commented Jul 4, 2020

Stale issue message

@SDRausty
Copy link
Owner

SDRausty commented Jul 9, 2020

This commit a2e8c54 @JanuszChmiel and upstream may have resolved your issue. You are welcome to comment here.

@SDRausty
Copy link
Owner

find universal shared memory

This commit TermuxArch/TermuxArch@19d112e rewrote memory integration. File knownconfigurations.bash has information regarding proot binds/mounts. @JanuszChmiel could you try testing with setupTermuxArch.bash re to see if this resolves the issue?

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 11, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 11, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 11, 2020 via email

@SDRausty
Copy link
Owner

SDRausty commented Jul 11, 2020

reinstall Arch Linux

There is no need to reinstall. Refresh is sufficient; bash setupTermuxArch.bash re. bash setupTermuxArch.bash h has information.

getting error when using rm -rf arch command.

You can use bash setupTermuxArch.bash purge to remove the installation. bash setupTermuxArch.bash help has information.

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 12, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 12, 2020 via email

@SDRausty
Copy link
Owner

SDRausty commented Jul 12, 2020

I can confirm, that you have professionally solved shared memory support on Arch Linux. And I Am sure that yours revolutionar approach will be signed to various professional books for The students of informatic sciences.

Thank you; I am flattered. It would be nice to see https://en.wikipedia.org/wiki/Special:Search?search=termux published too. This page termux/termux-packages#1930 is the deleted wikipedia Termux page.

Does this commit TermuxArch/TermuxArch@93f2793 resolve the Gdk-WARNING? It adds dev/shmget support. You can run bash setupTermuxArch.bash re to quickly refresh the installation without having to reinstall it.

@SDRausty
Copy link
Owner

SDRausty commented Jul 12, 2020

Really, excellent job and thank you for yours time, which you have invested
to this new feature.

A thank you can also go to @sudomain who helped catalyze this change with pull requests that have also let Termux:API function.

@SDRausty
Copy link
Owner

SDRausty commented Jul 12, 2020

Thank you again very very much.

You are welcome; And I enjoy your assistance very much @JanuszChmiel too. Thank you.

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 13, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 13, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 13, 2020 via email

@SDRausty
Copy link
Owner

This commit TermuxArch/TermuxArch@d12e974 drops shmget support from the PRoot init statement. @JanuszChmiel file knownconfigurations.bash has instructions how to construct the PRoot init statement. Refresh the installation with bash setupTermuxArch.bash re. There is no need to reinstall. Then run startarch c mkdir /dev/shm/shmget and check if this helped.

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 13, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 13, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 14, 2020 via email

@SDRausty
Copy link
Owner

SDRausty commented Jul 16, 2020

Sure, i will be very glad to test and reinstall Arch Linux

@JanuszChmiel this request concerns #237 Android API level 29 which is aka Andoid 10. If your device is Google Android 10 and greater, do you see the same critical error upon fresh install?

error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

EDIT: Disable CheckSpace in pacman.conf. It does not work in chroots.

From https://bbs.archlinux.org/viewtopic.php?id=129661

@SDRausty
Copy link
Owner

This commit TermuxArch/TermuxArch@9cd376d resolves the pacman Errors occurred, no packages were upgraded error.

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 16, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 16, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 16, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 16, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 16, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 16, 2020 via email

@SDRausty
Copy link
Owner

@JanuszChmiel an important issue is semaphore support

Its not possible.
The functions to implement Message Queues and Semaphore Arrays are not available before Nougat. So, this is not possible yet.
Maybe, when we make the minimum API Level 24.

From termux/termux-packages#2427

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 17, 2020 via email

@SDRausty
Copy link
Owner

SDRausty commented Jul 19, 2020

shmget(scanline) failed.
16/07/2020 19:23:49 shmget: Function not implemented

@JanuszChmiel this probably will not improve the error, but it might. Can you run bash setupTermuxArch.bash r to quickly refresh the installation without having to reinstall it to see if these latest commits helped?

@SDRausty
Copy link
Owner

@SDRausty
Copy link
Owner

@JanuszChmiel also can you share results from setupTermuxArch.bash sysinfo?

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 19, 2020 via email

@petkar
Copy link

petkar commented Jul 19, 2020

This may be relevant here. I installed a fresh copy from the TermuxArch/TermuxArch repo a while ago, set up xfce and Firefox doesn't work anymore. I get this error :

?? firefox --verbose
[19565, Main Thread] WARNING: failed to open shm: Permission denied: file /build/firefox/src/firefox-78.0.2/ipc/chromium/src/base/shared_memory_posix.cc, line 246
[1]    19565 segmentation fault  firefox --verbose

It used to work earlier. Any idea how I can fix this?

@SDRausty
Copy link
Owner

It used to work earlier. Any idea how I can fix this?

It should be fixed now. I was awaiting a reply. Thank you for sharing @petkar. Run bash setupTermuxArch.bash r to quickly refresh the installation without having to reinstall it.

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 20, 2020 via email

@petkar
Copy link

petkar commented Jul 20, 2020

Amazing! It got resolved! Appreciate your work mate!

Run bash setupTermuxArch.bash r to quickly refresh the installation without having to reinstall it.

I'm aware of this. My previous installation had an error with xauth (not starting up at all).

xauth:  error in locking authority file /home/realzink/.Xauthority
Could not start Xvnc.

(EE)
Fatal server error:
(EE) Can't read lock file /tmp/.X2-lock

(EE)/usr/lib/Xorg.wrap: Only console users are allowed to run the X server

I installed many packages, was messing with makepkg, fakeroot-tcp and aur, and refreshed my install to keep up with the updates(on the previous installation). After many hours of looking up and checking conflicting packages/configs, I wasn't able to resolve it so I decided to go for the reinstallation.
Now, on this installation, the issue reappeared after refreshing and it was clear that it was the refresh which was causing this issue.
Note that this does not affect the root user (which is why I was able to check if Firefox ran).
It only affected the standard user (Also, I'm able to install aur packages right after copying makepkg.diff because fakeroot was working. Great work!).
Then I tried again after creating a new user with addauser but get the same errors in it again.

[root10:29TermuxArch]$ addauser petkar
cp: cannot open '/root/.l2s..ICEauthority-n0001' for reading: Too many levels of symbolic links
cp: missing file operand
Try 'cp --help' for more information.

 TermuxArch WARNING:  Generated script signal 1 near or at line number 56 by !

addauser  2.0.118 [Exit Signal 201]: DONE
[root10:41TermuxArch]$ q
> startarch l petkar
[petkar10:33~]$ vncserver :3
xauth:  error in locking authority file /home/petkar/.Xauthority
Could not start Xvnc.

(EE)
Fatal server error:
(EE) Can't read lock file /tmp/.X3-lock

Assuming that it might be a problem with copying configs and desperate to keep the installation, I proceeded to create a user with the useradd command.
Unfortunately, I got the same error on it too (xauth: error in locking authority file /home/deepit/.Xauthority).
I don't want to reinstall arch again because setting up packages and my personal configurations take a lot of time. Any idea how I can fix this?
Edit : This isn't an issue with vnc but xauth itself. keys or pci doesn't work in users anymore either.
Edit 2 : A temporary work around to this issue is logging in using startarch c su user instead of startarch l user. This fixed all the errors. Will proceed to troubleshoot this and find out the cause.

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 20, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 20, 2020 via email

@JanuszChmiel
Copy link
Author

JanuszChmiel commented Jul 21, 2020 via email

@SDRausty
Copy link
Owner

Tigervnc work ammazingly even after ArchLinux installation scripts upgrade.

You are welcome @JanuszChmiel and thank for sharing! Please consider submitting a pull request to this archlinuxconfig.bash file and other files if you need too.

You might find this information about pulse-audio that @petkar just shared interesting too.

@JanuszChmiel
Copy link
Author

Thanks to one very advanced C developer, Proot support some shared memory functions. May be that all of functions, which exist on special android-shmem.so library or may be even more.

Here is The link about This important new Proot feature.

termux/proot#89

It is necessary to specifi
--sysvipc
to enable this new Proot feature. I will test it on very simple Bash scripts to install Ubuntu for example and I will try to find out if complex C and C++ apps which support shared memory will work without random crashes.

@SDRausty
Copy link
Owner

--sysvipc

Thank you for sharing @JanuszChmiel; This is a really nice surprise! This 6e29c71 commit adds the --sysvipc option the the PRoot init statement for all user logins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants