Java kill suddenly - lucene

I am getting this error when writer.optimize() called I have caugh all exceptions but hopeless .writer is an instance of apache lucene Indexwriter and tomcat collapse when optimizing the indexwriter.I am trying to index a large number of file its works for a few number of file but when number of files increase it cause to tomcat fail.
logger.info("Optimizing optimazing...");
this.writer.optimize();
logger.info("Optimizing closing...");
this.writer.close();
logger.info("Optimazide and closed succesfully...");
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fe6f8c38e90, pid=10316, tid=140629887768320
#
# JRE version: 6.0_20-b20
# Java VM: OpenJDK 64-Bit Server VM (19.0-b09 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea6 1.9.7
# Distribution: Ubuntu 10.10, package 6b20-1.9.7-0ubuntu1
# Problematic frame:
# V [libjvm.so+0x54ae90]
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
# https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
#
--------------- T H R E A D ---------------
Current thread (0x00000000023e0000): JavaThread "CompilerThread0" daemon [_thread_in_native, id=10333, stack(0x00007fe6f2715000,0x00007fe6f2816000)]
siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x0000000000000008
Registers:
RAX=0x0000000000000000, RBX=0x00007fe6f2812930, RCX=0x00007fe6ec03e9e0, RDX=0x0000000000002000
RSP=0x00007fe6f2811150, RBP=0x00007fe6f2811190, RSI=0x00007fe6e43a20f0, RDI=0x0000000000000000
R8 =0x00007fe6e43f5a70, R9 =0x00007fe6f2812930, R10=0x00007fe6ec6f7948, R11=0x0000000000000000
R12=0x00007fe6edd326b0, R13=0x00007fe6ec6f7948, R14=0x00007fe6f2812950, R15=0x00007fe6ec068990
RIP=0x00007fe6f8c38e90, EFL=0x0000000000010206, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Register to memory mapping:
RAX=0x0000000000000000
0x0000000000000000 is pointing to unknown location
RBX=0x00007fe6f2812930
0x00007fe6f2812930 is pointing into the stack for thread: 0x00000000023e0000
"CompilerThread0" daemon prio=10 tid=0x00000000023e0000 nid=0x285d runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
RCX=0x00007fe6ec03e9e0
0x00007fe6ec03e9e0 is pointing to unknown location
RDX=0x0000000000002000
0x0000000000002000 is pointing to unknown location
RSP=0x00007fe6f2811150
0x00007fe6f2811150 is pointing into the stack for thread: 0x00000000023e0000
"CompilerThread0" daemon prio=10 tid=0x00000000023e0000 nid=0x285d runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
RBP=0x00007fe6f2811190
0x00007fe6f2811190 is pointing into the stack for thread: 0x00000000023e0000
"CompilerThread0" daemon prio=10 tid=0x00000000023e0000 nid=0x285d runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
RSI=0x00007fe6e43a20f0
0x00007fe6e43a20f0 is pointing to unknown location
RDI=0x0000000000000000
0x0000000000000000 is pointing to unknown location
R8 =0x00007fe6e43f5a70
0x00007fe6e43f5a70 is pointing to unknown location
R9 =0x00007fe6f2812930
0x00007fe6f2812930 is pointing into the stack for thread: 0x00000000023e0000
"CompilerThread0" daemon prio=10 tid=0x00000000023e0000 nid=0x285d runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
R10=0x00007fe6ec6f7948
0x00007fe6ec6f7948 is pointing to unknown location
R11=0x0000000000000000
0x0000000000000000 is pointing to unknown location
R12=0x00007fe6edd326b0
0x00007fe6edd326b0 is pointing to unknown location
R13=0x00007fe6ec6f7948
0x00007fe6ec6f7948 is pointing to unknown location
R14=0x00007fe6f2812950
0x00007fe6f2812950 is pointing into the stack for thread: 0x00000000023e0000
"CompilerThread0" daemon prio=10 tid=0x00000000023e0000 nid=0x285d runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
R15=0x00007fe6ec068990
0x00007fe6ec068990 is pointing to unknown location
Top of Stack: (sp=0x00007fe6f2811150)
0x00007fe6f2811150: 00007fe6e4522cd0 00007fe6f2811420
0x00007fe6f2811160: 00007fe6f2811190 00007fe6f2812930
0x00007fe6f2811170: 0000000000000002 00007fe6edd326b0
0x00007fe6f2811180: 00007fe6ec5d6430 00007fe6f2811420
0x00007fe6f2811190: 00007fe6f2811200 00007fe6f8c3941b
0x00007fe6f28111a0: 0000000000000002 00007fe600000100
0x00007fe6f28111b0: 00007fe600000001 00007fe6f28132d0
w-p 00021000 08:01 17301749 /lib/ld-2.12.1.so
7fe6fa020000-7fe6fa021000 rw-p 00000000 00:00 0
7fffd5558000-7fffd5579000 rw-p 00000000 00:00 0 [stack]
7fffd55ff000-7fffd5600000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
VM Arguments:
jvm_args: -Djava.util.logging.config.file=/home/murat/Desktop/servers/apache-tomcat-6.0.24/conf/logging.properties -Dhttp.nonProxyHosts=localhost|127.0.0.1|expertPC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -agentlib:jdwp=transport=dt_socket,address=11550,server=y,suspend=n -Djava.endorsed.dirs=/home/murat/Desktop/servers/apache-tomcat-6.0.24/endorsed -Dcatalina.base=/home/murat/Desktop/servers/apache-tomcat-6.0.24 -Dcatalina.home=/home/murat/Desktop/servers/apache-tomcat-6.0.24 -Djava.io.tmpdir=/home/murat/Desktop/servers/apache-tomcat-6.0.24/temp
java_command: org.apache.catalina.startup.Bootstrap start
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
JRE_HOME=/usr/lib/jvm/java-6-openjdk
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
USERNAME=murat
LD_LIBRARY_PATH=/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64
SHELL=/bin/bash
DISPLAY=:0.0
Signal Handlers:
SIGSEGV: [libjvm.so+0x723630], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [libjvm.so+0x723630], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [libjvm.so+0x5e0000], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGXFSZ: [libjvm.so+0x5e0000], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [libjvm.so+0x5e0000], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x5df710], sa_mask[0]=0x00000004, sa_flags=0x10000004
SIGHUP: [libjvm.so+0x5e2180], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGINT: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGTERM: [libjvm.so+0x5e2180], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGQUIT: [libjvm.so+0x5e2180], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
--------------- S Y S T E M ---------------
OS:Ubuntu 10.10 (maverick)
uname:Linux 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 18:42:20 UTC 2011 x86_64
libc:glibc 2.12.1 NPTL 2.12.1
rlimit: STACK 8192k, CORE 0k, NPROC infinity, NOFILE 1024, AS infinity
load average:0.77 0.30 0.14
/proc/meminfo:
MemTotal: 4054828 kB
MemFree: 176928 kB
Buffers: 207640 kB
Cached: 1332820 kB
SwapCached: 17608 kB
Active: 2419624 kB
Inactive: 1004992 kB
Active(anon): 1834536 kB
Inactive(anon): 67792 kB
Active(file): 585088 kB
Inactive(file): 937200 kB
Unevictable: 16 kB
Mlocked: 16 kB
SwapTotal: 11876348 kB
SwapFree: 11687616 kB
Dirty: 3508 kB
Writeback: 32 kB
AnonPages: 1873148 kB
Mapped: 197036 kB
Shmem: 18240 kB
Slab: 157916 kB
SReclaimable: 131452 kB
SUnreclaim: 26464 kB
KernelStack: 3928 kB
PageTables: 32140 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 13903760 kB
Committed_AS: 3427468 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 323536 kB
VmallocChunk: 34359412360 kB
HardwareCorrupted: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 272384 kB
DirectMap2M: 3919872 kB
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1
Memory: 4k page, physical 4054828k(176928k free), swap 11876348k(11687616k free)
vm_info: OpenJDK 64-Bit Server VM (19.0-b09) for linux-amd64 JRE (1.6.0_20-b20), built on Feb 23 2011 09:05:53 by "buildd" with gcc 4.4.5
time: Mon Jun 6 22:24:11 2011
elapsed time: 2076 seconds

As Stéphane says, try different JREs to see if you can get a different error message. There's a chance (but hard to quantify) that this is related to reaching a memory limit, but it'll be hard to be sure unless you do get an error saying which one!

Use sun/oracle java jdk, not the open jdk...
Regards,
Stéphane

Since it is most likely a bug in the JVM, the first thing I would try is updating your JVM to Java 6 update 25. You could try the Sun/Oracle JVM, but it likely to be the same.
I am assuming you are not using an JNI libraries?

Related

How can I low ksoftirq usage when it hits 100% of a CPU?

I have a Linux server with 48 CPU and, from time to time, some of them starts hitting almost 100% of usage. And when that happens, the usage doesn't go down and that's affecting some services performance.
When I reboot this server, everything goes ok for several days when some starts hitting almost 100% of usage again. This is like a cycle.
The problem is that the usage of some CUP, when hits 100%, doesn't change, unless I reboot server, and there is a service that's performing badly when that occurs.
When I use the htop command, I can see some process ksoftirq/0, ksoftirq/1, ksoftirq/2 ... is the responsible for this usage. I don't know what to do.
One approach that I tried was: I observed that the number of CPU where that occurs tends to be in the first half (0-23). I tried to change the affinity of those process (ksoftirq) to another CPU in the second half (24-47), but without any success.
What I want is: how to low this ksoftirq process usage or, at least, how to distribute them in order to keep CPU with a usage lower?
I'm not sure if the solution is about changing the affinity or changing some other attribute. I'm really clueless in this situation.
This is a physical server. Some info about it:
output of lsb_release -a:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
output of uname -a:
Linux tiamat-dc 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux
output of lscpu:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 44 bits physical, 48 bits virtual
CPU(s): 48
On-line CPU(s) list: 0-47
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 4
NUMA node(s): 4
Vendor ID: GenuineIntel
CPU family: 6
Model: 46
Model name: Intel(R) Xeon(R) CPU E7530 # 1.87GHz
Stepping: 6
CPU MHz: 1239.565
BogoMIPS: 3723.93
Virtualization: VT-x
L1d cache: 768 KiB
L1i cache: 768 KiB
L2 cache: 6 MiB
L3 cache: 48 MiB
NUMA node0 CPU(s): 0,4,8,12,16,20,24,28,32,36,40,44
NUMA node1 CPU(s): 1,5,9,13,17,21,25,29,33,37,41,45
NUMA node2 CPU(s): 2,6,10,14,18,22,26,30,34,38,42,46
NUMA node3 CPU(s): 3,7,11,15,19,23,27,31,35,39,43,47
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp l
m constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx
16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm ida flush_l1d

gem5 x86 kvm doesn't work with error "KVM: Failed to enter virtualized mode (hw reason: 0x80000021)"

I tried to run gem5 fs mode with KVM to fast forward linux boot-up and failed with this error.
info: 0x4b564d04: 0x0
info: 0x3b: 0x0
info: 0x6e0: 0x0
info: 0x1a0: 0x0
info: 0x17a: 0x0
info: 0x17b: 0x0
info: 0x9e: 0x0
panic: KVM: Failed to enter virtualized mode (hw reason: 0x80000021)
Memory Usage: 33878524 KBytes
Program aborted at tick 186932115
--- BEGIN LIBC BACKTRACE ---
gem5/build/X86/gem5.opt(_Z15print_backtracev+0x28)[0x15e45d8]
gem5/build/X86/gem5.opt(_Z12abortHandleri+0x46)[0x15f5196]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fb3c9f7d390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fb3c8a72428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fb3c8a7402a]
gem5/build/X86/gem5.opt[0x80f14f]
gem5/build/X86/gem5.opt[0x18cb151]
gem5/build/X86/gem5.opt(_ZN10BaseKvmCPU13handleKvmExitEv+0x1bc)[0x18cb8bc]
gem5/build/X86/gem5.opt(_ZN10BaseKvmCPU4tickEv+0x229)[0x18c8d69]
gem5/build/X86/gem5.opt(_ZN10EventQueue10serviceOneEv+0xd5)[0x15eb485]
gem5/build/X86/gem5.opt(_Z9doSimLoopP10EventQueue+0x48)[0x160a9c8]
gem5/build/X86/gem5.opt[0x160ad1f]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xbd57f)[0x7fb3c93e557f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb3c9f736ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fb3c8b4441d]
--- END LIBC BACKTRACE ---
I've used the gem5art and slightly modified the runscript not to run spec benchmark and run /bin/bash instead. It seems that this error has happened a while ago and issued in here. It seems that this problem has been fixed by the gem5 v19 but got the same error code. Could anyone explain why this error happens and how to fix it?

Container is running beyond memory limits - RECEIVED SIGNAL 15: SIGTERM

