Fedora Linux Support Community & Resources Center
  #16  
Old 18th May 2012, 09:00 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
linuxopera
Re: mmass 5.0.1 and python 2.7.3-1.fc16

I've been thinking about the heavy duty way to analyze this problem. The general procedure is clear, but working out the details would be the usual pain.

If programs are compiled with the right options then the GNU debugger (called "gdb") can be used to determine what functions cause the program to crash.

The documentation you get for gdb from
Code:
 man gdb
is less extensive that you get from
Code:
 info gdb
I myself don't like the "info" user interface, so I'd look for web tutorials.

There are pages on the web that explain (or attempt to explain!) how to configure the python interpreter to produce debugging information.

If we learn how to do that, there is still the problem of getting the parts of mmass that are written in C (the "shared objects") compiled so they produce debugging information. In the mmass source, the only *.c file that I notice is mspy/calculations.c. We could compile that file with the correct debugging options (This part of the process, I know how to do.) and produce a new *.so file and put the *.so file where it's supposed to be.

Then we need to run mmass using gdb. This requires running python and telling python to process the file /usr/share/mmass/mmass.py,

From browsing the web, I think the way to do this would be:

Code:
gdb
This brings up the new command line interface used by gdb. I think you would enter the command

Code:
run python /usr/share/mmass/mmass.py
Assuming the program crashes, the command
Code:
bt
is use to print out a "back trace" which shows the functions that were involved.

Perhaps this illustrates why automotive repair shops often tackle problems by randomly replacing parts. The diagnostic approach is not easy.

Edit: There are some simpler, but more limited tools than gdb. The strace command will show what system calls are being made and may reveal a missing file that mmass or python tries to open. I think

Code:
strace python /usr/share/mmass/mmass.py
is valid syntax.

Commands that spew out reams of text can be handled by piping the output to the "less" program or by sending it to a file.

Code:
strace python /usr/share/mmass/mmass.py | less
Code:
strace python  /usr/share/mmass/mmass.py >&myoutput.txt
Then look at the file with "less" or your favorite text editor.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."

Last edited by tashirosgt; 19th May 2012 at 05:00 AM.
Reply With Quote
  #17  
Old 19th May 2012, 10:23 PM
Farsight Offline
Registered User
 
Join Date: May 2012
Location: United Kingdom
Posts: 12
linuxfirefox
Re: mmass 5.0.1 and python 2.7.3-1.fc16

Ok folks, I guess I'll try to deal with the things you've posted so far, though I have to admit that the things you are talking about are well beyond my current understanding. If we are going to find a solution, I'll need some clear instructions.

Regarding running "Hello World", that script launched absolutely fine. I generated the file in GEdit, saved it as a .py file type and then used terminal to display the words "Hello World" from within the HelloWorld.py file.

By replicating the problem and searching /var/log/messages, I was presented with the following output:

