Just tried to install tensorflow in Gentoo virtual env with python 3.4 and failed
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts
Monday, November 7, 2016
Sunday, August 21, 2016
Back to the Linux or how I debugged silent crash
Just got tired from Mac and decided to move to my old Gentoo Linux. After recompiling world (oh yeah, all from sources) I stuck with SIGSEGV with plot command in Octave (Matlab like math package).
When I tried to plot anything it crashed with SIGSEGV without any obvious reason. So I got to go deeper to fix it. Gentoo supports nice debug options all that one needs is just to enable them
https://wiki.gentoo.org/wiki/Debugging
After that simple
# sudo ulimit -c 99999999
# octave
octave:1> plot(1)
then crash with core in the current folder. Now one need to unwind the stack
# gdb /usr/lib/debug/usr/bin/octave-cli-3.8.2.debug core
(gdb) bt
#0 fl_create_gl_context (g=0x0) at Fl_Gl_Choice.H:102
#1 Fl_Gl_Window::make_current (this=0xc12430) at Fl_Gl_Window.cxx:168
#2 0x00007fc1a5706447 in plot_window::show_canvas (this=0xc11bb0,
this=0xc11bb0) at dldfcn/__init_fltk__.cc:935
....
#88 0x00007fc1b715a620 in __libc_start_main () from /lib64/libc.so.6
#89 0x0000000000400979 in _start ()
So, I didnt recompile nvidia drivers or my opengl config is bad. I had problems with opengl config, repoint it with eselect opengl and run X11 again.
Problem has solved
When I tried to plot anything it crashed with SIGSEGV without any obvious reason. So I got to go deeper to fix it. Gentoo supports nice debug options all that one needs is just to enable them
https://wiki.gentoo.org/wiki/Debugging
After that simple
# sudo ulimit -c 99999999
# octave
octave:1> plot(1)
then crash with core in the current folder. Now one need to unwind the stack
# gdb /usr/lib/debug/usr/bin/octave-cli-3.8.2.debug core
(gdb) bt
#0 fl_create_gl_context (g=0x0) at Fl_Gl_Choice.H:102
#1 Fl_Gl_Window::make_current (this=0xc12430) at Fl_Gl_Window.cxx:168
#2 0x00007fc1a5706447 in plot_window::show_canvas (this=0xc11bb0,
this=0xc11bb0) at dldfcn/__init_fltk__.cc:935
....
#88 0x00007fc1b715a620 in __libc_start_main () from /lib64/libc.so.6
#89 0x0000000000400979 in _start ()
So, I didnt recompile nvidia drivers or my opengl config is bad. I had problems with opengl config, repoint it with eselect opengl and run X11 again.
Problem has solved
Labels:
debuggub octave,
eng,
gdb,
gentoo,
linux,
opensource
Thursday, November 21, 2013
Signum JTAG under virtualbox
I'm using Gentoo Linux as the host and Windows (other OSes) as the guest system on my laptop. Some time ago I had to debug ARM device with Signum JTAG but after I installed drivers Windows 7 Device Manager says "This device cannot start. (Code 10)" and no one know how to fix it. I reisntalled it few times, checked old and new drivers but the same. I checked Google but no answer. But I found the solution a little bit later.
Location:
Синьчжу, Тайвань 300
Tuesday, December 11, 2012
git-svn cheat list 2
Small additional about svn git after this one. Sometimes I have svn repo with huge amount of commits (for now I have svn repo with about 50000 commits), clone it is a REAL pain.
Tuesday, September 11, 2012
H264 and YUV raw video under mplayer
H264 you need just set fps
mplayer -fps 7 ./video_160x120_315971798.h264
YUV
mplayer -demuxer rawvideo -rawvideo w=320:h=240:format=i420 2.yuv
mplayer -fps 7 ./video_160x120_315971798.h264
YUV
mplayer -demuxer rawvideo -rawvideo w=320:h=240:format=i420 2.yuv
Monday, August 27, 2012
git-svn cheat list
I moved to a new company, unfortunately here all most all use svn =( It's pity. So I made some cheat list to use git-svn inside this hell. All story based on Gentoo of course =)
Friday, May 18, 2012
Thursday, April 26, 2012
Another kernel patch for fork-exit with cgroups
Back to previous patch, I realize that I must handle move tasks from one group to another (this operation also change tasks file, so we want to take event about this)
interview questions
Not so big company which focused on software development for controllers (arm without MMU - cortex-m series) for uclinux
Location:
Москва, Россия
Monday, April 23, 2012
debug trace in kernel
Recently I've patched do_fork() and need in some trace debug during fork(). But every process in linux starts with do_fork(), so I had tons of traces.
Sunday, April 1, 2012
di.fm under mpg123
Everyone now about di.fm. Under linux we can play playlists from there with audacios, but audacious ugly like my university course about compilers (it's REALLY ugly). But I still want to listen di.fm and more across station list.
Thursday, March 22, 2012
Patch linux kernel for add ability to send an event about do_fork()/do_exit()
Recently I have interesting question - how to create event about do_fork()/do_exit of group of processes, not any process but some of them. It's very useful, for example, when one want to create group of persistent processes (IDS/IPS), but sometimes software "fall" =) and system must restart it. So we can make cron script for checking PIDs, we can create N pthreads and then in each thread exec() new process, when wait4() it (when it falls re-exec it). The first solution lead in persistent scanning (each t-seconds we must to check even nothing happened), second solution no so scalable, bcoz we need 2N + 1 working processes for N persistent processes. Of course, it's not load system, each wait4() thread sleep and doesn't eat much cpu time. And I had create small kernel patch based on cgroups subsystem. Shortly, we push persistent processes to a special group and set userspace event handler. When process move out from this cgroup (when process do_exit() it's move out too) we catch event and restart this process.
Monday, November 28, 2011
git server on non standard ssh port
Some time ago I think about how to connect to a git server if it's on non standard ssh port. This case can occurs when you make port forwarding with ssh inside your network (look at -L key in man ssh), or if you want to avoid scanning your hosts by dumb bots.
At first I think about .git/config file and how can I force git to ask server on another port. But next I realized that's not question about git it's the question about ssh. And solution was really simple - put a host description into ~/.ssh/config
At first I think about .git/config file and how can I force git to ask server on another port. But next I realized that's not question about git it's the question about ssh. And solution was really simple - put a host description into ~/.ssh/config
Host myhost.xxxx
user imauser
Port 31337
Tuesday, November 8, 2011
I looked through book about writing kernel modules in Linux (actually it's in russian lang). It's oriented on x86 architecture. I fount some not so real but interesting sample with syscall from inline assmebler code and port it to arm architecture. I used codesourcery toolchain.
Some information about arm syscalls in linux. According ARM EABI one use r7 register for syscall number and swi 0 (or svc 0, codesourcery gcc generate the same code) for syscall. One can use also r0-r5 registers for 32 bit parameters (or r0...r6 for 64 bit parameters, but them must be aligned to even number of registers)
Some information about arm syscalls in linux. According ARM EABI one use r7 register for syscall number and swi 0 (or svc 0, codesourcery gcc generate the same code) for syscall. One can use also r0-r5 registers for 32 bit parameters (or r0...r6 for 64 bit parameters, but them must be aligned to even number of registers)
Sunday, September 25, 2011
Include into assembler files .h files with definitions
This very general question how to incorporate C and Assembler. Bcoz sometimes you have many C sources and headers and you need rewrite something on assembler. Everybody knows about inline assembler in gcc. But not many knows that you can write into assembler and include some of required .h files. Linux kernel has some examples, but they not easy to look. I found some good explanation on ARM site [1] and adopt it for gcc
Friday, August 26, 2011
Laptop battery status in a prompt
I found sometime ago very usefull script for showing laptop battery status in a terminal. As I dont like huge xmanagers (KDE and Gnome and...) and using fluxbox this script was real for me. But time run fast and now all acpi things are moved from procfs to sysfs. I bought used laptop on ebay and found this old script in my old hdd backup directory. Fix it for a little add bashrc sample and it's run again.
Monday, June 20, 2011
Thursday, June 16, 2011
embedded libc hell
Sometimes embedded world is a real hell place. Lets look
# cd /bin/
# ./lscgroup
-sh: ./lscgroup: not found
# ls -la lscgroup
-rwxr-xr-x 1 65534 65534 23138 May 27 2011 lscgroup
wtf??? it's executable but some strange error message. Let's look deeply
# ldd ./lscgroup
.......
libc.so.0 => /lib/libc.so.0 (0x4000e000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)
.......
libc.so.6 => not found (0x00000000)
.......
#
I compiled libcgroups with glibc and try to run under uClibc. I spent to investigate this issue whole day(( I dont have crosslaform with uClibc and I cant change board environment to glibc. And what we can do??? I found (my friends told me that it's the common way to solve problem like this). We can chroot into a new envornment. For example from uClibc chroot to glibc. Ok.
Download fedore core rootfs
http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/fc6-arm-root-with-gcc.tar.bz2
it contains gcc!!! very usefull sometimes when all crash with cross building. Setup NFS server, unpack arch into dir, export dir (restart NFS server and check it with the command exportfs) and mount fedore core root to the device folder. After that you must mount /dev /proc /sys into chroot environment and chroot
mount -o bind /proc/ /root_fc/proc
mount -o bind /dev/ /root_fc/dev/
mount -o bind /sys/ /root_fc/sys/
chroot /root_fc/ /bin/sh
And....
# lscgroup
cgroups can't be listed: Cgroup is not mounted
#
it's working, check with ldd that all works fine.
# cd /bin/
# ./lscgroup
-sh: ./lscgroup: not found
# ls -la lscgroup
-rwxr-xr-x 1 65534 65534 23138 May 27 2011 lscgroup
wtf??? it's executable but some strange error message. Let's look deeply
# ldd ./lscgroup
.......
libc.so.0 => /lib/libc.so.0 (0x4000e000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)
.......
libc.so.6 => not found (0x00000000)
.......
#
I compiled libcgroups with glibc and try to run under uClibc. I spent to investigate this issue whole day(( I dont have crosslaform with uClibc and I cant change board environment to glibc. And what we can do??? I found (my friends told me that it's the common way to solve problem like this). We can chroot into a new envornment. For example from uClibc chroot to glibc. Ok.
Download fedore core rootfs
http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/fc6-arm-root-with-gcc.tar.bz2
it contains gcc!!! very usefull sometimes when all crash with cross building. Setup NFS server, unpack arch into dir, export dir (restart NFS server and check it with the command exportfs) and mount fedore core root to the device folder. After that you must mount /dev /proc /sys into chroot environment and chroot
mount -o bind /proc/ /root_fc/proc
mount -o bind /dev/ /root_fc/dev/
mount -o bind /sys/ /root_fc/sys/
chroot /root_fc/ /bin/sh
And....
# lscgroup
cgroups can't be listed: Cgroup is not mounted
#
it's working, check with ldd that all works fine.
Subscribe to:
Posts (Atom)