ChrisZim / edb-debugger

Automatically exported from code.google.com/p/edb-debugger
GNU General Public License v2.0
0 stars 0 forks source link

Cannot execute linux kernel call #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Created attachment 1
Source file used to test gcc optimisation on x86_64

Dear Evan,

Thank you for EDB project. I tried to learn how gcc optimisation works, using 
edb and simple source file. But unfortunately it looks like, EDB gets exception 
every time it tries to process linux kernel system call.

EDB message is:
"The debugged application encountered a segmentation fault!
The address 0x18 could not be accessed.
If you would like to pass this exception to the application press 
Shift+[F7/F8/F9]"

I tried to compile attached file with using "gcc -O2 -g 9.cpp".
EDB get an exception, when it executes kernel call posix_memalign()

Could you please tell me any solution or workaround?

With best regards,
Vladimir

Original issue reported on code.google.com by evan.teran on 3 Oct 2012 at 3:21

GoogleCodeExporter commented 9 years ago

Original comment by evan.teran on 3 Oct 2012 at 4:01

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for this bug report. It has been fixed in my dev tree which will have 
another release soon.

Basically, some old TODO's in my core from before the 64-bit port that I hadn't 
cleaned out yet were trashing fs and gs :(

All better now though :).

Evan Teran

Original comment by evan.teran on 3 Oct 2012 at 4:01

GoogleCodeExporter commented 9 years ago
PS: as a workaround, you can patch the sources. In DebuggerCore.cpp remove the 
following lines entirely:

// TODO: get the real values for these...
state.gs_base = 0;
state.fs_base = 0;

That should do it.

Original comment by evan.teran on 3 Oct 2012 at 4:02