Bus Error 10 from Importing Python Module - memory-management

I installed the gdal module for python a week ago, via the GDAL Complete 1.11 Framework Package. I wrote a program which relied heavily on gdal and osgeo and ogr to work with shapefiles (.shp) and rasters (.TIF). Today, without changing my code at all, when I ran it in the terminal as I usually do, I got back:
Bus error: 10
Since I hadn't changed anything with my code, I looked to see whether the problem was with one of my imports. When I commented everything out besides
from osgeo import ogr, gdal
I got the same error, similarly for when I just ran python in the terminal and tried
import gdal
I read that Bus Errors are caused by non-existent memory addresses, so I thought the module might somehow not be there anymore, so I listed my modules using
["%s==%s" % (i.key, i.version) for i in pip.get_installed_distributions()]
and gdal was listed in there. Anyway, that wasn't necessarily the best thought since python throws an ImportError for modules it doesn't recognize. Other imports, like numpy, math, time, and datetime all work for me. Since bus errors are a sort of hardware fault with the memory, I tried a soft and then a hard reboot, still getting the same bus error. In fact, since I restarted my computer, it's been dreadfully slow. So my first question is why the Bus Error occurred and how to fix it, and second, I'm wondering how to get my computer back up to speed.
Last night, I dropped my computer in its case, but gdal (and seemingly everything else) was working fine this morning, until this error came about.
I appreciate your time and input.

Related

New Python Install; Scripts Running very Slow

Current Python Version 2.7.10 - I have tried a straight download from python.org and the Anaconda distribution.
Previous Python Version was 2.7.x (don't remember) - I know it was an Enthought Canopy distribution.
I just 'upgraded' windows from 7 to 10pro. I reinstalled everything on my computer for a fresh start. I installed the most recent version of Python 2.7.10. I am now running a script that I was running just yesterday on my Windows 7 OS, and it is running incomprehensibly slow now, and I have no idea why. It is a script that is based on the code from a tutorial found here:
http://pythonprogramming.net/sentiment-analysis-module-nltk-tutorial/
It has a lot of data that is loaded, and it wasn't running super fast before, but now it takes so long, it looks like it's frozen. Any thoughts? I thought that it had something to do with packages that I had installed on my previous Python environment, like a C-compiler or something. The output is nothing, because it just hangs for a long time and slowly moves through the script. It isn't broken, there isn't a loop it's stuck in. If I wait long enough, it will start showing me the correct output. When I hit 'Ctrl-C' this is what I get.
python -mcProfile MAIN_Tutorial_2.py
forrtl: error (200): program aborting due to control-C event
Image PC Routine Line Source
KERNELBASE.dll 00007FFB485B5674 Unknown Unknown Unknown
KERNEL32.DLL 00007FFB49412D92 Unknown Unknown Unknown
ntdll.dll 00007FFB4B819F64 Unknown Unknown Unknown
Don't think that helps, but just in case.
I've been struggling for a while with similar topic - long start up time of python scripts.
This is what I've found on python documentation site:
Why does Python sometimes take so long to start?
The problem may be caused by a misconfiguration of virus checking software on the problem machine. Some virus scanners have been known to introduce startup overhead of two orders of magnitude when the scanner is configured to monitor all reads from the filesystem. Try checking the configuration of virus scanning software on your systems to ensure that they are indeed configured identically. McAfee, when configured to scan all file system read activity, is a particular offender.
Unfortunately, I don't have a quick way to test whether disabling file system protection will help, so I hope it will solve your problem and will be glad to hear from you.

GCC 3.4.3/Cygwin - slowness

I have a GCC 3.4.3 toolchain built for ARM (arm-elf) here in my Windows 7 (64bits) setup. We use this to build our software product to a specific hardware.
Recently, we have been experiencing some problems with this particular toolchain.
First, when we try to call arm-elf-gcc to build each source file (there are lots of them), it complained about it not being able to allocate enough heap.
Then, I thought it was some problem with the outdated cygwin DLL distributed by the hardware vendor. So I replaced it with a more recent version (1.7.35). The problem stopped and the build does go ok but now it is incredibly SLOW (it took about 40s to build a single .c source file).
Does anyone has experienced this problem before? How can I debug and fix it?
Thanks in advance.
Sounds like you have had a similar problem to me and might be worth trying this. When i first encountered this, I had to install cygserver and then run this (make sure you right click admin):
Previous solution
However, the problem resumed and I simultaneously couldn't install/uninstall some problems. Eventually I resolved this by terminating SearchIndexer.exe in Task Manager. Indeed, I have gone in to Control Panel / Searach Indexing and pulled it back from doing any indexing. My installation taking 1hr took 3 more seconds. The change to Cygwin was instantaneous.
Cygwin is now flying!
I've had an issue with slow execution of builds for a while on cygwin, using make and a proprietary compiler that "isn't gcc, honest...", but has very similar error returns.
I was forced to update yesterday and ran into the issue of rebaseall simply failing to execute. This forced me to dig into other things and I found a report that Trusteer Rapport/End Point Protection has been known to cause issues with rebaseall,and slow response times. So I removed it. This fixed the rebaseall, but has also massively increased the speed of my build. Worth checking to see if you have it installed, try removing it. AV packages in general are reputed to interfere and may be the cause.

Cannot perform basic commands in Tcl package Snack

I am trying to use a Tcl application called "Linger" (developed by Doug Rohde) in order to create a reading experiment. I need to use the package Snack in order to record subjects' repetitions of what they read. I got a number of error messages when trying the script in the application, all related to this package.
So, in Wish I tried to find out whether the package is correctly loaded.
package require snack
yields
couldn't load library "C:/Tcl/lib/tcl8.6/snack2.2/libsnack.dll"
When first running
package provide snack 2.2.10
then
package require snack
it gives me
2.2.10
Does that mean the package is loaded?
I tried to solve this question by running one of the basic commands in Snack's tutorial.
snack::sound s
should create a Snack sound object named s; when I try it, however, Wish gives me
invalid command name "snack::sound"
So now I know why my Linger script doesn't work, but I don't know how to solve the problem. I am very grateful for help or anyone pointing out a link with the answer.
I am running Tcl/Tk 8.6.3 and snack 2.2.10 on Windows 7 (64-bit). Tried the same on Mac OS 10.6 and Linux; same result.
The problem is that the implementation of the package is not being loaded for some reason. Alas, the error diagnostic:
couldn't load library "C:/Tcl/lib/tcl8.6/snack2.2/libsnack.dll"
isn't especially informative. If the file C:\Tcl\lib\tcl8.6\snack2.2\libsnack.dll exists (which you can check in Explorer; Tcl prefers to use Unix-style directory name separators internally) then it's most likely to be a 32-bit library vs 64-bit application (or vice versa) issue; you can't load mismatched libraries into running applications under anything remotely approaching normal circumstances.
Unfortunately, it seems that Snack is one of the packages that is most likely to be absent in a Tcl installation (it's not part of the ActiveTcl distribution, for example). You could try getting the code from the Snack site but I think that likely will need a 32-bit build of Tcl/Tk to work, and we now default to 64-bit builds on most platforms. I don't know why Snack stopped being built as part of ActiveTcl.
Doing a
package provide snack 2.2.10
won't help you. It just tells a lie to the Tcl runtime about the package, but without the real implementation, you won't be able to use it. (Strictly, it's how a package implementation tells the package manager that it has successfully loaded. It should only be used by package implementations under normal circumstances.)
If you will download and install WinTclTk snack will work. WinTclTk has snack already included. So you don't have to install it manualy. Just type
package require snack
and you will get information about already included snack package.
I tried it on virtual Windows XP(32bit).
I was trying the snack software from snack original site on Windows 7(64bit) and Ubuntu(64bit) with no success.

Hadoop FileSystem.getFS() pauses for about 2 minutes

I'm having a very strange problem. I'm using dfs-datastores Pail abstraction to write data to HDFS in Java. I don't think the Pail piece is important to the problem though.
When it calls org.apache.hadoop.fs.FileSystem getFS(java.lang.String path) with a path on my local filesystem it pauses for about 2 minutes seemingly doing nothing then returns. This is on my laptop.
The weird thing is that it worked really fast when I was on the network at my office today, but now that I'm home it's doing it again. I'm running Ubuntu 10.10 64-bit with Java 1.7.
Anyone have any ideas what it's doing? What could be different between being at work and being at home?
UPDATE:
I've been stepping through code with the debugger and it seems to be having trouble in Configuration.loadResource(). It's calling that multiple times and it will take 5-10 seconds to return from that function.
UPDATE2:
I've narrowed this down a little further. The biggest hang up seems to be when it calls KerberosName.setConfiguration(). Which would explain why it runs fast at work since the Active Directory acts as a Kerberos server. I don't have one here at home, so it can't find one. Now they question is why in the world it's trying to load the Java Kerberos stuff.
I found a solution (or at least a work around). I installed the krb5-kdc package and now my little program runs fast without any unexplained pauses. After this I removed krb5-kdc, tested and it was still running fast. I removed /etc/krb5.conf and it started doing the pause again. It looks like using the Hadoop library on Ubuntu (at least) requires a /etc/krb5.conf file.
Maybe this will help someone else.

twisted on mac problem

trying to run twisted on my mac and get the following error:
exceptions.ImportError: cannot import name poll
It fails on the line:
from twisted.internet import pollreactor
After some digging in google I found out that it's a problem with mac. But how can I fix that?
There is no pollreactor on OS X, because there is no poll (or - sometimes there is, it's complicated, but "no poll" is an okay first approximation).
So, use another reactor instead. If you need to exceed the 1024 file descriptor limit of select, then there's kqueue. kqueuereactor probably works marginally well as is, but there has been some work to improve it. If supporting many sockets on OS X is important for you, you might want to help with that effort. See http://twistedmatrix.com/trac/ticket/1918

Resources