There are a lot of core files in nebula graph, what is it? - nebula-graph

How to view these core files?These files take up a lot of memory, I want to close the generation of these files.
These files appear in the /usr/local/nebula path. For example:
core.ruby.12759.16496723591
core.ruby.128288.1649672928
core.ruby.127623.1643934031
...

You can use the gdb tool to view these core files.
Check the Core file process name, pid is usually a numeric value.
$ file core.<pid>
Use gdb to debug.
$ gdb <process.name> core.<pid>
View the contents of the file.
$(gdb) bt
For example:
$ file core.1316027
core.1316027: ELF 64-bit LSB core file, x86-64, version 1 (SYSV), SVR4-style, from '/home/workspace/fork/nebula-debug/bin/nebula-metad --flagfile /home/k', real uid: 1008, effective uid: 1008, real gid: 1008, effective gid: 1008, execfn: '/home/workspace/fork/nebula-debug/bin/nebula-metad', platform: 'x86_64'
$ gdb /home/workspace/fork/nebula-debug/bin/nebula-metad core.1316027
$(gdb) bt
#0 0x00007f9de58fecf5 in __memcpy_ssse3_back () from /lib64/libc.so.6
#1 0x0000000000eb2299 in void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) ()
#2 0x0000000000ef71a7 in nebula::meta::cpp2::QueryDesc::QueryDesc(nebula::meta::cpp2::QueryDesc const&) ()
...

Related

Unable to get the Ada scrolling text demo working on the microbit on GNAT 2019 community edition

I'm trying to run the demo described here: https://blog.adacore.com/ada-on-the-microbit
I followed the tutorial's directions carefully. I did install the 2019 versions of the software instead of the 2018 versions. GPS seems to be installed and working on my windows 7 machine. The project builds but pyocd-flashtool can't seem to recognize my microbit. It reports it as a "generic cortex_m" and throws an exception.
Here's the output:
gprbuild --target=arm-eabi -d -PC:\Domains\ada\microbit_scrolling_text_demo\microbit_example.gpr
C:\Domains\ada\microbit_scrolling_text_demo\src\main.adb -largs -Wl,-Map=map.txt
Compile
[Ada] main.adb
Bind
[gprbind] main.bexch
[Ada] main.ali
Link
[link] main.adb
[2019-09-21 18:40:29] process terminated successfully, elapsed time: 02.57s
Retrieving the load address.
arm-eabi-objdump C:\Domains\ada\microbit_scrolling_text_demo\obj\main -h
Load address is: 0x00000000
Creating the binary (flashable) image.
arm-eabi-objcopy -O binary C:\Domains\ada\microbit_scrolling_text_demo\obj\main C:\Domains\ada\microbit_scrolling_text_demo\obj\main.bin
Flashing image to board...
pyocd-flashtool -a 0x00000000 C:\Domains\ada\microbit_scrolling_text_demo\obj\main.bin
WARNING:root:Unsupported board found 9901
INFO:root:DAP SWD MODE initialised
INFO:root:ROM table #0 # 0xf0000000 cidr=b105100d pidr=2007c4001
INFO:root:[0]<e00ff000: cidr=b105100d, pidr=4000bb471, class=1>
INFO:root:ROM table #1 # 0xe00ff000 cidr=b105100d pidr=4000bb471
INFO:root:[0]<e000e000:SCS-M0+ cidr=b105e00d, pidr=4000bb008, class=14>
INFO:root:[1]<e0001000:DWT-M0+ cidr=b105e00d, pidr=4000bb00a, class=14>
INFO:root:[2]<e0002000:BPU cidr=b105e00d, pidr=4000bb00b, class=14>
INFO:root:[1]<f0002000: cidr=b105900d, pidr=4000bb9a3, class=9, devtype=13, devid=0>
INFO:root:CPU core is Cortex-M0
INFO:root:4 hardware breakpoints, 0 literal comparators
INFO:root:2 hardware watchpoints
Traceback (most recent call last):
File "C:\GNAT\2019\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\GNAT\2019\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\GNAT\2019\bin\pyocd-flashtool.exe\__main__.py", line 9, in <module>
File "C:\GNAT\2019\lib\site-packages\pyOCD\tools\flash_tool.py", line 214, in main fast_verify=args.fast_program)
File "C:\GNAT\2019\lib\site-packages\pyOCD\flash\flash.py", line 286, in flashBlock flash_start = self.getFlashInfo().rom_start
File "C:\GNAT\2019\lib\site-packages\pyOCD\flash\flash_cortex_m.py", line 44, in getFlashInfo raise Exception("Unsupported flash operation on generic cortex_m")
Exception: Unsupported flash operation on generic cortex_m
Could not flash the executable.
[workflow stopped]
Anyone know what could be wrong?
In C:\GNAT\2019\lib\site-packages\pyOCD\board\mbed_board.py (or the equivalent location on your platform), add this line and it will work.
"9901": BoardInfo( "Microbit", "nrf51", "l1_microbit.bin", ),

