Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 745003 - games-emulation/advancemame-3.9: fail with stack smashing detected
Summary: games-emulation/advancemame-3.9: fail with stack smashing detected
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-28 06:39 UTC by LABBE Corentin
Modified: 2023-06-07 03:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compressed build log (games-emulation:advancemame-3.9:20211125-202156.log.xz,66.23 KB, application/x-xz)
2021-11-25 21:04 UTC, Martin Bays
Details
advancememe backtrace (advancemame_bt.png,213.49 KB, image/png)
2023-05-31 23:18 UTC, imsoalexm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description LABBE Corentin 2020-09-28 06:39:30 UTC
Starting advmame lead to:
AdvanceMAME - Copyright (C) 1999-2018 by Andrea Mazzoleni
MAME - Copyright (C) 1997-2003 by Nicola Salmoria and the MAME Team
*** stack smashing detected ***: terminated
Signal SIGABRT[fffffffah], from code at (nil)
Compiled Sep 15 2020, 17:26:28
Stack backtrace:
[(nil)]
advmame(+0x767a41) [0x563e80ffea41]
/lib64/libpthread.so.0(+0x13020) [0x7fbb20446020]
/lib64/libc.so.6(gsignal+0x141) [0x7fbb1feff751]
/lib64/libc.so.6(abort+0x127) [0x7fbb1fee953b]
/lib64/libc.so.6(+0x7b1c0) [0x7fbb1ff421c0]
/lib64/libc.so.6(__fortify_fail+0x22) [0x7fbb1ffd0452]
/lib64/libc.so.6(__fortify_fail+0) [0x7fbb1ffd0430]
advmame(+0x775333) [0x563e8100c333]
advmame(+0x7722f8) [0x563e810092f8]
advmame(+0x90a2b9) [0x563e811a12b9]
advmame(+0x794003) [0x563e8102b003]
advmame(+0x77676d) [0x563e8100d76d]
advmame(+0x76578f) [0x563e80ffc78f]
/lib64/libc.so.6(__libc_start_main+0xeb) [0x7fbb1feeaccb]
advmame(+0x7657ea) [0x563e80ffc7ea]

