473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

AIX -illegal instruction - importing extension module

Hi,

I am getting the following problem on AIX.
I create a small shared library. And tried to load it in python.

It core dumps with the following message:
Segmentation fault (core dumped)

At other time with another shared lib I got:
Illegal instruction: core dump

* The program works fine on hp-ux 11.11 and solaris 7.

NOTE:
* python - version: 2.2.3 is compiled with cc_r (Visual age 6.0 compiler)
it is ##### 64 bit ######
* AIX 5
* I compiled the shared lib with xlC, cc_r and g++ to see if the compiler
was an issue
* Also note that: when I copy the pwd.so from lib-dynload/pwd.so and moved
lib-dynload/pwd.so to lib-dynload/pwd.so.org and then imported pwd.so it
when through fine.
* When I wrote a C main() program to load the shared library and load the
symbol using dlopen and dlsym it worked fine.
The python program is:
=========================================
import os, sys
print "before import libspam"
import libspam ====> It dumps here
print "after import libspam"
print OK.
=========================================

The shared lib code is also very simple

================================================== ===============
PyObject *
spam_system(PyObject *self, PyObject *args)
{
char *command;
int sts;

printf("\n In spam_system \n");
if (!PyArg_ParseTuple(args, "s", &command))
{
printf("\n spam_system: FAILURE");
return NULL;
}
sts = system(command);
printf("\n spam_system: SUCCESS");

return Py_BuildValue("i", sts);
}

static PyMethodDef mmdb_methods[] =
{
{ "spam", spam_system, METH_VARARGS,
"mmdb.control( allow_fail, allow_fall_back ) -- Control the
kind of client that is created"
},
{ 0, 0, 0, 0 }
};

PyObject * initlibspam(void)
{
PyObject *module = Py_InitModule3("libspam", mmdb_methods, "Test Spam");

return module;
}
================================================== ===============

Jul 18 '05 #1
0 1741

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Torsten Mohr | last post by:
Hi, i write an extension module in C at the moment. I want to define some constants (integer mainly, but maybe also some strings). How do i do that best within this extension module in C? ...
8
by: Torsten Mohr | last post by:
Hi, i write an extension module in C at the moment. This module does some work on some own data types that consist of some values. The functions that can change the data are written in C. ...
0
by: Paul Mahon | last post by:
Hello, I recently managed to corrupt a table pretty badly. I read the sections in the documentation about recovering after a crash. None of the methods worked. All give output similar to the...
1
by: Chandra | last post by:
Hi, I developed a Visual C++ 6.0 MFC Application on Windows 2000 5.00.2195 Service Pack 4. THe Application runs fine on my machine. But when a customer who also has Windows 2000 is trying to...
3
by: Simon Burton | last post by:
Hi, I'm having some trouble linking one extension module to another because the linker expects a "lib" prefix and my python modules cannot have this prefix. I found two ways of doing it on a...
4
by: Mathias Waack | last post by:
Hi, I've embedded python into a legacy application. It works - most of the time. In some special situations the app crashes executing the "import random". There are two different situations: ...
2
by: murali026 | last post by:
Hi All, Here I have an Application which will be running on Power PC Processor. After some time i have receiving the following error. Program received a SIGILL, Illegal Instruction. I am...
8
by: Just another C hacker | last post by:
Hello friends, I'm writing a program in C with some bits in inline asm for efficiency. I'd like to be able to handle illegal instructions from within asm. Here's an example of a standalone asm...
1
by: justduick | last post by:
I have developed a visual c# application which executes properly on my computer and others that have visual studio installed. however when attempting to run it on a computer without visual studio i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.