helpAdonthell - Support: sr #109476, Fails to start, displays...

 
 

sr #109476: Fails to start, displays "Floating point exception (core dump)"

Submitted by:  Rafael Fontenelle <rafaelff1>
Submitted on:  Tue 20 Mar 2018 05:00:41 PM UTC  
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  In Progress
Privacy:  Public Assigned to:  Kai Sterker <ksterker>
Open/Closed:  Open Operating System:  GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 21 Mar 2018 06:39:43 PM UTC, comment #5:

Fullscreen is a separate issue, probably harder to address.

Fullscreen mode will actually attempt to change the resolution to match the highest multiple of 320x240 that SDL reports for a certain screen. (Normally the first one, unless you move the window to a different screen while in window mode.)

The way it looks on the screenshot is that it failed to switch the resolution of the screen and thus did not enter fullscreen mode at all, but remain in window mode. However, it may already have changed some internal sizes and that makes the window bigger than the area used by the game.

You could try starting in window mode, then switching to fullscreen via the option menu from within the game. Though that is even more likely to fail than starting with fullscreen active.

You might want to play around with one of the SDL test programs to see if fullscreen works in principle on your setup. I don't think they get installed with SDL, so you might have to compile SDL yourself, then run ./configure and make inside the test folder. (https://hg.libsdl.org/SDL/file/331397505b6c/test)
testdraw2 would be a good candidate. You can pass --fullscreen to make it start in fullscreen, or toggle mode while its running via Ctrl+Enter, Alt+Enter or Shift+Enter, depending on the mode it's currently in (https://hg.libsdl.org/SDL/file/331397505b6c/src/test/SDL_test_common.c#l1647).

Adonthell pretty much follows that code from that SDL example when it comes to mode switching, so it should give similar results. However, if things work okay with SDL, then there is definitely something wrong with our own implementation.

Kai Sterker <ksterker>
Project AdministratorIn charge of this item.
Wed 21 Mar 2018 03:33:40 PM UTC, comment #4:

It sure did. Now the error doesn't happen anymore, although the fullscreen is still the same (see attached image file) - but I assume it's a different subject, right?

(file #43618)

Rafael Fontenelle <rafaelff1>
Tue 20 Mar 2018 09:06:26 PM UTC, comment #3:

> The error I reported happened when I was using 3 screens (one built-in in may laptop, 2 externals).


That might be the clue. There is some code that tries to determine a scaling factor based on the size of the screen the window is on.

int scale_x = (bounds.w - bounds.x) / nl;
int scale_y = (bounds.h - bounds.y) / nh;

I was under the assumption that bounds.w/.h contained the absolute coordinate of the lower right coordinate of the screen in a multi-monitor arrangement. But if it contained only the actual width and height of the screen regardless of its position, and you have two screens of same size next to each other, both terms above might become 0, which would lead to the FPE you observed.

The line of the crash is trying to divide by the calculated scale, and the only way that could crash is with scale being 0.

I'll have to check what SDL is actually placing into the bounds, and make sure it's consistent across Linux, Mac and Windows, but if you want to give it a try, change screen.cc lines 336 and 337 to

int scale_x = bounds.w / nl;
int scale_y = bounds.h / nh;

and let me know if that helps.

Kai Sterker <ksterker>
Project AdministratorIn charge of this item.
Tue 20 Mar 2018 08:06:42 PM UTC, comment #2:

>What window manager are you using?


I'm using GNOME 3.26 + Xorg (I know i is D.E., so not sure whether this answers your question)

>Do you have more than a single screen?


The error I reported happened when I was using 3 screens (one built-in in may laptop, 2 externals).

>As a quick test, can you edit ~/.config/adonthell/adonthellrc and set Screen-mode to 1.


Just for the record, I had Screen-mode 0 (windowed) in my adonthellrc.

In single screen (built-in) and in dual screen (built-in+1), all screen-modes work just fine.

In triple screen, it fails for screen-mode 0 (windowed) and 1 (letterbox), and works for 2 (fullscreen). However, this last sceen-mode opens a window (so, not exactly fullscreen) with the size of my screen resolution, but the game content is not streched to the whole window, it is using only what Windowed screen-mode would use.

Rafael Fontenelle <rafaelff1>
Tue 20 Mar 2018 07:14:54 PM UTC, comment #1:

As a quick test, can you edit ~/.config/adonthell/adonthellrc
and set Screen-mode to 1.

In case it has not created the file, due to the crash, I'll attach a copy.

I have a hunch what might be going on, but have not been able to determine the root cause. My first suspicion fell on a regression introduced by SDL 2.0.8, but I just compiled the latest from source and things still worked.

What window manager are you using? Do you have more than a single screen?

(file #43606)

Kai Sterker <ksterker>
Project AdministratorIn charge of this item.
Tue 20 Mar 2018 05:00:41 PM UTC, original submission:

I'm trying to launch wastesedge, but I get the "Floating point exception (core dump)". Below I also provided GDB output and my system's environment. Please let me know if more information is required. Could I get some help on it?

  • Command-line and output:

$ adonthell-0.3 wastesedge
Floating point exception (core dump)

  • Testing with GDB returned:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff2cbe700 (LWP 4983)]

Thread 1 "adonthell-0.3" received signal SIGFPE, Arithmetic exception.
0x0000555555601ef6 in screen::init (nl=0, nh=0, depth=<optimized out>, myconfig=...) at screen.cc:167
167 display.set_length(nl/scale_);

  • Environment

Distro: Arch Linux 64-bit
Package versions:
- adonthell 0.36
- wastesedge 0.37
- sdl2 2.0.8
- sdl2_mixer 2.0.2
- sdl2_ttf 2.0.14
- python 3.6.4
- gcc 7.3.1+20180312 (from git date 20180312)

Rafael Fontenelle <rafaelff1>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #43618:  fullscreen.png added by rafaelff1 (214KiB - image/png - Waste's Edge in fullscreen mode, but actually sort of windowed)
file #43606:  adonthellrc added by ksterker (844B - application/octet-stream - Configuration file with screen mode set to 1 (letterbox))
file #43603:  wastesedge-config.log added by rafaelff1 (22KiB - text/x-log)
file #43604:  adonthell-config.log added by rafaelff1 (43KiB - text/x-log)
file #43605:  wastesedge-gdb.txt added by rafaelff1 (1KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ksterker (Updated the item)
  • -email is unavailable- added by rafaelff1 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Wed 21 Mar 2018 03:33:40 PM UTC rafaelff1 Attached File- => Added fullscreen.png, #43618
    Tue 20 Mar 2018 09:06:26 PM UTC ksterker StatusNone => In Progress
    Tue 20 Mar 2018 07:14:54 PM UTC ksterker Attached File- => Added adonthellrc, #43606
        Assigned toNone => ksterker
    Tue 20 Mar 2018 05:00:41 PM UTC rafaelff1 Attached File- => Added wastesedge-config.log, #43603
        Attached File- => Added adonthell-config.log, #43604
        Attached File- => Added wastesedge-gdb.txt, #43605

    Back to the top


    Powered by Savane 3.3