やるきなし

2019/07/04 23:04 / /usr/lib/mozc/mozc_tool: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

WSL で Debian GNU/Linux を使っている(Windows 10 May 2019 Update でかなり使えるようになったのでもう VMWare いらないかも...)のだが,sid に upgrade したらmozc_toolが以下でコケるようになった.

% /usr/lib/mozc/mozc_tool --mode=config_dialog
/usr/lib/mozc/mozc_tool: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory
% ldd /usr/lib/mozc/mozc_tool | grep 'not found' | uniq
        libQt5Core.so.5 => not found
% LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.3 /usr/lib/mozc/mozc_tool --mode=config_dialog
ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.3' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
/usr/lib/mozc/mozc_tool: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

package libqt5core5a/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.3 は含まれていて,確かに存在するのだが,うまく読み込んでもらえない.解決法は以下.

sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.3 

ちなみに file で違いが確認できるらしい.for GNU/Linux 3.17.0 となっているのが問題ならしい.

% sudo apt reinstall libqt5core5a
% file  /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.3 > 0
% sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.3
% file  /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.3 > 1
% wdiff 0 1
wdiff 0 1
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.3: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=70947cf4ce539861badd2c95e0130074456c9bee, [-for GNU/Linux 3.17.0,-] stripped
% uname -r
4.4.0-18362-Microsoft

手元のWSL環境,Xserver には VcXsrv (multiple windows)を利用.日本語入力は基本的に Emacs のみで OK なので,それ用に emacs-mozc と設定用の mozc-utils-gui を install.いわゆる ibus の mozc を動かすのは断念.Windows の Google 日本語入力と WSL 上の Mozc の両方が動いている謎環境になっている.

参考:

2019/06/28 20:38 / GeForce GT 430 with nvidia-legacy-390xx-kernel-dkms 390.116-1~bpo9+1

Debian GNU/Linux stretch (backports) の NVIDIA のドライバ,古いデバイスと新しいデバイスの混在環境(計算機としては別) で以下を利用していたのだが,418.56 から GeForce GT 430 のサポートがなくなった様子.

ii  nvidia-kernel-dkms              418.56-2~bpo9+1  amd64        NVIDIA binary kernel module DKMS source
ii  nvidia-legacy-340xx-kernel-dkms 340.107-2~bpo9+1 amd64        NVIDIA binary kernel module DKMS source (340xx legacy version)

nvidia-current のドライバを modprobe すると以下のように怒られる.

NVRM: The NVIDIA GeForce GT 430 GPU installed in this system is
NVRM:  supported through the NVIDIA 390.xx Legacy drivers. Please
NVRM:  visit http://www.nvidia.com/object/unix.html for more
NVRM:  information.  The 418.74 NVIDIA driver will ignore
NVRM:  this GPU.  Continuing probe...

ということで nvidia-legacy-340xx-kernel-dkms を purge して nvidia-legacy-390xx-kernel-dkms 390.116-1~bpo9+1 を install.結構コードが 418.56 と似たような感じになっていて,5.1.15 向け patch は以下のような感じ.nvidia-kernel-dkms 410.104-1~bpo9+1 の Linux 5.1 向け patch とほぼ同じ (行数が若干ずれる程度).

diff --git a/common/inc/nv-list-helpers.h b/common/inc/nv-list-helpers.h
index 0aed851..81c2d4e 100644
--- a/common/inc/nv-list-helpers.h
+++ b/common/inc/nv-list-helpers.h
@@ -91,10 +91,12 @@
         list_entry((pos)->member.next, typeof(*(pos)), member)
 #endif
 
+/*
 static inline int list_is_first(const struct list_head *list,
                                 const struct list_head *head)
 {
     return list->prev == head;
 }
+*/
 
 #endif // __NV_LIST_HELPERS_H__
diff --git a/nvidia-drm/nvidia-drm-connector.c b/nvidia-drm/nvidia-drm-connector.c
index 24631c0..e64b9fe 100644
--- a/nvidia-drm/nvidia-drm-connector.c
+++ b/nvidia-drm/nvidia-drm-connector.c
@@ -30,7 +30,7 @@
 #include "nvidia-drm-utils.h"
 #include "nvidia-drm-encoder.h"
 
-#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
diff --git a/nvidia-drm/nvidia-drm-drv.c b/nvidia-drm/nvidia-drm-drv.c
index 1c2db68..90ce30b 100644
--- a/nvidia-drm/nvidia-drm-drv.c
+++ b/nvidia-drm/nvidia-drm-drv.c
@@ -41,7 +41,7 @@
 
 #include <drm/drmP.h>
 
-#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
 
 #if defined(NV_DRM_DRM_GEM_H_PRESENT)
 #include <drm/drm_gem.h>
diff --git a/nvidia-drm/nvidia-drm-encoder.c b/nvidia-drm/nvidia-drm-encoder.c
index f66bbd7..0e5e2a8 100644
--- a/nvidia-drm/nvidia-drm-encoder.c
+++ b/nvidia-drm/nvidia-drm-encoder.c
@@ -31,7 +31,7 @@
 #include "nvidia-drm-crtc.h"
 #include "nvidia-drm-helper.h"
 
-#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
diff --git a/nvidia-drm/nvidia-drm-gem-nvkms-memory.c b/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
index 8636eff..01c6ce4 100644
--- a/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
+++ b/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
@@ -222,7 +222,7 @@ done:
 
 /* XXX Move these vma operations to os layer */
 