I implemented model prediction in oozie workflow and i got error "Container is running beyond memory limits" on step 3 i.e. model1.predict_proba. Table1 has 27 Million records. It run fine on jyupiter notebook but i got this error on oozie. Can someone please help.
d1 = sqlContext.sql("SELECT * FROM table1").toPandas()
xyz= d1.drop(['abc'], axis = 1)
modelprob = model1.predict_proba(xyz)[:,1]
Error : Yarn Logs
Application application_1547693435775_8741566 failed 2 times due to AM Container for appattempt_1547693435775_8741566_000002 exited with exitCode: -104
For more detailed output, check application tracking page:https://xyz
Diagnostics: Container [pid=224941,containerID=container_e167_1547693435775_8741566_02_000002] is running beyond physical memory limits. Current usage: 121.2 GB of 121 GB physical memory used; 226.9 GB of 254.1 GB virtual memory used. Killing container.
2019-04-15 22:43:36,231 [dispatcher-event-loop-10] INFO org.apache.spark.storage.BlockManagerInfo - Removed broadcast_5_piece0 on xyz.corp.intranet:34252 in memory (size: 5.6 KB, free: 6.2 GB)
2019-04-15 22:43:36,231 [dispatcher-event-loop-35] INFO org.apache.spark.storage.BlockManagerInfo - Removed broadcast_5_piece0 on xyz1.corp.intranet:38363 in memory (size: 5.6 KB, free: 6.2 GB)
2019-04-15 22:43:36,242 [Spark Context Cleaner] INFO org.apache.spark.ContextCleaner - Cleaned accumulator 4
2019-04-15 22:43:36,245 [dispatcher-event-loop-51] INFO org.apache.spark.storage.BlockManagerInfo - Removed broadcast_2_piece0 on xyz3 in memory (size: 53.5 KB, free: 52.8 GB)
2019-04-15 22:43:36,245 [dispatcher-event-loop-51] INFO org.apache.spark.storage.BlockManagerInfo - Removed broadcast_2_piece0 on xyz4.corp.intranet:46309 in memory (size: 53.5 KB, free: 6.2 GB)
2019-04-15 22:43:36,248 [dispatcher-event-loop-9] INFO org.apache.spark.storage.BlockManagerInfo - Removed broadcast_2_piece0 on xyz5.corp.intranet:44850 in memory (size: 53.5 KB, free: 6.2 GB)
2019-04-15 22:45:48,103 [SIGTERM handler] INFO org.apache.spark.deploy.yarn.ApplicationMaster - Final app status: FAILED, exitCode: 16
2019-04-15 22:45:48,106 [SIGTERM handler] ERROR org.apache.spark.deploy.yarn.ApplicationMaster - RECEIVED SIGNAL 15: SIGTERM
2019-04-15 22:45:48,124 [Thread-5] INFO org.apache.spark.SparkContext - Invoking stop() from shutdown hook
below are sparkconf parameters :
sconf = SparkConf().setAppName("xyz model").set("spark.driver.memory", "8g").set('spark.executor.memory', '12g').set("spark.yarn.am.memory", "8g").set('spark.dynamicAllocation.enabled', 'true').set('spark.dynamicAllocation.minExecutors', 20').set('spark.dynamicAllocation.maxExecutors', '60').set("spark.shuffle.service.enabled", "true").set('spark.kryoserializer.buffer.max.mb', '2047').set("spark.shuffle.blockTransferService", "nio").set("spark.driver.maxResultSize", "4g").set('spark.rpc.message.maxSize', '330').setMaster("yarn-cluster")
sc = SparkContext(conf=sconf)
below are sprkopts parameters :
sparkopts=--executor-memory 115g --num-executors 60 --driver-memory 110g --executor-cores 16 --driver-cores 2 --conf "spark.dynamicAllocation.enabled=true" --conf "spark.kryoserializer.buffer.max=2047m" --conf "spark.driver.maxResultSize=4096m" --conf spark.yarn.executor.memoryOverhead=8000 --conf "spark.network.timeout=10000000" --conf "spark.executor.extraJavaOptions=-XX:+UseCompressedOops -XX:PermSize=2048M -XX:MaxPermSize=2048M -XX:+UseG1GC" --conf "spark.broadcast.compress=true" --conf "spark.broadcast.blockSize=128m" --conf "spark.serializer.objectStreamReset=2" --conf spark.executorEnv.PYSPARK_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python --conf spark.yarn.appMasterEnv.PYSPARK_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python --files ${xyz}/hive-site.xml --files ${xyz}/yarn-site.xml

redis-cli unix socket - import rcmd failing

I am using redis server 3.0.6 on ubuntu 16.04 desktop. Installed using
apt-get install redis-server
It was working fine for a long time. Today, when I tried to import a rcmd file using unix socket in redis-cli I am getting out of memory error.
$ sudo redis-cli -s /run/redis/redis.sock < a1.rcmd
Error: Out of memory
a1.rcmd contents:
SET Api:Server:Name "server1"
/etc/redis/redis.conf was confiured with /run/redis/redis.sock. All other configurations are default.
GET, SET commands with unix socket option are working fine.
If I run without unix socket, the redis-cli < a1.rcmd command is working fine.
What causes this error?
Will upgrade to latest version of redis resolve this? I dont see apt-get way to install latest redis version 5.
Any help would be really appreciated.
** EDIT **
Some more inputs and GDB logs.
$ which redis-server
/usr/bin/redis-server
$ sudo service redis-server status
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2018-12-17 11:29:14 EST; 16min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 8986 ExecStopPost=/bin/run-parts --verbose /etc/redis/redis-server.post-down.d (code=exited, status=0/SUCCESS)
Process: 8981 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 8977 ExecStop=/bin/run-parts --verbose /etc/redis/redis-server.pre-down.d (code=exited, status=0/SUCCESS)
Process: 9001 ExecStartPost=/bin/run-parts --verbose /etc/redis/redis-server.post-up.d (code=exited, status=0/SUCCESS)
Process: 8997 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
Process: 8992 ExecStartPre=/bin/run-parts --verbose /etc/redis/redis-server.pre-up.d (code=exited, status=0/SUCCESS)
Main PID: 9000 (redis-server)
Tasks: 3
Memory: 884.0K
CPU: 304ms
CGroup: /system.slice/redis-server.service
└─9000 /usr/bin/redis-server 127.0.0.1:637
$ sudo gdb /usr/bin/redis-server 9000
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/redis-server...(no debugging symbols found)...done.
Attaching to program: /usr/bin/redis-server, process 9000
[New LWP 9002]
[New LWP 9003]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fe8f5158a13 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) continue
Continuing.
After this step I ran following command in another terminal:
$ sudo redis-cli -s /run/redis/redis.sock < a1.rcmd
Segmentation fault (core dumped)
(gdb) bt
#0 0x00007fe8f5158a13 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
#1 0x000055b238abe15f in aeProcessEvents ()
#2 0x000055b238abe58b in aeMain ()
#3 0x000055b238abd204 in main ()
(gdb) info registers
rax 0xfffffffffffffffc -4
rbx 0x7fe8f48e5300 140638512108288
rcx 0x7fe8f5158a13 140638520969747
rdx 0x1060 4192
rsi 0x7fe8f4910000 140638512283648
rdi 0x3 3
rbp 0x7fe8f487b068 0x7fe8f487b068
rsp 0x7ffd9a5ca920 0x7ffd9a5ca920
r8 0x284 644
r9 0x284 644
r10 0x64 100
r11 0x293 659
r12 0x7ffd9a5caae8 140727193217768
r13 0x7fe8f480e1a0 140638511227296
r14 0x7fe8f48101f0 140638511235568
r15 0xfffffffe 4294967294
rip 0x7fe8f5158a13 0x7fe8f5158a13 <epoll_wait+51>
eflags 0x293 [ CF AF SF IF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
(gdb)

How to set KVM VM use shadow page table?

I want to measure shadow page table performance vs EPT. I know in kvm code path, EPT and shadow page table share some code path. There is a switch to check if EPT is enabled.
So, I turn off EPT, I think this is a way to use shadow page table in KVM VM.
I exec some commands on host:
# cat /sys/module/kvm_intel/parameters/ept
Y //check if EPT is enabled, Yes it is
# rmmod kvm_intel
# modprobe kvm_intel ept=0,vpid=0 //Re-modprobe kvm_intel, but turn off EPT and VPID
# cat /sys/module/kvm_intel/parameters/ept
N // EPT is disabled
# cat /sys/module/kvm_intel/parameters/vpid
Y //VPID is still enabled
After these commads, I expect the EPT is disabled, However, I create a VM with 4 vcpu, but in VM, I use htop in VM only find i vcpu. I don't know why.
So, I turn on ept again, I can see 4 vcpu in vm using htop. But, on another server, I turn off ept, in VM, I still can find 4 vcpu.
In host, I test qemu thread num:
pstree -p | grep qemu
|-qemu-kvm(20594)-+-{qemu-kvm}(20612)
| |-{qemu-kvm}(20613)
| |-{qemu-kvm}(20614)
| |-{qemu-kvm}(20615)
| |-{qemu-kvm}(20618)
| `-{qemu-kvm}(23429)
There are still muti threads.
In KVM VM, I use lscpu to check:
# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0
Off-line CPU(s) list: 1-3
Thread(s) per core: 1
Core(s) per socket: 1
座: 1
NUMA 节点: 1
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 62
型号名称: Intel(R) Xeon(R) CPU E5-2640 v2 # 2.00GHz
步进: 4
CPU MHz: 1999.999
BogoMIPS: 3999.99
超管理器厂商: KVM
虚拟化类型: 完全
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 4096K
NUMA 节点0 CPU: 0
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm fsgsbase tsc_adjust smep erms xsaveopt
VPID is still enabled cause your command format was incorrect
# modprobe kvm_intel ept=0 vpid=0(Use spaces instead of commas)