I'm running into a strange seg fault with the module cjson. The
strange part is that it does not occur when I run the code under
Emacs' Pydb.
Here's an example:
import sys, cjson
d1 = {'a': 1, 'b': 2, 'c': 3}
print sys.version
j1 = cjson.encode(d1)
print j1 # should print the string '{"a": 1, "c": 3, "b": 2}'
The code above runs fine under Pydb, but segfaults at the call to
cjson.encode when I run it from the command line in a standard
Linux shell interaction. In the printed version strings are
identical.
I figure this must be a bug in cjson. I'd love to find a workaround
for it, and hope that this strange difference between Pydb and the
shell command line may be a clue to that.
Any thoughts?
TIA!
kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded. 4 1185
kj schrieb:
I'm running into a strange seg fault with the module cjson. The
strange part is that it does not occur when I run the code under
Emacs' Pydb.
Here's an example:
import sys, cjson
d1 = {'a': 1, 'b': 2, 'c': 3}
print sys.version
j1 = cjson.encode(d1)
print j1 # should print the string '{"a": 1, "c": 3, "b": 2}'
The code above runs fine under Pydb, but segfaults at the call to
cjson.encode when I run it from the command line in a standard
Linux shell interaction. In the printed version strings are
identical.
I figure this must be a bug in cjson. I'd love to find a workaround
for it, and hope that this strange difference between Pydb and the
shell command line may be a clue to that.
Any thoughts?
Are you sure you actually run the same interpreter in emacs as you do on
the commandline?
Diez
In <6b*************@mid.uni-berlin.de"Diez B. Roggisch" <de***@nospam.web.dewrites:
>kj schrieb:
>I'm running into a strange seg fault with the module cjson. The strange part is that it does not occur when I run the code under Emacs' Pydb.
Here's an example:
import sys, cjson
d1 = {'a': 1, 'b': 2, 'c': 3} print sys.version j1 = cjson.encode(d1) print j1 # should print the string '{"a": 1, "c": 3, "b": 2}'
The code above runs fine under Pydb, but segfaults at the call to cjson.encode when I run it from the command line in a standard Linux shell interaction. In the printed version strings are identical.
I figure this must be a bug in cjson. I'd love to find a workaround for it, and hope that this strange difference between Pydb and the shell command line may be a clue to that.
Any thoughts?
>Are you sure you actually run the same interpreter in emacs as you do on the commandline?
No, I'm not. All I know is that both Emacs and the commandline
are running on the same machine, and that the version string that
the program prints is the same in both conditions. How can I verify
that that the same interpreter is running in both cases?
Kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
kj wrote:
In <6b*************@mid.uni-berlin.de"Diez B. Roggisch"
<de***@nospam.web.dewrites:
>>kj schrieb:
>>I'm running into a strange seg fault with the module cjson. The strange part is that it does not occur when I run the code under Emacs' Pydb.
Here's an example:
import sys, cjson
d1 = {'a': 1, 'b': 2, 'c': 3} print sys.version j1 = cjson.encode(d1) print j1 # should print the string '{"a": 1, "c": 3, "b": 2}'
The code above runs fine under Pydb, but segfaults at the call to cjson.encode when I run it from the command line in a standard Linux shell interaction. In the printed version strings are identical.
I figure this must be a bug in cjson. I'd love to find a workaround for it, and hope that this strange difference between Pydb and the shell command line may be a clue to that.
Any thoughts?
>>Are you sure you actually run the same interpreter in emacs as you do on the commandline?
No, I'm not. All I know is that both Emacs and the commandline
are running on the same machine, and that the version string that
the program prints is the same in both conditions. How can I verify
that that the same interpreter is running in both cases?
By e.g.
import sys
print sys.prefix
Additionally, you should compare what
sys.path
contains and if it's the same - otherwise it might be that cjson is picked
up from somewhere else.
If all that's the case, I'd invoke python through gdb and see where the
segfault happens.
BTW: I've been using (and even patching) cjson - without any troubles
whatsoever.
Diez
[Note: I changed the subject line to make it more informative.]
In <6b*************@mid.uni-berlin.de"Diez B. Roggisch" <de***@nospam.web.dewrites:
>kj wrote:
>In <6b*************@mid.uni-berlin.de"Diez B. Roggisch" <de***@nospam.web.dewrites:
>>>kj schrieb: I'm running into a strange seg fault with the module cjson. The strange part is that it does not occur when I run the code under Emacs' Pydb.
Here's an example:
import sys, cjson
d1 = {'a': 1, 'b': 2, 'c': 3} print sys.version j1 = cjson.encode(d1) print j1 # should print the string '{"a": 1, "c": 3, "b": 2}'
The code above runs fine under Pydb, but segfaults at the call to cjson.encode when I run it from the command line in a standard Linux shell interaction. In the printed version strings are identical.
I figure this must be a bug in cjson. I'd love to find a workaround for it, and hope that this strange difference between Pydb and the shell command line may be a clue to that.
Any thoughts?
>>>Are you sure you actually run the same interpreter in emacs as you do on the commandline?
No, I'm not. All I know is that both Emacs and the commandline are running on the same machine, and that the version string that the program prints is the same in both conditions. How can I verify that that the same interpreter is running in both cases?
>By e.g.
>import sys print sys.prefix
>Additionally, you should compare what
>sys.path
>contains and if it's the same - otherwise it might be that cjson is picked up from somewhere else.
>If all that's the case, I'd invoke python through gdb and see where the segfault happens.
Thanks for that suggestion. I did so, and this is gdb's output at
the time failure:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47622454277872 (LWP 14555)]
encode_object (object=0x777390) at cjson.c:946
946 temp = PyList_GET_ITEM(pieces, 0);
In my experience, however, the root cause of a segfault is often
quite far away in the code from where it is triggered...
Anyway, thanks for your help.
kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rick Brandt |
last post by:
Here is a simplified example of what I am passing to a Java SAX parser
within a servlet via an HTTPRequest...
<?xml version="1.0"?>
<Record>
<ID>1092853685</ID>
<Notes><!]></Notes>
</Record>...
|
by: Rob Ristroph |
last post by:
Hi,
It's pretty unhelpful to post "I have a huge piece of code that
crashes in strange places, what's the problem?" but that's basically
my problem and I really am at my wit's end.
The piece...
|
by: Neil Ginsberg |
last post by:
I have a strange situation with my Access 2000 database. I have code in the
database which has worked fine for years, and now all of a sudden doesn't
work fine on one or two of my client's...
|
by: Marlene Stebbins |
last post by:
Something very strange is going on here. I don't know if it's a C
problem or an implementation problem. The program reads data from
a file and loads it into two arrays. When xy, x, y, *xlist and...
|
by: Tyler Foreman |
last post by:
Hello,
I have a strange problem that occurs every so often in my
application. It usually takes place when I hide one form
and activate another. What happens is I get the
following exception:...
|
by: Paul Rudin |
last post by:
I can't get the gdb fringe interaction functionality to work with
either pdb or pydb. Any hints as to versions or incantations I should
try?
I have the emacs22 from debian unstable...
|
by: R. Bernstein |
last post by:
A release of pydb (1.23) is currently scheduled for around May
30th. If you can and want to help make sure the release is okay, you can try out what is currently in CVS:...
|
by: Diez B. Roggisch |
last post by:
Hi,
I'm fiddling around with pydb. Installation and usage are fine. What I
especially like is the fact that you can attach a signal such that you drop
into debugging mode on demand.
But this...
|
by: DiAvOl |
last post by:
Hello everyone,
Please take a look at the following code:
#include <stdio.h>
typedef struct person {
char name;
int age;
} Person;
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |