For academic reasons, I'm hacking on the Python source trying to add
some new capabilities. At present, I'm making minor changes mostly to
familiarise myself with the code and gain awareness of what issues I
may encounter, with the result that I encountered a fairly strange one
(to me, anyway).
As I wanted to add new fields to all Python objects, it seemed to make
the most sense to add them to PyObject_HEAD. When I added an int field
to the end of PyObject_HEAD, however, the make process failed (see
below). This was on a Pentium-M running GCC 3.4.6 under Gentoo Linux. I
switched to my other computer, and Athlon 64 running GCC 4.1.0 under
Gentoo Linux, and it compiled; I dismissed the earlier failure as an
irritating but fixed GCC bug, and went on---until I added another int
field and ran into a failure at exactly the same place.
The error looks fairly uninformative, as such:
/bin/sh: line 1: 6926 Segmentation fault CC='gcc -pthread'
LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g -O3 -Wall
-Wstrict-prototypes' ./python -E ./setup.py build
make: *** [sharedmods] Error 139
I can supply more information if desired (I ran a GDB backtrace), but
it really didn't tell me very much. None of the functions on the stack
were ones I had modified, so the only factor is the presence of that
second additional field in PyObject_HEAD (I can make it build by simply
commenting out that field and its initialiser in PyObject_HEAD_I NIT).
My question is therefore a vague, nebulous, open, and at least mildly
desperate one: What is the problem? The only notion that occurs to me
is that some part of the Python source is somehow upset by alignment
issues (or padding of some sort); if so then I have no clue where that
might be. If not, then I have no idea what's causing the errors at all.
Any help, thoughts, or advice would be vastly appreciated.
--
Petter Haggholm 2 2088
Petter Haggholm wrote: Any help, thoughts, or advice would be vastly appreciated.
After changing PyObject_HEAD, I would run "make distclean".
Most likely, some object files were not recompiled and still
using the old layout.
Regards,
Martin
Boy, do I feel foolish! I hang my head in shame and thank you for your
assistance---that solved it. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Nikola Milutinovic |
last post by:
Hi all.
I'm not subscribed to the list, so all replies to me mail directly.
I ran into a small problem, for which we have found a workaround. I was compiling PostgreSQL v7.4.1 and it's PL/Python module. Compilation failed on lines which had this:
typedef struct PLyPlanObject {
PyObject_HEAD;
...
} PLyPlanObject;
|
by: Nikola Milutinovic |
last post by:
Hi all.
OS: Tru64 UNIX 4.0d
PG: PostgreSQL v7.4.1
PY: Python v2.3.3
I just ran into a minor bug while compiling PL/Python module. It bombed outon lines 153 and 160 of ./src/pl/plpython/plpython.c complaining on incomplete type "PyObject_HEAD".
The source of the problem were these two typedefs:
|
by: ajikoe |
last post by:
Hi,
I tried to follow the example in swig homepage.
I found error which I don't understand.
I use bcc32, I already include directory where my python.h exist in
bcc32.cfg.
/* File : example.c */
#include <time.h>
|
by: 63q2o4i02 |
last post by:
Hi, I'm interested in using python to start writing a CAD program for
electrical design. I just got done reading Steven Rubin's book, I've
used "real" EDA tools, and I have an MSEE, so I know what I *want* at
the end of this; I just have never taken on a programming task of this
magnitude. I've seen that some are using python as a utility...
|
by: siggi |
last post by:
@Ben Sizer
Hi Ben,
in January I received your message re Pygame and Python 2.5:
As a Python (and programming ) newbie allow me a - certainly naive -
question:
| |
by: AngelBlaZe |
last post by:
Can you access the c object of a python object directly? Can this be
done in ctypes or directly throught python functions without reverting
to forking the python module?
scanario:
I have pyctx object that i get in python like this:
pyctx = cairo.Context(surface)
defined in the python extension this:
|
by: sndive |
last post by:
q#1:
in C I want to check if a given PyObject is a xml.dom.minidom.Node (or
a derivative).
how do i extract a PyTypeObject for such a class?
issue #2
I'm in a situation when i don't really need to extend python with any
classes of my own but
i do have extra luggage for the python data structures such as tuples,
lists, dictionaries, etc
|
by: Pie Squared |
last post by:
I've been looking at the Python source code recently, more
specifically trying to figure out how it's garbage collector works.
I've gathered that it uses refcounting as well as some cycle-detection
algorithms, but I haven't been able to figure out some other things.
Does Python actually have a single 'heap' where all the data is
stored?...
|
by: mathieu |
last post by:
Hi there,
I am currently involved in managing a large python/c++ project
(using swig to automagically wrap c++ code to python). So far my
current experience was that python was a second class citizen and
extremely little python code was written and everything seemed to
work.
Now this is the contrary, large portion of code are written...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |