Howto debug Oscam
The guide is based on the following system:
1 Required to install packages with apt-get
2 install libusb
3 The OScam configuration files are stored here (if necessary adjust the path in the run scripts)
4 In the following should be present oscam.config
5 Error message. -> Ulimit: open files:
Needed to install packages with apt-get
apt-get update
apt-get install-y htop automake make cmake cmake-curses-gui subversion libusb-dev libssl-dev libssh-dev g+ + gcc gdb dialog
install libusb
libusb-1.0.6 installed as follows: (Here the libusb-1.0.8 is installed)
cd / tmp
tar xjf libusb-1.0.6.tar.bz2
cd libusb-1.0.6
. / Configure
make
make install
Display More
The configuration files are stored here OScam (possibly adjust the path in the run scripts)
The following should be present oscam.config
Error message. -> Ulimit: open files:
When executing a user without admin rights the scripts you get with the entry "ulimit-n 4096" error message. -> Ulimit: open files: Can not the limit à ¤ Change: Operation not permitted
Therefore we use in section 4.0 as the root user!
Adding a User
The program Putty (for Windows) as root to the server, connect, enter and then run the query:
then oh with
close the connection.
OScam files download
Connect to the program Putty (for Windows) oscam_doctor to the server. Now we are oscam_doctor the Home directory of user control with
If you would like to check whether a OScam playing then you can with the htop and if necessary, kill
check out
Certain audit check
Select modules
If you only certain modules (Add-Ons/Protocols/Reader) in OScam want to have, then you would enter (should at least be set for "add-ons" and debug messages Log History)
and it opens the following dialog box
Instructions:
Use the Enter key you can in the main modules and press space you choose the modules. Finally, click "Save" and then "Enter" to confirm not forget!
Scripts create PS: We are in / home / oscam_doctor / oscam-svn / build directory!
Type the following
Then create three files in the folder with the vi
Without cmake in scrpit
Here i just typing not press ENTER!
Then copy the pure click here and in the putty window with the right mouse button
/ Bin / sh
ulimit-n 4096
killall -9 oscam
echo "oscam killed"
sleep 1
gdb-ex "set logging on" ex "show logging" oscam-x run
echo "oscam exit debug"
Display More
Then again press the ESC key and
Type the following
and press ENTER
Then the rights to change
Ready
With cmake scripts in
Here i just typing not press ENTER!
Then copy the pure click here and in the putty window with the right mouse button
/ Bin / sh
ulimit-n 4096 cmake DCMAKE_BUILD_TYPE = debug .. make killall -9 oscam echo "oscam killed" sleep 1 gdb-ex "set logging on" ex "show logging" oscam-x run echo "oscam exit debug"
Then again press the ESC key and
Type the following
and press ENTER
Then the rights to change
Ready
Create scripts for configuration path
Here i just typing not press ENTER!
Then copy the pure click here and in the putty window with the right mouse button
Then again press the ESC key and
Type the following
and press ENTER
Then the rights to change
Then we log off from the server
OScam start using the scripts in debug mode
Connect to the program Putty (for Windows) as root to the server. Then we enter the following
When you first start, we use the gdb cmake-start scripts so that OScam binary is compiled for the first time!
Then you should see the following in the output
.
.
.
.
[97%] Built target cscrypt
Scanning dependencies of target svnversion
[97%] Built target svnversion
Scanning dependencies of target oscam
[98%] Building C object CMakeFiles / oscam.dir / oscam.o
Linking C executable oscam
[98%] Built target oscam
Scanning dependencies of target list_smargo
[100%] Building C object utils / CMakeFiles / list_smargo.dir / list_smargo.o
Linking C executable list_smargo
[100%] Built target list_smargo
oscam: No process found
oscam killed
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 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 "i686-linux-gnu".
For bug reporting instructions, please see:
< http://www.gnu.org/software/gdb/bugs/ > ...
Reading symbols from / home / oscam_doctor / oscam-svn / build oscam...done /.
Copying output to gdb.txt.
Currently logging to "gdb.txt".
Logs will be appended to the log file.
Output will be logged and displayed.
[Thread debugging using libthread_db enabled]
[New Thread 0xb7ff5280 (LWP 2755)]
[New Thread 0xb7fee280 (LWP 2756)]
[New Thread 0xb7fe7280 (LWP 2757)]
[New Thread 0xb7fe0b70 (LWP 2758)]
[New Thread 0xb77dfb70 (LWP 2759)]
[New Thread 0xb6fdeb70 (LWP 2760)]
[New Thread 0xb67ddb70 (LWP 2761)]
[New Thread 0xb5fdcb70 (LWP 2762)]
Display More
If you already have the OScam binary, then you can use the gdb-start script
Then you should see the following in the output
root @ Alix :/ home / oscam_doctor / oscam-svn / build #. / gdb-start
oscam: No process found
oscam killed
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 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 "i686-linux-gnu".
For bug reporting instructions, please see:
< http://www.gnu.org/software/gdb/bugs/ > ...
Reading symbols from / home / oscam_doctor / oscam-svn / build oscam...done /.
Copying output to gdb.txt.
Currently logging to "gdb.txt".
Logs will be appended to the log file.
Output will be logged and displayed.
[Thread debugging using libthread_db enabled]
[New Thread 0xb7ff5280 (LWP 2772)]
[New Thread 0xb7fee280 (LWP 2773)]
[New Thread 0xb7fe7280 (LWP 2774)]
[New Thread 0xb7fe0b70 (LWP 2775)]
[New Thread 0xb77dfb70 (LWP 2776)]
[New Thread 0xb6fdeb70 (LWP 2777)]
[New Thread 0xb67ddb70 (LWP 2778)]
[New Thread 0xb5fdcb70 (LWP 2779)]
Display More
The one thing about the whole thing
With both scripts, the log files are automatically created for gdb -> / home / oscam_doctor / oscam-svn / build / gdb.txt
Now, when should crash OScam would see as output in putty following
Reading symbols from / home / proto / oscam-svn / build oscam...done /.
Copying output to gdb.txt.
Currently logging to "gdb.txt".
Logs will be appended to the log file.
Output will be logged and displayed.
[Thread debugging using libthread_db enabled]
[New Thread 0xb7ff5280 (LWP 2804)]
[New Thread 0xb7fee280 (LWP 2805)]
[New Thread 0xb7fe7280 (LWP 2806)]
[New Thread 0xb7fe0b70 (LWP 2807)]
[New Thread 0xb77dfb70 (LWP 2808)]
[New Thread 0xb6fdeb70 (LWP 2809)]
[New Thread 0xb67ddb70 (LWP 2810)]
[New Thread 0xb5fdcb70 (LWP 2811)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7b602a0 (LWP 16480)]
0x080a4f59 in cc_available (rdr = 0x0, check type = 0) at module-cccam.c: 3897
3897 struct s_client * cl = rdr-> client; (gdb)
Display More
! IMPORTANT! Appears now expects "gdb" an input so the backtrace that we should do with it, it is written to the log file gdb.txt
So we simply type
And then get the backtrace shown
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7b602a0 (LWP 16480)]
0x080a4f59 in cc_available (rdr = 0x0, check type = 0) at module-cccam.c: 3897
3897 struct s_client * cl = rdr-> client;
(Gdb) bt
# 0 0x080a4f59 in cc_available (rdr = 0x0, check type = 0) at module-cccam.c: 3897
# 1 in 0x080b0afc matching_reader he (= 0x8296da8, rdr = 0x815cbbcool at oscam chk.c: 409
# 2 0x080527c1 in get_cw (client = 0xb7a23628 he = 0x8296dacool at oscam.c: 2491
# 3 0x0809f228 in cc_parse_msg (cl = 0xb7a23628, buf = 0x82a33a0 "k \ 001", l = 164) at module-cccam.c: 2124
# 4 in 0x080a057e cc_recv (cl = 0xb7a23628,
buf = 0xb7b5f210 "PARTNER: OSCam v1.00-unstable_svn, build # 4581 (i686-pc-linux-debug) [EXT, SID]", l = 1024)
at module-cccam.c: 2533
# 5 in 0x08053df7 process_input (
buf = 0xb7b5f210 "PARTNER: OSCam v1.00-unstable_svn, build # 4581 (i686-pc-linux-debug) [EXT, SID]", l = 1024, timeout =) 10
at oscam.c: 2844
# 6 0x080a3994 in cc_srv_connect (cl = 0xb7a2362cool at module-cccam.c: 3514
# 7 0x080a3cf4 in cc_srv_init (cl = 0xb7a2362cool at module-cccam.c: 3583
# 8 0xb7dd71b5 in start_thread () from / lib/libpthread.so.0
# 9 0xb7d4662e in clone () from / lib/libc.so.6
(Gdb)
Display More
And only now the output is written in the gdb.txt!
Source: Stream Board
Translated from Italian using Google.