[Lldb-commits] [Bug 11569] New: LLDBSwigPythonCallCommand crashes when a command script returns an object

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 14 09:36:42 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=11569

             Bug #: 11569
           Summary: LLDBSwigPythonCallCommand crashes when a command
                    script returns an object
           Product: lldb
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
        AssignedTo: lldb-commits at cs.uiuc.edu
        ReportedBy: nathanhowell at hotmail.com
    Classification: Unclassified


Running r146566. LLDB seems to expect a string as the return result from a
command script but does not check that it is a string before using it.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00007fff84f71c00 in strlen ()
(gdb) where
#0  0x00007fff84f71c00 in strlen ()
#1  0x00007fff81378a46 in std::string::assign ()
#2  0x00000001000dd998 in LLDBSwigPythonCallCommand
(python_function_name=0x11e9c7d78 "ghc.print_obj_dbg",
session_dictionary_name=0x102988588 "debugger_1_dict",
debugger=@0x7fff5fbfc9f0, args=0x120fe67b8 "$r14", err_msg=@0x7fff5fbfc9d0,
cmd_retobj=@0x120fed2e0) at /Source/lldb/source/LLDBWrapPython.cpp:30249
#3  0x000000010108fb0b in
lldb_private::ScriptInterpreterPython::RunScriptBasedCommand (this=0x10292f930,
impl_function=0x11e9c7d78 "ghc.print_obj_dbg", args=0x120fe67b8 "$r14",
synchronicity=lldb_private::eScriptedCommandSynchronicitySynchronous,
cmd_retobj=@0x120fed2e0, error=@0x7fff5fbfcaa8) at
/Source/lldb/source/Interpreter/ScriptInterpreterPython.cpp:1890
#4  0x0000000100e7dc73 in CommandObjectPythonFunction::ExecuteRawCommandString
(this=0x11e9c7dc0, raw_command_line=0x120fe67b8 "$r14", result=@0x120fed2e0) at
/Source/lldb/source/Commands/CommandObjectCommands.cpp:1192
#5  0x000000010105cbf7 in lldb_private::CommandInterpreter::HandleCommand
(this=0x102914fe0, command_line=0x1051a22f8 "printObj $r14",
add_to_history=true, result=@0x120fed2e0, override_context=0x0,
repeat_on_empty_command=true, no_context_switching=false) at
/Source/lldb/source/Interpreter/CommandInterpreter.cpp:1503
#6  0x00000001000a9869 in lldb::SBCommandInterpreter::HandleCommand
(this=0x7fff5fbfd5e0, command_line=0x1051a22f8 "printObj $r14",
result=@0x7fff5fbfd5e8, add_to_history=true) at
/Source/lldb/source/API/SBCommandInterpreter.cpp:97
#7  0x0000000100004ac3 in Driver::HandleIOEvent (this=0x7fff5fbfec30,
event=@0x7fff5fbfda40) at /Source/lldb/tools/driver/Driver.cpp:933
#8  0x0000000100006790 in Driver::MainLoop (this=0x7fff5fbfec30) at
/Source/lldb/tools/driver/Driver.cpp:1341
#9  0x00000001000070aa in main (argc=2, argv=0x7fff5fbfed60,
envp=0x7fff5fbfed78) at /Source/lldb/tools/driver/Driver.cpp:1460
(gdb) frame 2
#2  0x00000001000dd998 in LLDBSwigPythonCallCommand
(python_function_name=0x11e9c7d78 "ghc.print_obj_dbg",
session_dictionary_name=0x102988588 "debugger_1_dict",
debugger=@0x7fff5fbfc9f0, args=0x120fe67b8 "$r14", err_msg=@0x7fff5fbfc9d0,
cmd_retobj=@0x120fed2e0) at /Source/lldb/source/LLDBWrapPython.cpp:30249
30249                            err_msg.assign(PyString_AsString(pvalue));
Current language:  auto; currently c++
(gdb) print pvalue
$1 = (PyObject *) 0x102e4d790
(gdb) print pvalue[0]
$2 = {
  ob_refcnt = 1, 
  ob_type = 0x1029c3260
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the lldb-commits mailing list