FS#41476 - [desmume] Program does not start, throws std::bad_alloc

Attached to Project: Community Packages
Opened by Tilman Blumenbach (Tblue) - Tuesday, 05 August 2014, 12:54 GMT
Last edited by Felix Yan (felixonmars) - Monday, 11 August 2014, 23:34 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jakob Gruber (schuay)
Architecture i686
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
------------

desmume does not start. Running it from a terminal shows the following:

Failed to set format: Invalid argument
Microphone init failed.
DeSmuME 0.9.10 svn0 x86-JIT NOSSE
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
zsh: abort desmume

Removing ~/.config/desmume/ does not help.


Proposed fix:
-------------

According to https://bbs.archlinux.org/viewtopic.php?pid=1415917#p1415917, this may be a bug in GCC. Compiling it with clang (as suggested in the linked post) works for me. Unlike the poster, I did not have to edit any external headers to compile desmume with clang, so this is a somewhat easy fix.

I have attached a patch for the PKGBUILD. While this is not an ideal solution, it's better than a broken package.


Additional info:
----------------

* package version: 0.9.10-3


Steps to reproduce:
-------------------

1. Install desmume from [community].
2. Try to run it from a terminal (for log output).
3. See how it fails to start.
This task depends upon

Closed by  Felix Yan (felixonmars)
Monday, 11 August 2014, 23:34 GMT
Reason for closing:  Implemented
Additional comments about closing:  0.9.10-4
Comment by Jakob Gruber (schuay) - Sunday, 10 August 2014, 10:29 GMT
Thanks for the report; I'm aware of this, but won't have access to my build box until October. Hopefully another TU can take care of this in the meantime.
Comment by Felix Yan (felixonmars) - Sunday, 10 August 2014, 12:58 GMT
I've done the build, but getting a segfault that is not always reproducible. Please let me know if it solves your problem (because the -3 version doesn't crash for me):

http://pkgbuild.com/~fyan/staging/desmume-0.9.10-4-i686.pkg.tar.xz
http://pkgbuild.com/~fyan/staging/desmume-0.9.10-4-x86_64.pkg.tar.xz
Comment by Tilman Blumenbach (Tblue) - Monday, 11 August 2014, 18:16 GMT
Thanks! I just played for a while on both i686 and x86_64 (30 minutes each) -- I'm getting a segfault when exiting the program normally (closing the window, pressing Ctrl-Q or using the "Quit" menu item), but other than that, all seems to work fine.

When do you get the segfault?
Comment by Felix Yan (felixonmars) - Monday, 11 August 2014, 23:33 GMT
I got a segfault when starting it in x86_64, but not able to reproduce it anymore. Since it solves your problem and Jakob could confirm it too, I'm pushing it to [community]. Cheers!

Loading...