Bug 204482

Summary: games/corsix-th core dumps on start
Product: Ports & Packages Reporter: Ben Lavery-Griffiths <ben>
Component: Individual Port(s)Assignee: Guido Falsi <madpilot>
Status: Closed FIXED    
Severity: Affects Only Me CC: ben
Priority: --- Flags: madpilot: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Backtrace
none
CorsixTH.core.bz2
none
Backtrace with debugging symbols
none
CorsixTH_151112.core.bz2 - with debugging symbols none

Description Ben Lavery-Griffiths 2015-11-11 23:32:56 UTC
Created attachment 163029 [details]
Backtrace

Installed on FreeBSD-CURRENT:
$>uname -a
FreeBSD BIL-BSD 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r290646: Tue Nov 10 14:46:16 GMT 2015     root@BIL-BSD:/usr/obj/usr/src/sys/BIL_KERNEL  amd64

Custom kernel config found here: https://gist.github.com/forquare/765c6725a227ca34028b

Installed using pkg(8).

On first run I got an error due to config not being found.
On second run I was asked for the location of the game data, then application core dumped.  On each subsequent run the disk with the doctor appears, then the \pplication core dumps.

Backtrace attached.  Will attached link to core dump shortly.
Comment 1 Ben Lavery-Griffiths 2015-11-11 23:34:11 UTC
Created attachment 163030 [details]
CorsixTH.core.bz2
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2015-11-12 00:46:44 UTC
*** Bug 204481 has been marked as a duplicate of this bug. ***
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2015-11-12 08:58:54 UTC
Hi,

I have tested it on my machine and I have reproduced the problem.

Since the crash is happening in a library owned by the multimedia/ffmpeg port my first experiment has been to downgrade that port.

Using ffmpeg version 2.7.2 the crash disappears.

I'll try writing to multimedia and see if they have some insight about this.

You could help some by rebuilding corsixth, ffmpeg and perhaps also SDL with debugging symbols. It should be as easy as defining WITH_DEBUG, you could also investigate the WITH_DEBUG_PORTS flag, both are documented in the comments in ports/Mk/bsd.port.mk.

After compiling these ports with debug symbols you should attach a new backtrace, which, with some luck, have more details about what is crashing.

Thanks in advance.
Comment 4 Ben Lavery-Griffiths 2015-11-12 13:46:18 UTC
Created attachment 163052 [details]
Backtrace with debugging symbols
Comment 5 Ben Lavery-Griffiths 2015-11-12 13:51:33 UTC
Created attachment 163054 [details]
CorsixTH_151112.core.bz2 - with debugging symbols

Core dump uploaded to external server & backtrace attached :)
Comment 6 Ben Lavery-Griffiths 2015-11-12 15:01:04 UTC
Note: I've just realised ffmpeg wasn't compiled with debug symbols.  After some testing, I've no idea how to get it to compile with debug symbols...

"WITH_DEBUG=yes" doesn't work.
"-DCMAKE_BUILD_TYPE="Debug"  " doesn't work...
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2015-11-12 15:59:54 UTC
I'll check how to compile ffmpeg with debugging symbols. I don't know the answer right away.

In the while, you could try disabling the MOVIES option. Looks like the crash happens when trying to play movies.

I'll consider disabling that option by default, if a better fix cannot be found.
Comment 8 Guido Falsi freebsd_committer freebsd_triage 2015-11-16 08:43:42 UTC
(In reply to Ben Lavery from comment #6)

I ust had a look at multimedia/ffmpeg Makefile, there's a DEBUG option, have you tried using that?
Comment 9 Guido Falsi freebsd_committer freebsd_triage 2015-11-16 09:24:55 UTC
I got some debugging output out of ffmpeg:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8143fe800 (LWP 101178/Video)]
palToY_c (_dst=<value optimized out>, src=<value optimized out>, unused1=0x0, unused2=0x0, 
    width=<value optimized out>, pal=0x81bc39138) at libswscale/input.c:471
warning: Source file is more recent than executable.

471             dst[i] = (pal[d] & 0xFF)<<6;


I don't know enough about ffmpeg to do much more with this information.

I'm going to disable movie support by default for the time being.
Comment 10 commit-hook freebsd_committer freebsd_triage 2015-11-16 09:41:34 UTC
A commit references this bug:

Author: madpilot
Date: Mon Nov 16 09:40:47 UTC 2015
New revision: 401757
URL: https://svnweb.freebsd.org/changeset/ports/401757

Log:
  Disable MOVIES option by deafult due to core dumps.

  PR:		204482
  Submitted by:	Ben Lavery <ben.lavery at hashbang0.com>

Changes:
  head/games/corsix-th/Makefile
Comment 11 Ben Lavery-Griffiths 2015-11-16 12:38:19 UTC
(In reply to Guido Falsi from comment #8)

No, I haven't had a chance to look much more at this.  I did disable the MOVIES option and I get into the game (:D), but so far haven't had time to gather more information.
Comment 12 commit-hook freebsd_committer freebsd_triage 2015-11-18 17:38:29 UTC
A commit references this bug:

Author: madpilot
Date: Wed Nov 18 17:37:44 UTC 2015
New revision: 401884
URL: https://svnweb.freebsd.org/changeset/ports/401884

Log:
  MFH: r401757 r401871

  r401757:

  Disable MOVIES option by deafult due to core dumps.

  PR:		204482
  Submitted by:	Ben Lavery <ben.lavery at hashbang0.com>

  r401871:

  Fix build on FreeBSD 9.3.

  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2015Q4/
  branches/2015Q4/games/corsix-th/Makefile
Comment 13 Guido Falsi freebsd_committer freebsd_triage 2015-11-19 09:37:01 UTC
I committed the workarounds, but I'm leaving the bug open since the program still dumps core if MOVIES is enabled.
Comment 14 Guido Falsi freebsd_committer freebsd_triage 2015-11-25 16:52:31 UTC
Closing PR as fixed as in workaround committed.