raisimTech / raisimOgre

Other
26 stars 21 forks source link

Segmentation fault when trying to run the examples #22

Closed manumerous closed 3 years ago

manumerous commented 3 years ago

Unfortunately when I try to run the examples (./anymal in particular) after the install on my ubuntu 20.04 LTS system I get one of the following two errors:

[2021:10:14:18:42:28 OgreVis.hpp:351] Loading RaisimOgre Resources from: 
[2021:10:14:18:42:28 OgreVis.hpp:352] Loading OGRE Configurations from: /home/manu/src/raisim_ws/raisimOgre/build/
Segmentation fault (core dumped)
[2021:10:14:18:43:42 OgreVis.hpp:351] Loading RaisimOgre Resources from: 
[2021:10:14:18:43:42 OgreVis.hpp:352] Loading OGRE Configurations from: /home/manu/src/raisim_ws/raisimOgre/build/
[2021:10:14:18:43:42 OgreVis.cpp:893] unsupported visual shape of ANYmal_0 of 

When investigating it further and trying to run the example with GDB I get:

Thread 1 "anymal" received signal SIGSEGV, Segmentation fault.
__memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:436
436 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:436
#1  0x00007ffff75c7b28 in std::basic_streambuf<char, std::char_traits<char> >::xsputn(char const*, long) () from /lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007ffff75b9824 in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) () from /lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff7f9b016 in std::operator<< <char, std::char_traits<char>, std::allocator<char> > (__str=<error: Cannot access memory at address 0x37>, __os=...)
    at /usr/include/c++/9/bits/basic_string.h:6416
#4  raisim::OgreVis::registerRaisimGraphicalObjects (this=0x555555591e30, vo=..., graphics=std::vector of length 0, capacity 0, as=0x5555562aa020, name="ANYmal_0", group=1)
    at /home/manu/src/raisim_ws/raisimOgre/src/OgreVis.cpp:893
#5  0x00007ffff7f9b61c in raisim::OgreVis::createGraphicalObject (this=0x555555591e30, as=0x5555562aa020, name="ANYmal") at /usr/include/c++/9/bits/char_traits.h:300
#6  0x000055555555b83f in main ()

Do you have any idea why this might be the case?

Could it have to do with my LOCAL_INSTALL directory? I installed raisimLib, ogre and raisimOgre all in /opt/raisimOgre. is that the intended way? Or should raisimLib be installed separately from the others?

Any help is appreciated! let me know if more information is required.

jhwangbo commented 3 years ago

Do you have multiple RaiSim directories? Make sure that you only have one on your system. Do you use docker? What CPU do you use? Can you also run it with Valgrind? You did it right. You should have all raisim, raisimOgre, and ogre in one directory

manumerous commented 3 years ago

Thanks a lot for your recommendations. It pointed me in the right direction by checking for other installs using the locate command.

It turned out that there was another raisim install on the system that came with a catkin build that I was not aware anymore that i had it.

After removing all the files related to any raisim install and a subsequent clean install all works now! Thanks.

ruturajsambhusvt commented 11 months ago

Hello,

I am facing the same issue. I suspect that my CPU is insufficient to run raisim and raisimOgre. This is the output when I debug with gdb.

GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 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 ./anymal...
(No debugging symbols found in ./anymal)
(gdb) run
Starting program: /home/ruturajsambhus/Work/raisim_legged/raisim_workspace/raisimOgre/build/examples/anymal 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x00007ffff794031c in machineid::machineHash[abi:cxx11]() ()
   from /home/ruturajsambhus/Work/raisim_legged/raisim_build/lib/libraisim.so.1.1.7
(gdb) bt
#0  0x00007ffff794031c in machineid::machineHash[abi:cxx11]() ()
   from /home/ruturajsambhus/Work/raisim_legged/raisim_build/lib/libraisim.so.1.1.7