-static int __nv_drm_vma_fault(struct vm_area_struct *vma,
+static vm_fault_t __nv_drm_vma_fault(struct vm_area_struct *vma,
                               struct vm_fault *vmf)
 {
     unsigned long address = nv_page_fault_va(vmf);
@@ -268,7 +268,7 @@ static int __nv_drm_vma_fault(struct vm_area_struct *vma,
  */
 
 #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
-static int nv_drm_vma_fault(struct vm_fault *vmf)
+static vm_fault_t nv_drm_vma_fault(struct vm_fault *vmf)
 {
     return __nv_drm_vma_fault(vmf->vma, vmf);
 }
diff --git a/nvidia-uvm/uvm8.c b/nvidia-uvm/uvm8.c
index e00923d..7278415 100644
--- a/nvidia-uvm/uvm8.c
+++ b/nvidia-uvm/uvm8.c
@@ -166,13 +166,13 @@ static void uvm_destroy_vma_semaphore_pool(struct vm_area_struct *vma)
 // If a fault handler is not set, paths like handle_pte_fault in older kernels
 // assume the memory is anonymous. That would make debugging this failure harder
 // so we force it to fail instead.
-static int uvm_vm_fault_sigbus(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t uvm_vm_fault_sigbus(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
     UVM_DBG_PRINT_RL("Fault to address 0x%lx in disabled vma\n", nv_page_fault_va(vmf));
     return VM_FAULT_SIGBUS;
 }
 
-static int uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
+static vm_fault_t uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
 {
 #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
     return uvm_vm_fault_sigbus(vmf->vma, vmf);
@@ -390,7 +390,7 @@ static void uvm_vm_close_managed(struct vm_area_struct *vma)
         uvm_record_unlock_mmap_sem_write(&current->mm->mmap_sem);
 }
 
-static int uvm_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t uvm_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
     uvm_va_space_t *va_space = uvm_va_space_get(vma->vm_file);
     uvm_va_block_t *va_block;
@@ -507,7 +507,7 @@ convert_error:
     }
 }
 
-static int uvm_vm_fault_wrapper(struct vm_fault *vmf)
+static vm_fault_t uvm_vm_fault_wrapper(struct vm_fault *vmf)
 {
 #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
     return uvm_vm_fault(vmf->vma, vmf);

Related articles

2019/06/19 15:05 / Postfix メールの最大サイズ変更

手元の Postfix で大きめのメールが弾かれるので設定./etc/postfix/main.cfmessage_size_limit = 30720000 などと書いて postfix を restart するだけ.

Default は http://www.postfix.org/postconf.5.html のとおり 10240000 (10MByte).

ちなみに,Gmail/Outlook.com のサイズ制限は以下.

2019/06/17 16:32 / rdtool-elisp 0.6.38-4, Symbol's function definition is void: insert-string

ほぼ markdown に移行したのだが,一部 RD を使う場面があって,Emacs の rd-mode を使っているのだが,M-RET (箇条書きItem (*)追加)が以下でコケる.

if: Symbol’s function definition is void: insert-string

手元の Emacs 24.5.1 で f1-f insert-string で確認したところ以下とのことでinsertを使わなければならないらしい.

This function is obsolete since 22.1;
use `insert' instead.

なお insert-string は以下で定義されている(integerであればstringに変換のうえinsertする).

(defun insert-string (&rest args)
  "Mocklisp-compatibility insert function.
Like the function `insert' except that any argument that is a number
is converted into a string by expressing it in decimal."
  (declare (obsolete insert "22.1"))
  (dolist (el args)
    (insert (if (integerp el) (number-to-string el) el))))

github では https://github.com/uwabami/rdtool/commit/9879b190716b43ff5801782ddf2de65b0a5893ef で修正されているようだが Debian Package はまだのようで,ひとまず ~/.emacs に以下を書いておく.

(defun rd-intelligent-newline ()
  (interactive)
  (let (item)
    (setq item
          (save-excursion (rd-search-last-listitem) )
          )
    (end-of-line)
    (newline)
    (if item (insert item) )
    )
  )

Related articles

2019/06/12 16:10 / Linux 5.1.8 -> 5.2-rc4

Linux 5.2 の準備のため,.configがどう変更されるのか見てみた.以下 - は削除されたもの,+ は追加されたもの.x86_64.

追加

ほか

削除

追記 (2019/7/13)

nvidia-kernel-dkms 418.74-1 と nvidia-legacy-390xx-kernel-dkms 390.116-1 で,以下の箇所で compile に失敗する(Linux 5.2.0).mm: introduce put_user_page*(), placeholder versions

/var/lib/dkms/nvidia-current/418.74/build/nvidia-uvm/uvm8_tools.c:209:13: error: conflicting types for ‘put_user_pages’
 static void put_user_pages(struct page **pages, NvU64 page_count)
             ^~~~~~~~~~~~~~
In file included from /var/lib/dkms/nvidia-current/418.74/build/common/inc/nv-pgprot.h:17,
                 from /var/lib/dkms/nvidia-current/418.74/build/common/inc/nv-linux.h:20,
                 from /var/lib/dkms/nvidia-current/418.74/build/nvidia-uvm/uvm_linux.h:41,
                 from /var/lib/dkms/nvidia-current/418.74/build/nvidia-uvm/uvm_common.h:48,
                 from /var/lib/dkms/nvidia-current/418.74/build/nvidia-uvm/uvm8_tools.c:23:
./include/linux/mm.h:1075:6: note: previous declaration of ‘put_user_pages’ was here
 void put_user_pages(struct page **pages, unsigned long npages);
      ^~~~~~~~~~~~~~

./include/linux/mm.hに導入されたput_user_pagesはNVIDIAのドライバのそれと全く同じなので,以下のようにNVIDIA側でcomment outしてしまう.これでcompileできる.

--- a/nvidia-uvm/uvm8_tools.c
+++ b/nvidia-uvm/uvm8_tools.c
@@ -204,12 +204,14 @@ static bool tracker_is_counter(uvm_tools_event_tracker_t *event_tracker)
     return event_tracker != NULL && !event_tracker->is_queue;
 }
 
+/*
 static void put_user_pages(struct page **pages, NvU64 page_count)
 {
     NvU64 i;
     for (i = 0; i < page_count; i++)
         put_page(pages[i]);
 }
+*/
 
 static void unmap_user_pages(struct page **pages, void *addr, NvU64 size)
 {