Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > function causing core dump

Reply
Thread Tools

function causing core dump

 
 
Xaver Hinterhuber
Guest
Posts: n/a
 
      05-10-2004
Hello pythonistas,

I build a function with the following code segment:

codeObject = new.code(
0, # argcount
0, # nlocals
0, # stacksize
0, # flags
codeString, # code
(), # consts
(), # names
(), # varnames
'content', # filename
'content', # name
3, # first line number
codeString # lnotab
)
f = new.function(codeObject, dict, 'f')
f()

Everything runs fine, until the function is called with f().
When python tries to execute f(), the core dump happens.
I don't have any clue why python core dumps.
The codeString is nothing complex, its a one-liner.
Could you plz give me some tips what I have to do?

With kind regards
Xaver Hinterhuber


 
Reply With Quote
 
 
 
 
Terry Reedy
Guest
Posts: n/a
 
      05-10-2004

"Xaver Hinterhuber" <> wrote in message
news:c7o6al$i1j$...
> codeObject = new.code(
> 0, # argcount
> 0, # nlocals
> 0, # stacksize
> 0, # flags
> codeString, # code
> (), # consts
> (), # names
> (), # varnames
> 'content', # filename
> 'content', # name
> 3, # first line number
> codeString # lnotab
> )
> f = new.function(codeObject, dict, 'f')
> f()
>
> Everything runs fine, until the function is called with f().
> When python tries to execute f(), the core dump happens.
> I don't have any clue why python core dumps.
> The codeString is nothing complex, its a one-liner.





 
Reply With Quote
 
 
 
 
Michael Hudson
Guest
Posts: n/a
 
      05-10-2004
"Xaver Hinterhuber" <> writes:

> Hello pythonistas,
>
> I build a function with the following code segment:
>
> codeObject = new.code(
> 0, # argcount
> 0, # nlocals
> 0, # stacksize
> 0, # flags
> codeString, # code
> (), # consts
> (), # names
> (), # varnames
> 'content', # filename
> 'content', # name
> 3, # first line number
> codeString # lnotab
> )
> f = new.function(codeObject, dict, 'f')
> f()
>
> Everything runs fine, until the function is called with f().
> When python tries to execute f(), the core dump happens.
> I don't have any clue why python core dumps.
> The codeString is nothing complex, its a one-liner.
> Could you plz give me some tips what I have to do?


Doesn't the documentation for the new module have warnings plastered
all over it? Why are you using it?

Cheers,
mwh

--
About the use of language: it is impossible to sharpen a
pencil with a blunt axe. It is equally vain to try to do
it with ten blunt axes instead.
-- E.W.Dijkstra, 18th June 1975. Perl did not exist at the time.
 
Reply With Quote
 
Peter Otten
Guest
Posts: n/a
 
      05-10-2004
Xaver Hinterhuber wrote:

> Hello pythonistas,
>
> I build a function with the following code segment:
>
> codeObject = new.code(
> 0, # argcount
> 0, # nlocals
> 0, # stacksize
> 0, # flags
> codeString, # code
> (), # consts
> (), # names
> (), # varnames
> 'content', # filename
> 'content', # name
> 3, # first line number
> codeString # lnotab
> )
> f = new.function(codeObject, dict, 'f')
> f()
>
> Everything runs fine, until the function is called with f().
> When python tries to execute f(), the core dump happens.
> I don't have any clue why python core dumps.
> The codeString is nothing complex, its a one-liner.
> Could you plz give me some tips what I have to do?
>
> With kind regards
> Xaver Hinterhuber


The easiest approach is probably to start with an attribute set known to be
good:

>>> def f(): pass

....
>>> code = f.func_code
>>> names = dir(code)
>>> names.sort()
>>> for name in names:

.... if not name.startswith("_"):
.... print "%s=%r" % (name, getattr(code, name))
....
co_argcount=0
co_cellvars=()
co_code='d\x00\x00S'
co_consts=(None,)
co_filename='<stdin>'
co_firstlineno=1
co_flags=67
co_freevars=()
co_lnotab=''
co_name='f'
co_names=()
co_nlocals=0
co_stacksize=1
co_varnames=()
>>>


and change the values until you get a core dump - again.

Peter
 
Reply With Quote
 
Terry Reedy
Guest
Posts: n/a
 
      05-10-2004

"Michael Hudson" <> wrote in message
news:...
> Doesn't the documentation for the new module have warnings plastered
> all over it?


There is not a specific warning about the possibility of core dumps. Since
this is normally considered an interpreter bug, a specific disclaimer might
be appropriate. And maybe a few code tweaks could be added. At Richard
Hettinger's suggestion, I opened and assigned to him a SourceForge bug
report.
http://sourceforge.net/tracker/index...70&atid=105470

Terry J. Reedy




 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dump complete java VM state as core dump (not via OS) possible? halfdog Java 12 02-21-2013 06:14 AM
Core Solo & Core Duo are not Core microarchitecture; 65nm Pentium M chips bigal Hardware 0 03-22-2006 11:24 AM
Read Core Dump file ns Cisco 8 05-26-2005 03:07 AM
Sig handler causing core dump Mark Brackett C Programming 3 11-04-2004 01:51 PM
RE: function causing core dump Robert Brewer Python 5 05-17-2004 12:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57