#1  0x00007ffff795363d in initializeResource(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /home/ruturajsambhus/Work/raisim_legged/raisim_build/lib/libraisim.so.1.1.7
#2  0x00007ffff79247a8 in raisim::World::init() ()
   from /home/ruturajsambhus/Work/raisim_legged/raisim_build/lib/libraisim.so.1.1.7
#3  0x00007ffff7922dd7 in raisim::World::World() ()
   from /home/ruturajsambhus/Work/raisim_legged/raisim_build/lib/libraisim.so.1.1.7
#4  0x000055555555c37e in main ()

Further, these are the CPU and graphics details of my system.

Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
Address sizes:                      36 bits physical, 48 bits virtual
CPU(s):                             4
On-line CPU(s) list:                0-3
Thread(s) per core:                 2
Core(s) per socket:                 2
Socket(s):                          1
NUMA node(s):                       1
Vendor ID:                          GenuineIntel
CPU family:                         6
Model:                              42
Model name:                         Intel(R) Core(TM) i5-2415M CPU @ 2.30GHz
Stepping:                           7
CPU MHz:                            900.000
CPU max MHz:                        2900.0000
CPU min MHz:                        800.0000
BogoMIPS:                           4589.54
Virtualization:                     VT-x
L1d cache:                          64 KiB
L1i cache:                          64 KiB
L2 cache:                           512 KiB
L3 cache:                           3 MiB
NUMA node0 CPU(s):                  0-3
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        KVM: Mitigation: VMX disabled
Vulnerability L1tf:                 Mitigation; PTE Inversion; VMX conditional c
                                    ache flushes, SMT vulnerable
Vulnerability Mds:                  Mitigation; Clear CPU buffers; SMT vulnerablThank  you,
                                    e
Vulnerability Meltdown:             Mitigation; PTI
Vulnerability Mmio stale data:      Unknown: No mitigations
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disable
                                    d via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __u
                                    ser pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, IBPB conditional, IB
                                    RS_FW, STIBP conditional, RSB filling, PBRSB
                                    -eIBRS Not affected
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 rdts
                                    cp lm constant_tsc arch_perfmon pebs bts rep
                                    _good nopl xtopology nonstop_tsc cpuid aperf
                                    mperf pni pclmulqdq dtes64 monitor ds_cpl vm
                                    x est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 s
                                    se4_2 x2apic popcnt tsc_deadline_timer aes x
                                    save avx lahf_lm pti ssbd ibrs ibpb stibp tp
                                    r_shadow vnmi flexpriority ept vpid xsaveopt
                                     dtherm ida arat pln pts md_clear flush_l1d
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.

Handle 0x0014, DMI type 16, 15 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 8 GB
    Error Information Handle: Not Provided
    Number Of Devices: 2

Handle 0x0016, DMI type 17, 27 bytes
Memory Device
    Array Handle: 0x0014
    Error Information Handle: No Error
    Total Width: Unknown
    Data Width: Unknown
    Size: 4096 MB
    Form Factor: SODIMM
    Set: None
    Locator: DIMM0
    Bank Locator: BANK 0
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1333 MT/s
    Manufacturer: 0x0000
    Serial Number: 0x00000000
    Asset Tag: Unknown
    Part Number: 0x000000000000000000000000000000000000

Handle 0x0018, DMI type 17, 27 bytes
Memory Device
    Array Handle: 0x0014
    Error Information Handle: No Error
    Total Width: Unknown
    Data Width: Unknown
    Size: 4096 MB
    Form Factor: SODIMM
    Set: None
    Locator: DIMM0
    Bank Locator: BANK 1
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1333 MT/s
    Manufacturer: 0x0000
    Serial Number: 0x00000000
    Asset Tag: Unknown
    Part Number: 0x000000000000000000000000000000000000
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 3000 (SNB GT2)

I am also facing the segmentation fault while running the raisimUnity server. It would be great if you could confirm if memory is the issue and how much RAM I would need to add to fix it. Please let me know if any more information is needed.

jhwangbo commented 11 months ago

We only support cpu's that has AVX2 instructions