How can I build a static Realm library for an OS X command-line utility?

I have a Foundation-based command-line utility that I'd like to add Realm support to. I can't use the Realm.framework, though, I don't have a bundle to add it to (and I prefer to avoid installation hacks that involve install_name_tool). It seems like I should be able to just build a static library (in lieu of the framework) and link my CLI utility against that.
I tried adding a static library target in the Realm Xcode project. This target is almost exactly the same as the OS X framework target (same source files, same link settings, but the type is Static library rather than Dynamic library). I link the static library against the core librealm.a library and it builds just fine. But, no matter how I build this thing, I get link errors when trying to link my CLI utility against the static library, e.g.:
Undefined symbols for architecture x86_64:
"std::runtime_error::what() const", referenced from:
vtable for realm::util::File::PermissionDenied in librealm_static.a(RLMRealm.o)
vtable for realm::util::File::AccessError in librealm_static.a(RLMRealm.o)
vtable for realm::RealmFileException in librealm_static.a(shared_realm.o)
vtable for realm::MismatchedConfigException in librealm_static.a(shared_realm.o)
vtable for realm::UnitializedRealmException in librealm_static.a(shared_realm.o)
vtable for realm::IncorrectThreadException in librealm_static.a(shared_realm.o)
vtable for realm::InvalidTransactionException in librealm_static.a(shared_realm.o)
...
"std::__1::error_code::message() const", referenced from:
realm::SharedGroup::do_open_2(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, realm::SharedGroup::DurabilityLevel, bool, char const*) in librealm_static.a(group_shared.o)
realm::util::mmap(int, unsigned long, realm::util::File::AccessMode, unsigned long, char const*) in librealm_static.a(file_mapper.o)
(anonymous namespace)::mmap_anon(unsigned long) in librealm_static.a(file_mapper.o)
realm::util::munmap(void*, unsigned long) in librealm_static.a(file_mapper.o)
realm::util::mremap(int, unsigned long, void*, unsigned long, realm::util::File::AccessMode, unsigned long) in librealm_static.a(file_mapper.o)
realm::util::msync(void*, unsigned long) in librealm_static.a(file_mapper.o)
realm::util::make_dir(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm_static.a(file.o)
...
[Edited to show undefined symbols when linking against librealm.a (vs. librealm-dbg.a)]
I have also tried using libtool to generate a combined static library of both the core librealm.a library and the static library generated from the open source components, e.g.:
cd "$TARGET_BUILD_DIR"
mv librealm_static.a librealm_dev.a
libtool -static -s -arch_only x86_64 -o librealm_static.a librealm_dev.a "$PROJECT_DIR"/core/librealm.a
Again, link errors when I link against the new "librealm_static.a" archive -- missing symbols.
Has anyone else successfully integrated Realm into an OS X command-line utility?
The specific symbols you've listed are all debug functions which are only present in librealm-dbg.a. Either remove REALM_DEBUG from the preprocessor defines or link with that library rather than librealm.a.

GDB won't run on NetBeans 7.1.1 (0xc0000135)

The problem: I have a C++ Qt project, it runs when I hit "run", runs when I manually execute the output executable, but won't run with GDB in NetBeans. After click "Debug Main Project" in NetBeans I get the message "During startup program exited with code 0xc0000135".
I have the debugger log:
=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.4\n"
~"Copyright (C) 2012 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-mingw32\".\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
&"C:\\\\Users\\\\Rafael Andreatta/.gdbinit: No such file or directory.\n"
(gdb)
2-list-features
3-gdb-set print repeat 0
4-gdb-set backtrace limit 1024
5-gdb-set print elements 0
6-file-symbol-file "B:/Dropbox/Projects/rafaame/FileSync/dist/Debug/MinGW-Windows/FileSync"
7-file-exec-and-symbols "B:\\Dropbox\\Projects\\rafaame\\FileSync\\dist\\Debug\\MinGW-Windows\\FileSync"
2^done,features=["frozen-varobjs","pending-breakpoints","thread-info","data-read-memory-bytes","breakpoint-notifications","ada-task-info"]
(gdb)
3^done
(gdb)
4^done
(gdb)
5^done
(gdb)
6^done
(gdb)
7^done
(gdb)
8-file-list-exec-source-file
9cd B:\Dropbox\Projects\rafaame\FileSync
10-exec-arguments
11set environment Path=B:\Synced\Applications\Development\Cygwin\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;B:\Synced\Applications\Development\Cygwin\bin;B:\Synced\Applications\Development\SDKs\jdk1.7.0_03\bin;B:\Synced\Applications\Development\SDKs\QtSDK\Desktop\Qt\4.8.0\mingw\bin;B:\Synced\Applications\Development\Clients\PrivateShell;
12-break-insert -f "B:/Dropbox/Projects/rafaame/FileSync/DebugHandler.cpp:29"
8^done,line="21",file="../mingw/main.c",macro-info="0"
(gdb)
13-break-insert -t _start
&"cd B:\\Dropbox\\Projects\\rafaame\\FileSync\n"
~"Working directory B:\\Dropbox\\Projects\\rafaame\\FileSync.\n"
9^done
(gdb)
10^done
(gdb)
&"set environment Path=B:\\Synced\\Applications\\Development\\Cygwin\\bin;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;B:\\Synced\\Applications\\Development\\Cygwin\\bin;B:\\Synced\\Applications\\Development\\SDKs\\jdk1.7.0_03\\bin;B:\\Synced\\Applications\\Development\\SDKs\\QtSDK\\Desktop\\Qt\\4.8.0\\mingw\\bin;B:\\Synced\\Applications\\Development\\Clients\\PrivateShell;\n"
11^done
(gdb)
12^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00403fcb",func="DebugHandler::messageOutputLog(QtMsgType, char const*)",file="DebugHandler.cpp",fullname="B:\\Dropbox\\Projects\\rafaame\\FileSync\\DebugHandler.cpp",line="29",times="0",original-location="B:/Dropbox/Projects/rafaame/FileSync/DebugHandler.cpp:29"}
(gdb)
13^error,msg="Function \"_start\" not defined."
(gdb)
14-break-insert -t main
14^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x00404ab4",func="main",file="../mingw/main.c",line="30",times="0",original-location="main"}
(gdb)
15-exec-run
&"warning: Warning: Failed to open TTY /dev/pty0, error 0x3.\n"
=thread-group-started,id="i1",pid="3928"
=thread-created,id="1",group-id="i1"
~"[New Thread 3928.0x27d8]\n"
15^running
*running,thread-id="all"
(gdb)
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1"
15^error,msg="During startup program exited with code 0xc0000135."
(gdb)
The PATH env variable in Windows is
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;
%SystemRoot%;
%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
B:\Synced\Applications\Development\SDKs\jdk1.7.0_03\bin;
B:\Synced\Applications\Development\SDKs\QtSDK\Desktop\Qt\4.8.0\mingw\bin;
B:\Synced\Applications\Development\Clients\PrivateShell;
B:\Synced\Applications\Development\MinGW\bin
Does anyone have the same issue and fixed?
Thank you all for the help
I haven't touched C++ in a long time but I had similar problem today. It turned out that some libraries where not linked with executable file. I fixed it by adding
-static-libgcc -static-libstdc++
to compiler options (CXXFLAGS in Makefile)

Qt C++ Project with non-inline assembly

I am using Windows XP, and Newest Qt Creator with QtSDK and the built-in gcc compiler.
The question is, how to use full assembly in a C++ Qt Project.
I know how to use inline assembly, but I don't know how to do non-inline(written in a separate .asm file) full assembly, in a Qt C++ project.
Is this possible with a Qt C++ project, and if so, how?
EDIT:
*pro file
TEMPLATE = app
CONFIG += console
CONFIG -= qt
SOURCES += \
calc.S
calc.S
section .data
hello: db 'Hello world!', 10
helloLen: equ $-hello
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, hello
mov edx, helloLen
int 80h
proexit:
mov eax, 1
mov ebx, 0
int 80h
Compile errors
..\plain_cpp\calc.S: Assembler messages:
..\plain_cpp\calc.S:1: Error: no such instruction: `section .data'
..\plain_cpp\calc.S:2: Error: no such instruction: `db 72ello world!4410'
..\plain_cpp\calc.S:3: Error: no such instruction: `equ $-hello'
..\plain_cpp\calc.S:5: Error: no such instruction: `section .text'
..\plain_cpp\calc.S:6: Error: no such instruction: `global _start'
..\plain_cpp\calc.S:9: Error: too many memory references for `mov'
..\plain_cpp\calc.S:10: Error: too many memory references for `mov'
..\plain_cpp\calc.S:11: Error: too many memory references for `mov'
..\plain_cpp\calc.S:12: Error: too many memory references for `mov'
..\plain_cpp\calc.S:13: Error: junk `h' after expression
..\plain_cpp\calc.S:13: Error: suffix or operands invalid for `int'
..\plain_cpp\calc.S:16: Error: too many memory references for `mov'
..\plain_cpp\calc.S:17: Error: too many memory references for `mov'
..\plain_cpp\calc.S:18: Error: junk `h' after expression
..\plain_cpp\calc.S:18: Error: suffix or operands invalid for `int'
EDIT 2 - AT&T Style
PRO File
TEMPLATE = app
CONFIG += console
CONFIG -= qt
SOURCES += \
calc.S
calc.S
.data
hello:
.string "Hello World\n"
.globl main
main:
movl $4, %eax
movl $1, %ebx
movl $hello,%ecx
movl $12,%edx
int $0x80
ret
ERRORS
undefined reference to `WinMain#16'
collect2: ld returned 1 exit status
While #karlphillip method correct in general, you should take in mind some windows specified stuff:
While you compile #karlphillip's code you get linker error produced by MinGw standard library file:
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libmingw32.a(main.o): In function `main':
C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference to `WinMain#16'
That is not your main, that is libmingw32.a's main. And it expects WinMain as entry point of your code. The thing is that WinMain is default entry point for windows application defined by Microsoft. libmingw32.a defines actual main, that is called from actual entry point. That main does some stuff and than calls WinMain. But you have no WinMain defined, obviously.
In this simple example you needn't standard library actually, then you can drop standard library and compile above code with command line
gcc -Wl,-subsystem,console 1.S -nostdlib
It should be equivalent Qt setting QMAKE_CXXFLAGS+=-nostdlib
Then code above compiles, and... segfaults. Then go to point 2:
int 80h is specific linux system call. Seems it doesn't work on windows. You should invoke WriteConsole on windows to write to stdin. But as a "proof of concept" you can run the following code:
.text
.globl main
main:
movl $1, %eax
ret
This will set exit code of program to 1.
EDIT
If you want Hello world example, compiled with standard library included, you can try this:
.data
hello:
.string "Hello World\n"
.text
.global _WinMain#16
_WinMain#16:
push $hello
call _puts
add $4, %esp
ret
Compile with gcc 1.S
I suggest you read this tutorial to properly setup Qt Creator for assembly.
EDIT:
Your problem is that qmake will call gcc to compile your assembly code, and you are using Intel Syntax. You need to convert your assembly code to use AT&T Syntax:
calc.S:
.data
hello:
.string "Hello World\n"
.globl main
main:
movl $4, %eax
movl $1, %ebx
movl $hello,%ecx
movl $12,%edx
int $0x80
ret
calc.pro:
TEMPLATE = app
CONFIG += console
CONFIG -= qt
SOURCES += \
calc.S
Paste these 2 files in the same directory then execute qmake , followed by make.
Output:
$ ./calc
Hello World
Have you tried SOURCES += yourfile.asm in your *.pro file?

Qt application crashing immediately without debugging info. How do I track down the problem?

I run an Qt app I've built:
./App
Segmentation fault
I run it with strace:
strace ./App
execve("./App", ["./App"], [/* 27 vars */]) = 0
--- SIGSEGV (Segmentation fault) # 0 (0) ---
+++ killed by SIGSEGV +++
Process 868 detached
Again, no useful info.
I run it with gdb:
(gdb) run
Starting program: /root/test/App
Reading symbols from shared object read from target memory...(no debugging symbols found)...done.
Loaded system supplied DSO at 0xffffe000
Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
Again, nothing.
I run it with valgrind:
==948== Process terminating with default action of signal 11 (SIGSEGV)
==948== Bad permissions for mapped region at address 0x0
==948== at 0x1: (within /root/test/App)
Even if I put in debugging symbols, it doesn't give any more useful info. ldd shows all libraries being linked properly.
Is there any other way I can find out what's wrong? I can't even do standard printf, cout, etc debugging. The executable doesn't even seem to start running at all.
I rebuilt with symbols, and tried the suggestion below
(gdb) break main
Breakpoint 1 at 0x45470
(gdb) run
Starting program: /root/test/App
Breakpoint 1 at 0x80045470
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
I checked for static initializers and I don't seem to have any.
Yep, I tried printf, cout, etc. It doesn't even make it into the main routine, so I'm looking for problems with static initializers in link libraries, adding them in one-by-one. I'm not getting any stack traces either.
Try running it through strace, it might give you at least some hints what happens before the program crashes. Also, does a backtrace in gdb not work?

Resources