Quote:
May 19 21:58:00 localhost goa[1641]: goa-daemon version 3.2.1 starting [main.c:112, main()]
May 19 21:58:02 localhost kernel: [ 54.804670] sd 6:0:0:0: [sdb] Test WP failed, assume Write Enabled
May 19 21:58:02 localhost kernel: [ 54.806797] sd 6:0:0:0: [sdb] Asking for cache data failed
May 19 21:58:02 localhost kernel: [ 54.806802] sd 6:0:0:0: [sdb] Assuming drive cache: write through
May 19 21:58:08 localhost dbus-daemon[933]: ** Message: No devices in use, exit
May 19 21:58:14 localhost abrtd: Directory 'ccpp-2012-05-19-21:58:12-1740' creation detected
May 19 21:58:14 localhost abrt[1743]: Saved core dump of pid 1740 (/usr/bin/python2.7) to /var/spool/abrt/ccpp-2012-05-19-21:58:12-1740 (54775808 by$
May 19 21:58:19 localhost abrtd: DUP_OF_DIR: /var/spool/abrt/ccpp-2012-05-17-19:24:38-6933
May 19 21:58:19 localhost dbus[933]: [system] Failed to activate service 'org.freedesktop.colord-sane': timed out
May 19 21:58:19 localhost dbus-daemon[933]: dbus[933]: [system] Failed to activate service 'org.freedesktop.colord-sane': timed out
May 19 21:58:19 localhost colord[1534]: (colord:1534): Cd-WARNING **: failed to contact colord-sane: GDBus.Error:org.freedesktop.DBus.Error.TimedOut$
May 19 21:58:19 localhost dbus-daemon[933]: dbus[933]: [system] Failed to activate service 'org.freedesktop.colord-sane': timed out
May 19 21:58:19 localhost colord[1534]: (colord:1534): Cd-WARNING **: failed to contact colord-sane: GDBus.Error:org.freedesktop.DBus.Error.TimedOut$
May 19 21:58:19 localhost abrtd: Problem directory is a duplicate of /var/spool/abrt/ccpp-2012-05-17-19:24:38-6933
May 19 21:58:19 localhost abrtd: Deleting problem directory ccpp-2012-05-19-21:58:12-1740 (dup of ccpp-2012-05-17-19:24:38-6933)
May 19 21:58:47 localhost chronyd[926]: Selected source 109.72.80.61
May 19 21:58:49 localhost dbus[933]: [system] Activating service name='net.reactivated.Fprint' (using servicehelper)
May 19 21:58:49 localhost dbus-daemon[933]: dbus[933]: [system] Activating service name='net.reactivated.Fprint' (using servicehelper)
May 19 21:58:49 localhost dbus-daemon[933]: Launching FprintObject
May 19 21:58:49 localhost dbus[933]: [system] Successfully activated service 'net.reactivated.Fprint'
May 19 21:58:49 localhost dbus-daemon[933]: dbus[933]: [system] Successfully activated service 'net.reactivated.Fprint'
May 19 21:58:49 localhost dbus-daemon[933]: ** Message: D-Bus service launched with name: net.reactivated.Fprint
May 19 21:58:49 localhost dbus-daemon[933]: ** Message: entering main loop
May 19 21:58:53 localhost kernel: [ 106.521904] sd 6:0:0:0: [sdb] Test WP failed, assume Write Enabled
May 19 21:58:53 localhost kernel: [ 106.524045] sd 6:0:0:0: [sdb] Asking for cache data failed
May 19 21:58:53 localhost kernel: [ 106.524054] sd 6:0:0:0: [sdb] Assuming drive cache: write through
May 19 21:59:20 localhost dbus-daemon[933]: ** Message: No devices in use, exit
I looked in that file having used:

Code:
 yum install nano
Then in 'su' mode, ran:
Code:
 nano -w /var/log/messages


---------- Post added at 10:23 PM ---------- Previous post was at 10:07 PM ----------

Ok, I've managed to also look in to using strace to generate a text file. There are a huge number of lines in this file - are there any particular ones that I should be looking for that would be useful to you in helping me diagnose issues?
__________________
Currently running: Dual boot Windows Vista 32 and Fedora 16 'Verne' (Kernel: Linux 3.3.5-2.fc16.i686; Gnome 3.2.1)
Reply With Quote
  #18  
Old 19th May 2012, 10:55 PM
marko's Avatar
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,442
linuxfirefox
Re: mmass 5.0.1 and python 2.7.3-1.fc16

Quote:
Originally Posted by Farsight View Post
Hi folks,

I've tried both options and had no success. In Ubuntu 12.04 and Fedora 16, the command echo $PYTHONPATH just returns a blank line. I've yet to try a simple python application - I'm not really sure what would be a suitable application to use for testing. Any recommendations?

Having installed the python3-numpy package, nothing changes with regards to loading mmass.

Fingers crossed there are alternative options out there for me Thank you both for your suggestions so far.

All the best,
Farsight.
Another thing to remember here, you're saying you've not tried a simple python application. The "yum" package installer tool is actually a very complex python application. If it works, you're very likely to have a good and working python installation. (that is, yum in normal usage exercises lots of python functionality so it's a good robustness test of your python). If yum works and mmass doesn't, the blame is more likely numpy, wxPython or any other imports that mmass uses that yum doesn't or mmass itself. Python itself has some debug flags you can set but like "-d" or "-W" but I suspect they'd just give you the same unhelpful warning it already shows.

Last edited by marko; 19th May 2012 at 11:03 PM.
Reply With Quote
  #19  
Old 20th May 2012, 01:58 AM
Farsight Offline
Registered User
 
Join Date: May 2012
Location: United Kingdom
Posts: 12
linuxfirefox
Re: mmass 5.0.1 and python 2.7.3-1.fc16

Thanks for the pointer Marko, genuinely. While I'd like to have the problem solved, such issues have a nice tendency to make us learn more about the system we're using - such as 'yum's' python usage.
__________________
Currently running: Dual boot Windows Vista 32 and Fedora 16 'Verne' (Kernel: Linux 3.3.5-2.fc16.i686; Gnome 3.2.1)
Reply With Quote
  #20  
Old 20th May 2012, 02:34 AM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
linuxfirefox
Re: mmass 5.0.1 and python 2.7.3-1.fc16

Quote:
Originally Posted by Farsight View Post
I've managed to also look in to using strace to generate a text file. There are a huge number of lines in this file - are there any particular ones that I should be looking for that would be useful to you in helping me diagnose issues?
Look for lines involving "open(...) = -1" and "read(...) = -1 The -1 indicates a failure . (An "=0" indicates success.) Don't get too excited when you find them because it is normal for applications to look in various places for certain files, fail, and proceed until they find the right place. However, if the file name suggests that it might be some data that mmass needs then it would worth investigating whether that file is missing, corrupt, or in a directory the program isn't searching.

You may see where the shared object file(s) is opened or loaded with the "ld..." command. The only shared object file that I noticed in the source code was called calculation.so (or it might have been plural, calculations.so). If the lines after that indicate a crash (for example, if you see a "core dump" file being opened and written) then this would be a good hint that the problem is in the shared object.

I'll have to do some research before I offer any analysis of your /var/log/messages.

-----

Update:

Code:
May 19 21:58:00 localhost goa[1641]: goa-daemon version 3.2.1 starting [main.c:112, main()]
The goa-daemon is apparently a process associated with gnome, so that looks normal.
Code:
May 19 21:58:02 localhost kernel: [ 54.804670] sd 6:0:0:0: [sdb] Test WP failed, assume Write Enabled
May 19 21:58:02 localhost kernel: [ 54.806797] sd 6:0:0:0: [sdb] Asking for cache data failed
May 19 21:58:02 localhost kernel: [ 54.806802] sd 6:0:0:0: [sdb] Assuming drive cache: write through
There are posts on the web that say that the above messages is associated with a module that is trying to use a USB device like a card reader.
This could be a bug in the module. I think it's unrelated to the problem with mmass.

Code:
May 19 21:58:08 localhost dbus-daemon[933]: ** Message: No devices in use, exit
There are always messages from dbus-daemon in the logs. I've yet to figure out what they mean.

Code:
May 19 21:58:14 localhost abrtd: Directory 'ccpp-2012-05-19-21:58:12-1740' creation detected
May 19 21:58:14 localhost abrt[1743]: Saved core dump of pid 1740 (/usr/bin/python2.7) to /var/spool/abrt/ccpp-2012-05-19-21:58:12-1740 (54775808 by$
May 19 21:58:19 localhost abrtd: DUP_OF_DIR: /var/spool/abrt/ccpp-2012-05-17-19:24:38-6933
This shows the termination of the attempt to run mmass and gives the name of the core dump file used to record it. You should be able to find the file. The debugger gdb can read core dump files. However I find what it reports to be cryptic - much less informative that the type of output you get when you use gdb with the "run..." command.
(By the way, you could try using gdb and then run.... without doing any special preparations on python and just see what the "bt" commands says.)

If we use gdb on the core dump, perhaps some forum member has eyes that are educated enough to interpret output. Directions on the web say the command has the form

Code:
gdb /path/to/application /path/to/corefile
I think those directions are imprecise because what worked for me is to put the path to the application, not including the name of the application file and put the path to the core file and include the name of the corefile, which was "coredump" on my machine.

So my guess for what to do in your case is:

Code:
gdb  /usr/bin  /var/spool/abrt/ccpp-2012-05-19-21:58:12-1740/coredump
(If that doesn't work, try using /usr/bin/python2.7)

In the web example I looked at the output of gdb conveniently gave the line in the program that caused the crash. I expect the command
Code:
bt
will output something, but it may be hard to interpret.



Code:
May 19 21:58:19 localhost dbus[933]: [system] Failed to activate service 'org.freedesktop.colord-sane': timed out
May 19 21:58:19 localhost dbus-daemon[933]: dbus[933]: [system] Failed to activate service 'org.freedesktop.colord-sane': timed out
May 19 21:58:19 localhost colord[1534]: (colord:1534): Cd-WARNING **: failed to contact colord-sane: GDBus.Error:org.freedesktop.DBus.Error.TimedOut$
May 19 21:58:19 localhost dbus-daemon[933]: dbus[933]: [system] Failed to activate service 'org.freedesktop.colord-sane': timed out
May 19 21:58:19 localhost colord[1534]: (colord:1534): Cd-WARNING **: failed to contact colord-sane: GDBus.Error:org.freedesktop.DBus.Error.TimedOut$
I think the above messages have to do wih a process that configures the SANE program for scanners. The author of sane-colord explains it here: http://blogs.gnome.org/hughsie/

Code:
May 19 21:58:19 localhost abrtd: Problem directory is a duplicate of /var/spool/abrt/ccpp-2012-05-17-19:24:38-6933
May 19 21:58:19 localhost abrtd: Deleting problem directory ccpp-2012-05-19-21:58:12-1740 (dup of ccpp-2012-05-17-19:24:38-6933)
I don't understand why there would be duplicate of a core dump directory.


I just started using nano myself. The "less " command is somewhat safer to use since it won't let you write into the file accidentally. Typing "/" puts you in a search mode. You can enter as string and use "n" to search for the next instance of the string.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."

Last edited by tashirosgt; 20th May 2012 at 05:01 PM.
Reply With Quote
  #21  
Old 27th May 2012, 03:03 PM
Farsight Offline
Registered User
 
Join Date: May 2012
Location: United Kingdom
Posts: 12
linuxfirefox
Re: mmass 5.0.1 and python 2.7.3-1.fc16

Hey folks,

Sorry for the delay in a response, I've been a little busy recently.

Anyway, so I am now running a 64 bit Fedora 16 install on my desktop and mmass works absolutely fine. This suggests to me that something is specifically wrong with my 32 bit install. I'll be downloading F17 32-bit in a few days, so I'll see if that resolves the issue.

I've still got to look at the output previously discussed. Hopefully I can spot something a-miss in there. I'll post back what I find (if I find anything!).
__________________
Currently running: Dual boot Windows Vista 32 and Fedora 16 'Verne' (Kernel: Linux 3.3.5-2.fc16.i686; Gnome 3.2.1)
Reply With Quote
Reply

Tags
1fc16, mmass, python

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Missing kernel release for kmod-nvidia-3.2.6-3.fc16.x86_64-290.10-1.fc16.14.x86_64 d4v1dv00 Using Fedora 2 16th February 2012 01:12 AM
Error With Python / Python-Twisted-Web HMSS013 Using Fedora 6 11th November 2010 04:07 AM
Python, IDLE, Python-tools Gnome. Deonis Using Fedora 2 12th March 2009 03:44 AM
Processing Conflict: python-devel conflicts python< 2.3.4-13.1 guarriman Using Fedora 0 15th September 2005 05:53 PM


Current GMT-time: 10:32 (Saturday, 18-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat