Release Netwalk


Hi @sm0kew0n !

Thanks for creating this thread ;)

Could you please recompile the game with the "-g" flag ? This way we could try to understand why the game segfaults when clicking on "help":
[ START ]--- Starting the application ( runscript.sh ) ----------
/usr/pandora/scripts/pnd_run.sh: line 528: 4012 Segmentation fault "./$
EXENAME" $ARGUMENTS "$@"

Cheers, Magic Sam
 
I was going to upload the -g flag build today, are sure about the cursor? I was playing it with mouse controls, are using wasd?
 
@sm0kew0n : here you go :)
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00011e48 in open_submenu () at main.c:291
291 main.c: No such file or directory.
in main.c
(gdb) bt
#0 0x00011e48 in open_submenu () at main.c:291
#1 0x00011cac in main () at main.c:1745
(gdb) l
286 in main.c

EDIT: the issue should be around these parts:
C:
void open_submenu(widget_ptr p, void *data)
{
int i;
int w = 0;
menuitem_ptr it;

openedmenu = (menuitem_ptr) p;
menu_ptr m = openedmenu->submenu;

for (i=0; i<m->item_count; i++) {
it = m->item_list[i];
if (w < it->img->w) w = it->img->w;
}
w += 12;

m->widget.x = m->widget.parent->x;
m->widget.y = m->widget.parent->y + vsize;

m->widget.w = w;
m->widget.h = vsize * m->item_count + 1;

for (i=0; i<m->item_count; i++) {
it = m->item_list[i];
it->widget.x = 0 + m->widget.x;
it->widget.y = vsize * i + 4 + m->widget.y;
it->widget.w = w;
it->widget.h = vsize;
}
}

Hope that helps.

Cheers, Magic Sam
 
Last edited:
@sm0kew0n : I'm not a developer so I can't help you much ;)

In your first post you mentioned changing the screen size to fit the 800x480 resolution, and it looks like this function deals with size. Could it be that the help menu doesn't fit in a 800x480 screen ?

What puzzles me is that main.c is not 1745 lines long (only 1703):

https://github.com/blynn/netwalk/blob/master/main.c

That "no such file or directory" error is also weird IMHO.

Cheers, Magic Sam
 
Last edited:
Most c source files go through the cpp preprocessor before they're compiled. If that's extending the file somehow (it usually shrinks the file by eliminating #IFDEFN conditional code I assume), that could explain that error line number.

If it is that listed line that assigns openedmenu for the first time then I think that's an explicit cast, and at that point I reach the limit of my knowledge.
 
That's line 291 from main.c in the release tar, not the master on github, the file I have is 1760 lines and line 1745 is;

Selection_001.png
 
So, what's line 291 in the source that was actually built then? If the master in github is 1760 lines long it's not that either unless the ifdefn blocks removed happen to match it up to the right length (I think). Normally in development you leave symbols embedded so it tells you the contents of the line where it crashed, but without them you're sometimes left in this mess of trying to guess which source actually corresponded.
 
Hi all :)

@levi : here is line 291 from the release tarball (looks identical to me):
Code:
void open_submenu(widget_ptr p,   void *data)
{
    int i;
    int w = 0;
    menuitem_ptr it;

    openedmenu = (menuitem_ptr) p; // <-- LINE 291 /!\
    menu_ptr m = openedmenu->submenu;

    for (i=0; i<m->item_count; i++) {
   it = m->item_list[i];
   if (w < it->img->w) w = it->img->w;
    }
    w += 12;

    m->widget.x = m->widget.parent->x;
    m->widget.y = m->widget.parent->y + vsize;

    m->widget.w = w;
    m->widget.h = vsize * m->item_count + 1;

    for (i=0; i<m->item_count; i++) {
   it = m->item_list[i];
   it->widget.x = 0 + m->widget.x;
   it->widget.y = vsize * i + 4 + m->widget.y;
   it->widget.w = w;
   it->widget.h = vsize;
    }
}

@sm0kew0n : I think this part (main.c) of the code has been updated since that release in 2014:

https://github.com/blynn/netwalk/commit/5b52c2c2af0929d4d792afa2be75d0ddd780fabc

Could you please give that latest commit a try, see if it solves the issue ?

Cheers, Magic Sam
 
Last edited:
Back
Top