vkondrat / yappi

Automatically exported from code.google.com/p/yappi
MIT License
0 stars 0 forks source link

Bus Error (Core Dump) when yappi.start() #53

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.import yappi
2.yappi.start()

What is the expected output? What do you see instead?
Python 2.7.2 (default, Oct  3 2011, 00:08:07)
[GCC 3.4.3 (csl-sol210-3_4-branch+sol_rpath)] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import yappi
>>> yappi.start()
Bus Error (core dumped)

What version of the product are you using? On what operating system?
yappi0.9.3
SunOS autoscape-1 5.10 Generic_147440-01 sun4v sparc SUNW,Netra-T5440

Please provide any additional information below.
gdb traces:

GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris"...
Starting program: /usr/local/bin/python ./Session.py -t pass_test 
--settings=dryrun=1,parallel_te=no
warning: Temporarily disabling breakpoints for unloaded shared library 
"/usr/lib/ld.so.1"
warning: Lowest section in /lib/libdl.so.1 is .hash at 00000094
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at 00000074

Program received signal SIGSEGV, Segmentation fault.
0xfe764a30 in screate (size=100) at callstack.c:30
30              cs->_items[i].t0 = 0;
(gdb) bt
#0  0xfe764a30 in screate (size=100) at callstack.c:30
#1  0xfe762af8 in _profile_thread (ts=0x1aeb78) at _yappi.c:160
#2  0xfe763590 in _start () at _yappi.c:801
#3  0xfe763ce4 in start (self=0x0, args=0x1aeb78) at _yappi.c:1118
#4  0x00129f38 in PyCFunction_Call (func=0x6b75a8, arg=0x8f5af8, kw=0x0) at 
Objects/methodobject.c:116
#5  0x000ba54c in PyEval_EvalFrameEx (f=0x63d590, throwflag=-4196768) at 
Python/ceval.c:4013
#6  0x000bc488 in PyEval_EvalCodeEx (co=0x6b5b18, globals=0x1, locals=0x6b4d74, 
args=0x2f9ce4, argcount=0, kws=0x8,
    kwcount=0, defs=0x6d77bc, defcount=2, closure=0x0) at Python/ceval.c:3253
#7  0x000ba4d4 in PyEval_EvalFrameEx (f=0x2f9ba8, throwflag=-4196312) at 
Python/ceval.c:4108
#8  0x000bc488 in PyEval_EvalCodeEx (co=0x2ca068, globals=0x1, locals=0x30ac9c, 
args=0x0, argcount=0, kws=0x0,
    kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#9  0x000bc650 in PyEval_EvalCode (co=0x2ca068, globals=0x1e0660, 
locals=0x1e0660) at Python/ceval.c:667
#10 0x000e29e4 in PyRun_FileExFlags (fp=0x0, filename=0xffbffd0a 
"./Session.py", start=1751040, globals=0x1e0660,
    locals=0x1e0660, closeit=1, flags=0xffbffb0c) at Python/pythonrun.c:1346
#11 0x000e3bf4 in PyRun_SimpleFileExFlags (fp=0x1ae770, filename=0xffbffd0a 
"./Session.py", closeit=1, flags=0xffbffb0c)
    at Python/pythonrun.c:936
#12 0x00020d54 in Py_Main (argc=-1, argv=0xffbffc1c) at Modules/main.c:599
#13 0x00020090 in _start ()

Original issue reported on code.google.com by kevin.li...@gmail.com on 23 Dec 2014 at 3:31

GoogleCodeExporter commented 8 years ago

Original comment by sum...@gmail.com on 24 Dec 2014 at 8:40

GoogleCodeExporter commented 8 years ago
Hi Kevin,

This is an interesting bug. I cannot simply identify the problem by just 
looking at the source. Below is the code we are failing:

    cs->_items = ymalloc(size * sizeof(_cstackitem));
    if (cs->_items == NULL) {
        yfree(cs);
        return NULL;
    }

    for(i=0; i<size; i++) {
        cs->_items[i].ckey = 0;
        cs->_items[i].t0 = 0; --> Here we fail.
    }

The cstackitem is defined as following:
typedef struct {
    long long t0;
    void *ckey;
} _cstackitem;

Can you tell me the size of a sizeof(long long) on your system? I am trying to 
understand what is different for your OS/Cpu that leads to this error?

Original comment by sum...@gmail.com on 24 Dec 2014 at 8:46

GoogleCodeExporter commented 8 years ago
This might be an issue with the compiler.

That is an old one(GCC 3.4.3) which has a history of misaligment errors. There 
we can try two things:

1) Simply, we can try this with a newer compiler.
2) Or change the long long in the _cstackitem structure to (long) and 
re-compile yappi to see if this fixes the current problem. 

Original comment by sum...@gmail.com on 24 Dec 2014 at 9:09

GoogleCodeExporter commented 8 years ago
Thanks for the respons and I will try have a try and get back.

Kevin

Original comment by kevin.li...@gmail.com on 30 Dec 2014 at 1:29