- Posts: 390
#89bae80 buffer overflow detected in emu_devo10
- domcars0
- Topic Author
- Offline
I've just compiled the #89bae80 PB commit to try the new 'standard' mixers in the emulator.
But I'm unable to enter this mixer mode, cause when I try it (via the file template or via the model config), the emulator crash with a "buffer overflow detected"?
*** buffer overflow detected ***: ./emu_devo10.elf terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0x3cc045]
/lib/i386-linux-gnu/libc.so.6(+0x102e1a)[0x3cae1a/lib/i386-linux-gnu/libc.so.6(+0x102478)[0x3ca478]
/lib/i386-linux-gnu/libc.so.6(_IO_default_xsputn+0x91)[0x33b501]
/lib/i386-linux-gnu/libc.so.6(_IO_vfprintf+0x2352)[0x30ce02]
/lib/i386-linux-gnu/libc.so.6(__vsprintf_chk+0xc9)[0x3ca549]
/lib/i386-linux-gnu/libc.so.6(__sprintf_chk+0x2f)[0x./emu_devo10.elf[0x807687c]
./emu_devo10.elf[0x8076980]
./emu_devo10.elf[0x805ad4f]
./emu_devo10.elf[0x8054943]
./emu_devo10.elf[0x804a844]
./emu_devo10.elf[0x804a935]
./emu_devo10.elf[0x804b4d5]
./emu_devo10.elf[0x80498e8]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x2e14d3]
./emu_devo10.elf[0x804990d]
(followed by the memory map)
Compiled under Ubuntu 12.04-1, and there is just two warning during compilation:
...
+ Compiling 'inputs.c'
inputs.c: In function ‘INPUT_MapSourceName’:
inputs.c:95:9: attention : unused variable ‘i’ [-Wunused-variable]
inputs.c:93:36: attention : unused parameter ‘idx’ [-Wunused-parameter]
inputs.c:93:45: attention : unused parameter ‘val’ [-Wunused-parameter]
...
...
+ Compiling 'screen/lcd_string.c'
screen/lcd_string.c: In function ‘char_offset’:
screen/lcd_string.c:124:10: attention : ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
screen/lcd_string.c: In function ‘get_char_range’:
screen/lcd_string.c:103:10: attention : ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
Thanks for any help...
PS: Same issue with the emu_devo8
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- RugWarrior
- Offline
- Posts: 59
If I compile the latest commits with my MinGW DeviationTX build environment and try the emu_devo8 I do not get an error?!
But I can see the compile warning for the devo10...
I do not know how to use the devo10 emu
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
I have to say that it works (no buffer overflow) when compiled on a RHEL6 (with fltk 1.1.10) ... probably an issue in my ubuntu libfltk (will see that this evening)..
Thanks
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
This happens in any language (French, English, Spanish , German), on emu_devo10 as well as on emu_devo8...
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
make sure you are building with dbeug enabled:
make clean TARGET=emu_devo10; make TARGET=emu_devo10
now start up in gdb:
gdb ./emu_devo10.elf
at the prompt:
> r
try to make it crash
hopefully it locks up and you get a prompt back in gdb.
now:
> thread apply all bt full
send those results.
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
(gdb) thread apply all bt full
... some infos about no debug symbols in system libs and...
#6 0x0807fd00 in CONFIG_ReadTemplate (filename=0x8082fe0 "heli_std.ini") at config/model.c:1178
file = "template/heli_std.in"
#7 0x0805ad06 in invalid_simplemixer_cb (state=1 '\001', guiObj=0x8090f58) at pages/128x64x1/../common/_dialogs.c:62
No locals.
#8 0x080531b8 in DialogClose (obj=0x8091060, state=1 '\001') at gui/dialog.c:123
dialog = 0x8091074
data = 0x8090f58
func = 0x805acab <invalid_simplemixer_cb>
#9 0x080531d9 in dlgbut_pressok_cb (obj=0x80910b8, data=0x8091060) at gui/dialog.c:129
dlgObj = 0x8091060
#10 0x080545b1 in GUI_TouchRelease () at gui/gui.c:320
button = 0x80910cc
#11 0x08053ab0 in _handle_modalbuttons_devo10 (button=65536, flags=1 '\001', data=0x0) at gui/128x64x1/_gui.c:197
No locals.
#12 0x0804a6ab in exec_callbacks (buttons=65536, flags=BUTTON_PRESS) at buttons.c:137
ptr = 0x8092bf4
#13 0x0804a56b in BUTTON_Handler () at buttons.c:97
last_buttons = 0
last_buttons_pressed = 16384
long_press_at = 215637560
longpress_release = 0 '\000'
buttons = 65536
buttons_pressed = 65536
buttons_released = 0
#14 0x0804b349 in EventLoop () at main.c:173
No locals.
#15 0x0804b18d in main () at main.c:87
buttons = 0
(gdb)
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
line 1178 in model.c is the end of the funtion and makes no sense as a crash point.
you could try the following:
after starting gdb, but before hitting 'r'
b CONFIG_ReadTemplate
Now try to switch to the standard interface. gdb should break at the beginning of the ReadTemplate function. you can now use 'n' to step through the function one line at a time and see if it crashes somewhere different.
Alternative:
install valgrind and try running:
valgrind ./emu_devo10.elf
and see if it shows something different. I've had very poor luck debugging with valgrind on Deviation though, so don' hold your breath.
FYI, I have no issues on 64-bit Ubuntu 12.04. If yours is 64-bit, you can send me your .elf file, and I can try it locally.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
try 'hg status' and ensure you have no modified files and no extra ('?' files)
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
Here is the result....PhracturedBlue wrote: Unfortunately, that looks like stack corruption.
line 1178 in model.c is the end of the funtion and makes no sense as a crash point.
you could try the following:
after starting gdb, but before hitting 'r'
b CONFIG_ReadTemplate
Now try to switch to the standard interface. gdb should break at the beginning of the ReadTemplate function. you can now use 'n' to step through the function one line at a time and see if it crashes somewhere different.
and see if it shows something different. I've had very poor luck debugging with valgrind on Deviation though, so don' hold your breath.
Breakpoint 1, CONFIG_ReadTemplate (filename=0x8082ee0 "heli_std.ini")
at config/model.c:1164
1164 u8 CONFIG_ReadTemplate(const char *filename) {
(gdb) n
1167 sprintf(file, "template/%s", filename);
(gdb) n
1168 clear_model(0);
(gdb) n
1169 auto_map = 0;
(gdb) n
1170 if (CONFIG_IniParse(file, ini_handler, &Model)) {
(gdb) n
1174 if(auto_map)
(gdb) n
1176 MIXER_RegisterTrimButtons();
(gdb) n
1177 return 1;
(gdb) n
1178 }
(gdb) n
*** stack smashing detected ***:
Program received signal SIGABRT, Aborted.
0x00132416 in __kernel_vsyscall ()
(gdb)
UNfortunatly mine is a 32-bitPhracturedBlue wrote: FYI, I have no issues on 64-bit Ubuntu 12.04. If yours is 64-bit, you can send me your .elf file, and I can try it locally.
Thanks
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
PhracturedBlue wrote: One other thing.
try 'hg status' and ensure you have no modified files and no extra ('?' files)
domcars0@mars:~/deviationdevo10$ hg status
domcars0@mars:~/deviationdevo10$
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
**** stack smashing detected ***
I found on the web how to turn of this gcc feature ( Stack Smashing ), by
compiling with -fno-stack-protector
So I've just changed the main Makefile to :
CFLAGS := $(CFLAGS) -Wall -Wextra -I. -D$(PROGMODE) -fno-stack-protector -std=gnu99 -Itarget/$(TARGET) -Igui/$(SCREENSIZE) -DHGVERSION="\"${HGVERSION}\""
And now I can switch in <Standard>Mixer GUI on my Ubuntu!!
Probably not very secure but it works...
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- #89bae80 buffer overflow detected in emu_devo10