Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluating expressions that contain function calls is broken on Linux #14809

Closed
llvmbot opened this issue Nov 26, 2012 · 5 comments
Closed

Evaluating expressions that contain function calls is broken on Linux #14809

llvmbot opened this issue Nov 26, 2012 · 5 comments
Labels
bugzilla Issues migrated from bugzilla lldb

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 26, 2012

Bugzilla Link 14437
Resolution FIXED
Resolved on Nov 04, 2020 11:32
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @emaste,@labath

Extended Description

Attempting to evaluate an expression that contains a function call is broken on Linux.

Sometimes, the expression is evaluated but the result is clearly incorrect:
(lldb) expression -- (int)strlen("hello world")
(int) $5 = -764888112

To reproduce the above, run: python dotest.py -i -v lang/c/strings

Sometimes, the expression command itself returns an error:
(lldb) print str.c_str()

To reproduce the above, run: python dotest.py -i -v expression_command/call-function

@llvmbot
Copy link
Collaborator Author

llvmbot commented Dec 13, 2012

*** Bug llvm/llvm-bugzilla-archive#14595 has been marked as a duplicate of this bug. ***

@llvmbot
Copy link
Collaborator Author

llvmbot commented Dec 13, 2012

The failure to print str.c_str generates the following lldb error message:
error: Execution was interrupted, reason: invalid address.

This can also be reproduced with:
(lldb) expr new int(12)

which is also run by the following test case:
python dotest.py -i -v expression_command/call-function

(lldb) log enable lldb expr
The logging facility includes the following output, whereas a non-null remote
address is typical of successful expression evaluation:
Code can be run in the target.
Found function, has local address 0x7fab3bc01008 and remote address 0x0
Function's code range is [0x0+0x5e]
Couldn't disassemble function : Couldn't read from process: Input/output
error
Data buffer contents:

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 15, 2013

In latest trunk (r175255) I can confirm that expressions with 'new' work. Re-enabling TestFormatters.py.

Leaving this bug open as there's more work needed to fix expression evaluation on Linux.

@labath
Copy link
Collaborator

labath commented Sep 1, 2015

This bug has been fixed since it was first filed.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#14595

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla lldb
Projects
None yet
Development

No branches or pull requests

2 participants