main menu segfault problem when clicking tabs/modeicons

GauVeldt
Member
 
Posts: 40
Joined: Sun Oct 26, 2014 03:08
GitHub: gau-veldt

main menu segfault problem when clicking tabs/modeicons

by GauVeldt » Tue Oct 28, 2014 03:08

My MINGW 32-bit minetest 0.4.10 build mostly runs (the game itself seems to run fine when a world is started), except in the mainmenu where I get a segfault issue when any tab or button is clicked except the play button, world doubleclick and checkbox changes.

After much checkpointing in the various mainmenu luascripts I isolated the problem and was able to isolate the segfault to a single line but it may now potentially glitch on display since I've omitted a line in the tabview's on_change by comm,enting it out as follows:

tab_singleplayer.lua:196
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function on_change(type, old_tab, new_tab)
   local buttonbar = ui.find_by_name("game_button_bar")
    print("tab singleplayer_onchange " .. type)
   if ( buttonbar == nil ) then
      singleplayer_refresh_gamebar()
      buttonbar = ui.find_by_name("game_button_bar")
   end
   if (type == "ENTER") then
      local game = current_game()

      if game then
         menudata.worldlist:set_filtercriteria(game.id)
         core.set_topleft_text(game.name)
         mm_texture.update("singleplayer",game)
      end
      buttonbar:show()
   else
      menudata.worldlist:set_filtercriteria(nil)
      buttonbar:hide()
      core.set_topleft_text("")
      --The next line causing segfault
      --mm_texture.update(new_tab,nil)
   end
end


Not sure if this is a bug or not and I hope someone with a bit more knowledge of the GUI stuff can check this out.
GDB was almost useless in tracking this down.

PS: I noticed the two game mode selection icons at the lower left (minetest_game versus minimal_game) still segfault however thus I haven't totally got the UI working yet.

EDIT PSS: There seems to be more at issue. It segfaulted when I left the tab on Server and restarted (which defaulted to the server tab on restart) then tried to switch. It didn't seem to like that nil for on_change handler so I added a dummy for servertab... then I couldn't switch back to singleplayer_tab... commented out sinlgeplayer_tab's enter mm_texture.update and it was able to switch back to singleplayer_tab. Wonder if there's some sort of lingering uninitialized mm_texture condition? The tabs duplicate a lot of common code so it's tricky to pinpoint the exact issue.
EDIT 2: *** The code change above only fixes the segfaulting issue when singleplayer is the default tab on startup ***
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: main menu segfault problem when clicking tabs/modeicons

by Krock » Tue Oct 28, 2014 18:52

Is there any way to get detailed debug information about this problem?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

GauVeldt
Member
 
Posts: 40
Joined: Sun Oct 26, 2014 03:08
GitHub: gau-veldt

Re: main menu segfault problem when clicking tabs/modeicons

by GauVeldt » Tue Oct 28, 2014 19:40

Krock wrote:Is there any way to get detailed debug information about this problem?


GDB was almost useless. It can step into code and show me where I am in the source (so I know it has symbols) but the stack must be getting trashed at the point of the segfault condition because I am unable to get a useful call trace to show me how the code got to the point of the crash.

The threaded and event driven callback nature of the code may also be a contributing factor to the call stack failure.

Finding the specific lua code causing the crash was more luck that anything and it happened while I was making the lua scripts noisy to see if the c++ code even got into the-lua scripted main menu event handlers for the main menu gui (which I've established they do). I eventually narrowed it by alternatively commenting out all of on_change then uncommenting one line at a time until I isolated one line that causes it to crash on clicking (it doesn't crash with the line commented, crashes uncommented -- see OP).

EDIT: FYI the only thing showing up in debug.txt from startup to the point of clicking in a tab or button in the main menu to cause the crash is as follows:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-------------
  Separator 
-------------

Irrlicht log: Irrlicht Engine version 1.8.1
Irrlicht log: Microsoft Windows 7 Home Premium Edition Service Pack 1 (Build 7601)
Irrlicht log: Using renderer: OpenGL 4.2.12428
Irrlicht log: AMD FirePro V5900 (FireGL V): ATI Technologies Inc.
Irrlicht log: OpenGL driver version is 1.2 or better.
Irrlicht log: GLSL version: 4.3
Irrlicht log: Resizing window (800 600)
 

Zeno
Member
 
Posts: 140
Joined: Sun Jun 29, 2014 03:36
GitHub: Zeno-

Re: main menu segfault problem when clicking tabs/modeicons

by Zeno » Wed Oct 29, 2014 03:06

If you can't post a stack trace can you at least post the segfault text?
 

GauVeldt
Member
 
Posts: 40
Joined: Sun Oct 26, 2014 03:08
GitHub: gau-veldt

Re: main menu segfault problem when clicking tabs/modeicons

by GauVeldt » Wed Oct 29, 2014 05:13

Zeno wrote:If you can't post a stack trace can you at least post the segfault text?


Here's what the gdb session looks like if all is run it, wait a few moments for gdb to catch all the threads started, then click on the minimalist world icon (the 3 axes icon to the right of the minetest-game icon at the lower left of the main menu dialog) at which point it segfaults. GDB has no clue what's going on and the stack has been horribly munged as gdb can't even access the addresses to generate the bt.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
C:\Minetest-Blockiverse\minetest\bin>gdb minetest.exe
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from C:\Minetest-Blockiverse\minetest\bin\minetest.exe...done.
(gdb) run
Starting program: C:\Minetest-Blockiverse\minetest\bin\minetest.exe
[New Thread 1180.0x1584]
warning: `C:\Windows\system32\ntdll.dll': Shared library architecture i386:x86-6
4 is not compatible with target architecture i386.
warning: `C:\Windows\SYSTEM32\wow64.dll': Shared library architecture i386:x86-6
4 is not compatible with target architecture i386.
warning: `C:\Windows\SYSTEM32\wow64win.dll': Shared library architecture i386:x8
6-64 is not compatible with target architecture i386.
warning: `C:\Windows\SYSTEM32\wow64cpu.dll': Shared library architecture i386:x8
6-64 is not compatible with target architecture i386.
warning: Could not load shared library symbols for ntdll32.dll.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for NOT_AN_IMAGE.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for NOT_AN_IMAGE.
Do you need "set solib-search-path" or "set sysroot"?
Irrlicht log: Irrlicht Engine version 1.8.1
Irrlicht log: Microsoft Windows 7 Home Premium Edition Service Pack 1 (Build 760
1)
[New Thread 1180.0x161c]
[New Thread 1180.0x11b4]
Irrlicht log: Using renderer: OpenGL 4.2.12428
Irrlicht log: AMD FirePro V5900 (FireGL V): ATI Technologies Inc.
Irrlicht log: OpenGL driver version is 1.2 or better.
Irrlicht log: GLSL version: 4.3
Irrlicht log: Resizing window (800 600)
[New Thread 1180.0xd58]
[New Thread 1180.0xdf0]
[New Thread 1180.0xa3c]
[New Thread 1180.0x770]
[New Thread 1180.0x93c]
[New Thread 1180.0x174]
[New Thread 1180.0x13a4]
[New Thread 1180.0xab0]
[New Thread 1180.0x158c]
[New Thread 1180.0xd9c]
[New Thread 1180.0x10bc]
[New Thread 1180.0xd6c]
[New Thread 1180.0xcc4]
[New Thread 1180.0x1320]
[New Thread 1180.0x13c4]
[New Thread 1180.0x744]
[New Thread 1180.0x128c]
[New Thread 1180.0x6a8]
[New Thread 1180.0x540]
[New Thread 1180.0x1534]
[New Thread 1180.0x16f8]
[New Thread 1180.0x17e4]
[New Thread 1180.0x14bc]
[New Thread 1180.0x1570]
[New Thread 1180.0x90c]
[New Thread 1180.0xd88]
[New Thread 1180.0x1280]

Program received signal SIGSEGV, Segmentation fault.
warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

0x0000002b in ?? ()
warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

(gdb) bt
warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

#0  0x0000002b in ?? ()
warning: (Internal error: pc 0x2b in read in psymtab, but not in symtab.)

Cannot access memory at address 0x1
(gdb)quit
A debugging session is active.

        Inferior 1 [process 1180] will be killed.

Quit anyway? (y or n) y

C:\Minetest-Blockiverse\minetest\bin>


EDIT: clipped a bunch of prior session text where I forgot to actually attempt the backtrace to show it really is totally useless.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: main menu segfault problem when clicking tabs/modeicons

by sfan5 » Thu Oct 30, 2014 09:47

What version of MinGW gcc?
How did you build it?
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

GauVeldt
Member
 
Posts: 40
Joined: Sun Oct 26, 2014 03:08
GitHub: gau-veldt

Re: main menu segfault problem when clicking tabs/modeicons

by GauVeldt » Thu Oct 30, 2014 10:14

sfan5 wrote:What version of MinGW gcc?
How did you build it?


CFLAGS and CXXFLAGS are set in CMakeCache.txt both to:
-m32 -g
(yes I hardocded that -g to be able to have debug symbols in Release build mode to shut off the unit testing*** [another line I added in CMakeCache.txt also swaps touch.exe in place of strip.exe to forcibly prevent symbol stripping] and I had to force a 32-bit build since the irrlicht sources refused building -m64 complaining that the AES stuff was incapable of 64-bit architecture)

This is the version of g++ reported (installed by code::blocks):
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
C:\MinGW64\bin>.\g++ --version
g++ (tdm64-1) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


*** were I to believe from the unit tests that path handling was badly broken, minetest would not have been able to start a world at all yet when I use the workaround (see OP) to circumvent the crash by skipping the one line with mm_texture.update() it can load and play a world just fine and I've been able to do so for hours without issue. Thus I suspect some of the tests themselves are not working correctly and for now have them shut off. I didn't discover the command line switch until after I had already hardcoded it out via CMakeCache.txt
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 26 guests

cron