blynn / netwalk

Puzzle game: connect all terminals to the server
GNU General Public License v3.0
20 stars 9 forks source link

NetWalk segmentation fault #2

Closed nemysis closed 7 years ago

nemysis commented 9 years ago

When I wish to use NetWalk and Help get this:

netwalk
Help from menu 
[1]    19169 segmentation fault  netwalk

Please add Debug options that I can use GDB and see what is.

blynn commented 9 years ago

I can't reproduce this. On which system did you encounter this problem? Did you play a game first?

On Thu, Oct 30, 2014 at 12:48 PM, nemysis notifications@github.com wrote:

When I wish to use NetWalk and Help get this:

netwalk Help from menu [1] 19169 segmentation fault netwalk

— Reply to this email directly or view it on GitHub https://github.com/blynn/netwalk/issues/2.

nemysis commented 9 years ago

Yes I have played NetWalk and when I try help get segmentation fault.

I have this in openSUSE and in FreeBSD not have this.

I make now RPM for NetWalk for openSUSE, but not can commit when i get this all time.

Could you add this to Source this Desktop entry perhaps?

/usr/local/suse/home:nemysis/netwalk/ > cat netwalk.desktop
[Desktop Entry]
Name=NetWalk
GenericName=Pipe Mania
Comment=Game where the object is to connect every terminal to the main server
Icon=netwalk
Exec=netwalk
Type=Application
Categories=Game;LogicGame;
StartupNotify=false

This is mine RPM spec for openSUSE

/usr/local/suse/home:nemysis/netwalk/ > cat netwalk.spec   
#
# spec file for package netwalk
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           netwalk
Version:        0.4.11
Release:        0
Summary:        Game where the object is to connect every terminal to the main server
License:        GPL-3.0
Group:          Amusements/Games/Arcade/Logic
Url:            https://github.com/blynn/netwalk
# Downloaded from
# Packed as tar.bz2
Source0:        %{name}-%{version}+git-9985e51.tar.bz2
Source1:        %{name}.desktop
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
%endif
BuildRequires:  bitstream-vera-fonts
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig(sdl)
BuildRequires:  pkgconfig(SDL_ttf)
                                                                                                                                                      [8/1723]
%description
NetWalk is a puzzle game where the object is to connect every terminal to the
main server. (These are represented by coloured boxes, so you could
also imagine them to be water mains, electricity cables, phone lines, etc.)

In this version, not only must every terminal be connected, but every piece of
cable must also be connected to the main server somehow.

%prep
%setup -q -n %{name}
# Correct Paths
sed -i -e 's|/usr/bin/install|install|' \
    -i -e 's|= /usr|= $(DESTDIR)/usr|' Makefile

%build
make %{?_smp_mflags}

%install
%make_install

# install icons
for i in 32 48 64 72 96 ; do
    install -Dm 0644 icons/%{name}_${i}x${i}.png \
            %{buildroot}/%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done

# install desktop file
install -Dm 0644 %{S:1} %{buildroot}%{_datadir}/applications/%{name}.desktop

# Use system fonts instead of bundling our own
rm -f %{buildroot}%{_datadir}/%{name}/Vera.ttf
ln -s %{_datadir}/fonts/truetype/Vera.ttf %{buildroot}%{_datadir}/%{name}/Vera.ttf

# install needed documentation
install -Dm 0644 LICENSE %{buildroot}%{_datadir}/%{name}
install -Dm 0644 README %{buildroot}%{_datadir}/%{name}

%if 0%{?suse_version}
    %suse_update_desktop_file %{name}
    %fdupes -s %{buildroot}%{_prefix}
%endif

%files
%defattr(-,root,root,-)
%doc LICENSE README
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/
%{_datadir}/%{name}

%changelog
nemysis commented 9 years ago

Please install in VirtualBox openSUSE and test there mine RPM

Thanks

blynn commented 9 years ago

I'm afraid I haven't got much time to look into this. Please let me know if you track down the root cause.

On Tue, Nov 4, 2014 at 10:43 AM, nemysis notifications@github.com wrote:

Please install in VirtualBox openSUSE and test there mine RPM

Thanks

— Reply to this email directly or view it on GitHub https://github.com/blynn/netwalk/issues/2#issuecomment-61659321.

nemysis commented 9 years ago

root have also problem with NetWalk and help

netwalk
Creating config file at /root/.netwalk/config
[1]    26256 segmentation fault  netwalk

Please fix also this

osc build
...
[   58s] gcc -o netwalk main.c game.c colour.c widget.c config.c config_file.c -Wall -O2 -fomit-frame-pointer `sdl-config --cflags` `sdl-config --libs` -lSDL_ttf
[   58s] main.c: In function 'set_video':
[   58s] main.c:589:5: warning: call to function 'init_ctable' without a real prototype [-Wunprototyped-calls]
[   58s]      init_ctable(screen->format);
[   58s]      ^
[   58s] In file included from main.c:41:0:
[   58s] colour.h:56:6: note: 'init_ctable' was declared here
[   58s]  void init_ctable();
[   58s]       ^
hymie0 commented 7 years ago

I don't know if anybody is still here, but the problem seems to be related to "the last menu option".

This patch seems to have fixed the problem, at least for me.

*** ../orig/main.c   2017-07-04 18:21:25.836963010 -0400
--- main.c      2017-07-04 18:29:50.700985851 -0400
***************
*** 1628,1636 ****

      //setup the menus
      {
!       menuitem_t it1, it2;
        menuitem_ptr it;
!       menu_t m1, m2;

        intptr_t i;

--- 1628,1636 ----

      //setup the menus
      {
!       menuitem_t it1, it2,it3;
        menuitem_ptr it;
!       menu_t m1, m2,m3;

        intptr_t i;

***************
*** 1676,1681 ****
--- 1676,1685 ----
        menu_add_item(m2, it);

        menuitem_set_submenu(it2, m2);
+         menuitem_init(it3);
+         menu_init(m3);
+         menuitem_set_submenu(it3, m3);
+ 
      }

      //setup about box
blynn commented 7 years ago

It crashes on my system these days, so I was able to investigate.

I just pushed a fix.