This appears only my laptop with an intel card (See #745000 for start with a nvidia card)

Reproducible: Always




Portage 3.0.4 (python 3.7.8-final-0, default/linux/amd64/17.0, gcc-9.2.0, glibc-2.31-r6, 5.4.38-gentoo x86_64)
=================================================================
System uname: Linux-5.4.38-gentoo-x86_64-Intel-R-_Core-TM-_i5-8350U_CPU_@_1.70GHz-with-gentoo-2.6
KiB Mem:    16215512 total,  12751360 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 28 Sep 2020 05:00:01 +0000
Head commit of repository gentoo: 13bcd1b880081f517bd78dcd4c6751eb67a480d3
sh bash 5.0_p18
ld GNU ld (Gentoo 2.31.1 p7) 2.31.1
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r2::gentoo, 3.6.11-r2::gentoo, 3.7.8-r2::gentoo, 3.8.5::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo, 2.30-r4::gentoo, 2.31.1-r6::gentoo, 2.32-r1::gentoo, 2.33.1-r1::gentoo, 2.34-r2::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo, 9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE google-chrome freedist linux-firmware no-source-code bh-luxi linux-fw-redistributable xgraph JSON XMAME"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X alsa amd64 berkdb bzip2 caps cli crypt dri dri3 glamor iconv ipv6 jpeg libglvnd libtirpc mp3 multilib ncurses nls nptl opengl overlay pam pcre png readline seccomp split-usr ssl tcpd unicode vaapi vdpau xattr xvmc zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx sse sse2 mmxext avx sse4_1 sse4_2 ssse3 sse3 avx2 aes fma" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-32 efi-64" INPUT_DEVICES="libinput keyboard mouse synaptics" KERNEL="linux" L10N="fr en-GB uk" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_6 python3_7" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="intel vesa i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jonas Stein gentoo-dev 2020-09-28 18:04:30 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. That is why I ask you to 
* attach the logs and 
as described on https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Please reopen this ticket (Status:UNCONFIRMED) afterwards.
Comment 2 LABBE Corentin 2020-09-29 05:08:47 UTC
Which log do you want ? advmame is not a daemon and do not produce any log.
Comment 3 Martin Bays 2021-11-25 21:02:22 UTC
I ran into the same bug. Build log attached.

emerge --info games-emulation/advancemame :

!!! Section 'crossdev' in repos.conf has name different from repository name 'crossdev-portage' set inside repository
!!! Repository 'x-portage' is missing masters attribute in '/usr/local/portage/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
Portage 3.0.28 (python 3.9.6-final-0, default/linux/amd64/17.1/developer, gcc-9.3.0, glibc-2.33-r7, 5.9.064+ x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.9.064+-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-glibc2.33
KiB Mem:     4036612 total,    851508 free
KiB Swap:    5242876 total,   4561184 free
Timestamp of repository gentoo: Sat, 20 Nov 2021 06:30:01 +0000
Head commit of repository gentoo: 6814ed3538f749d8b57f9cdfae05d9970abeca3e
Timestamp of repository guru: Fri, 19 Nov 2021 10:21:49 +0000
Head commit of repository guru: 87dfbe2b52b2fd2b91d9c360d90b8b4fa5b6bc49

sh bash 5.1_p8
ld GNU ld (Gentoo 2.36.1 p3) 2.36.1
ccache version 4.3 [enabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r2::gentoo
dev-lang/python:          2.7.18_p11::gentoo, 3.9.6_p1::gentoo, 3.10.0_rc1_p1::gentoo
dev-lang/rust-bin:        1.54.0::gentoo
dev-util/ccache:          4.3-r3::gentoo
dev-util/cmake:           3.21.1::gentoo
sys-apps/baselayout:      2.7-r3::gentoo
sys-apps/openrc:          0.43.5::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.16.4::gentoo
sys-devel/binutils:       2.36.1-r1::gentoo, 2.37_p1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo, 11.2.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

crossdev-portage
    location: /usr/local/portage-crossdev
    masters: gentoo haskell gamerlay
    priority: 0

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 1

gamerlay
    location: /var/lib/layman/gamerlay
    masters: gentoo
    priority: 50

haskell
    location: /var/lib/layman/haskell
    masters: gentoo
    priority: 50

hossie
    location: /var/lib/layman/hossie
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/apache2-php8.0/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage-distfiles"
EMERGE_DEFAULT_OPTS="--nospinner"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache collision-protect compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign splitdebug strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirror.netcologne.de/gentoo/ rsync://mirror.netcologne.de/gentoo/"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0"
MAKEOPTS="-j2"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/tmp/tmp-portage"
USE="X a52 aac aalib acl acpi alsa amd64 apache2 avi bash-completion bzip2 caca cairo cdda cdr cli crypt dbus directfb dri dts dvd dvdr elogind emboss encode exif fbcon flac fortran gatos gdbm gif gpm gtk gui guile iconv icu ipv6 jpeg lcms libglvnd libnotify libtirpc mad mng mozilla mp3 mp4 mpeg multilib ncurses nls nptl nsplugin ogg oggvorbis opengl openmp oss pam pango pcre pdf perl png ppds profile python python_single_targets_python3_9 qt3support qt5 readline sdl seccomp snmp spell split-usr ssl startup-notification svg theora tiff truetype udev unicode upower usb v4l v4l2 vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2019" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="sse mmxext mmx sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9 python2_7" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="vesa radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

=================================================================
                        Package Settings
=================================================================

games-emulation/advancemame-3.9::gentoo was built with the following:
USE="alsa fbcon ncurses oss truetype -slang" ABI_X86="(64)"
Comment 4 Martin Bays 2021-11-25 21:04:16 UTC
Created attachment 756350 [details]
compressed build log
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-25 21:05:04 UTC
Can someone hitting it please enable debugging symbols for advancemame and possibly glibc?

https://wiki.gentoo.org/wiki/Debugging
Comment 6 imsoalexm 2023-05-31 23:17:21 UTC
So I did a debug build of advancemame and gdb gives us the backtrace shown in the picture I attached.  The overflow seems to happen during joystick/input parsing, but of course one can see this more clearly for themselves from the screenshot.
Comment 7 imsoalexm 2023-05-31 23:18:12 UTC
Created attachment 862982 [details]
advancememe backtrace
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-01 00:23:23 UTC
(In reply to imsoalexm from comment #7)
> Created attachment 862982 [details]
> advancememe backtrace

Please copy/paste the gdb output here (for a few reasons, including that not all of our developers can see).
Comment 9 imsoalexm 2023-06-01 14:01:34 UTC
GDB Backtrace:

logging debugredirect:  off: Debug output will go to both the screen and the log file.
logging enabled:  on: Logging is enabled.
logging file:  The current logfile is "gdb.txt".
logging overwrite:  off: Logging appends to the log file.
logging redirect:  off: Output will go to both the screen and the log file.
#0  0x00007ffff79e1d0c in ?? () from /lib64/libc.so.6
#1  0x00007ffff7994532 in raise () from /lib64/libc.so.6
#2  0x00007ffff797e4b2 in abort () from /lib64/libc.so.6
#3  0x00007ffff797f3b5 in ?? () from /lib64/libc.so.6
#4  0x00007ffff7a6f125 in __fortify_fail () from /lib64/libc.so.6
#5  0x00007ffff7a6f110 in __stack_chk_fail () from /lib64/libc.so.6
#6  0x0000555555ccf5ed in event_locate (event_map=event_map@entry=0x7ffffffe9640, event_max=event_max@entry=32, prefix=prefix@entry=0x555557075a9a "event", eacces=eacces@entry=0x7ffffffe8a4c) at advance/linux/event.c:2303
#7  0x0000555555ccc278 in joystickb_event_init (joystickb_id=<optimized out>) at advance/linux/jevent.c:781
#8  0x0000555555e0fd99 in joystickb_init () at advance/lib/joydrv.c:120
#9  0x0000555555cee425 in advance_input_inner_init (context=context@entry=0x555557ee08d8 <CONTEXT+15128>, cfg_context=0x555559171ad0) at advance/osd/input.c:2343
#10 0x0000555555cd09f4 in os_main (argc=<optimized out>, argc@entry=2, argv=argv@entry=0x7fffffffdca8) at advance/osd/emu.c:964
#11 0x0000555555cbf70a in main (argc=2, argv=0x7fffffffdca8) at advance/linux/os.c:808
#6  0x0000555555ccf5ed in event_locate (event_map=event_map@entry=0x7ffffffe9640, event_max=event_max@entry=32, prefix=prefix@entry=0x555557075a9a "event", eacces=eacces@entry=0x7ffffffe8a4c) at advance/linux/event.c:2303
$3 = (struct event_location *) 0x7ffffffe9640
$4 = {file = "/dev/input/event6", '\000' <repeats 110 times>, desc = "Intel HID events", '\000' <repeats 111 times>, vendor = 0, product = 0, version = 0, bus = 25, index = 6}
Comment 10 imsoalexm 2023-06-01 14:05:44 UTC
for the final two GDB debug outputs I printed out the first parameter of the event_locate function in advance/linux/event.c:

unsigned event_locate(struct event_location* event_map, unsigned event_max, const char* prefix, adv_bool* eacces)
Comment 11 imsoalexm 2023-06-06 13:53:51 UTC
When built with -fsanitize=address:

Loading a game doesn't crash anymore outright but ignores input, still responds gracefully to Ctrl-c.

When trying to generate xml of configuration options though with -listxml:

=================================================================
==2709==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000000176 at pc 0x7f174c2c75d5 bp 0x7ffe951e8010 sp 0x7ffe951e77b8
READ of size 7 at 0x603000000176 thread T0
    #0 0x7f174c2c75d4  (/usr/lib/gcc/x86_64-pc-linux-gnu/13/libasan.so.8+0xc75d4)
    #1 0x7f174c2c7a6e in __interceptor_memcmp (/usr/lib/gcc/x86_64-pc-linux-gnu/13/libasan.so.8+0xc7a6e)
    #2 0x55be5e161fdf in partial_match_whole advance/lib/conf.c:61
    #3 0x55be5e161fdf in option_search_tag_partial_whole advance/lib/conf.c:179
    #4 0x55be5e168ada in conf_input_args_load advance/lib/conf.c:1742
    #5 0x55be5de68b5a in os_main advance/osd/emu.c:693
    #6 0x55be5de2cf52 in main advance/linux/os.c:808
    #7 0x7f174bd948c9  (/lib64/libc.so.6+0x238c9)
    #8 0x7f174bd94984 in __libc_start_main (/lib64/libc.so.6+0x23984)
    #9 0x55be5de45a70  (/usr/bin/advmame+0x1933a70)

0x603000000176 is located 0 bytes after 22-byte region [0x603000000160,0x603000000176)
allocated by thread T0 here:
    #0 0x7f174c2824e0 in strdup (/usr/lib/gcc/x86_64-pc-linux-gnu/13/libasan.so.8+0x824e0)
    #1 0x55be5e165bf2 in conf_bool_register_default advance/lib/conf.c:574

SUMMARY: AddressSanitizer: heap-buffer-overflow (/usr/lib/gcc/x86_64-pc-linux-gnu/13/libasan.so.8+0xc75d4) 
Shadow bytes around the buggy address:
  0x602ffffffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x602fffffff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x602fffffff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x603000000000: fa fa 00 00 00 fa fa fa 00 00 00 00 fa fa 00 00
  0x603000000080: 00 00 fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa
=>0x603000000100: 00 00 00 01 fa fa 00 00 00 fa fa fa 00 00[06]fa
  0x603000000180: fa fa 00 00 05 fa fa fa 00 00 00 fa fa fa 00 00
  0x603000000200: 02 fa fa fa 00 00 05 fa fa fa 00 00 02 fa fa fa
  0x603000000280: 00 00 03 fa fa fa 00 00 02 fa fa fa 00 00 01 fa
  0x603000000300: fa fa 00 00 00 fa fa fa 00 00 02 fa fa fa 00 00
  0x603000000380: 04 fa fa fa 00 00 02 fa fa fa 00 00 04 fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==2709==ABORTING