Skip to content

example instructions cause crash #4

@FirefighterBlu3

Description

@FirefighterBlu3

after updating the top level makefile to simpleCounter project instead of dummy, and attiny2313, the gsim app will segfault after being built:

[david@Scott gui]$ gdb ./app
[...]
Reading symbols from ./app...done.
(gdb) r
Starting program: /home/david/gsimavr/src/app 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
wrn:102:model.c:createAvr: Loading firmware: /home/david/gsimavr/example/simpleCounter.elf
Loaded 94 .text at address 0x0
Loaded 0 .data
wrn:110:model.c:createAvr: Generating AVR of type attiny2313
wrn:134:model.c:loadGsimavrCore: Loaded core 'attiny2313'
err:189:controller.c:setupConnectivity: Registering the avr registers 'A'
err:189:controller.c:setupConnectivity: Registering the avr registers 'B'
err:189:controller.c:setupConnectivity: Registering the avr registers 'D'
[New Thread 0x7ffff19d3700 (LWP 17764)]
err:49:controller.c:watcher_ddr: IRQ = 9   VALUE = 255

Thread 2 "app" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff19d3700 (LWP 17764)]
0x00007ffff7845729 in glClearColor () from /usr/lib/libGL.so.1
(gdb) bt
#0  0x00007ffff7845729 in glClearColor () from /usr/lib/libGL.so.1
#1  0x00005555555565ff in renderScene () at view.c:254
#2  0x00007ffff6ddd1d2 in avr_raise_irq_float (irq=0x5555557743d8, value=value@entry=255, floating=0) at sim/sim_irq.c:214
#3  0x00007ffff6ddd22f in avr_raise_irq (irq=<optimized out>, value=value@entry=255) at sim/sim_irq.c:232
#4  0x00007ffff6de5b07 in avr_ioport_ddr_write (avr=0x55555576eab0, addr=<optimized out>, v=255 '\377', param=0x555555772fd0)
    at sim/avr_ioport.c:123
#5  0x00007ffff6dda41d in _avr_set_r (v=255 '\377', r=55, avr=0x55555576eab0) at sim/sim_core.c:197
#6  _avr_set_ram (v=255 '\377', addr=55, avr=0x55555576eab0) at sim/sim_core.c:248
#7  avr_run_one (avr=0x55555576eab0) at sim/sim_core.c:1327
#8  0x00007ffff6de019d in avr_callback_run_raw (avr=0x55555576eab0) at sim/sim_avr.c:352
#9  0x00007ffff6de07aa in avr_run (avr=0x55555576eab0) at sim/sim_avr.c:392
#10 0x0000555555557644 in avr_run_thread (ignore=<optimized out>) at controller.c:167
#11 0x00007ffff6bba08a in start_thread () from /usr/lib/libpthread.so.0
#12 0x00007ffff66ed42f in clone () from /usr/lib/libc.so.6

view.c starts as:

    252 void renderScene(void) {
    253 
    254         glClearColor(0.8F, 0.8F, 0.8F, 1.0F);
    255         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

valgrind indicates an invalid read of size 8,
Address 0x660 is not stack'd, malloc'd or (recently) free'd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions