Bug 278838 - audio/rsgain Segmentation fault any time 'easy' mode is used
Summary: audio/rsgain Segmentation fault any time 'easy' mode is used
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Jason E. Hale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-07 13:53 UTC by pere_goriot99@yahoo.com
Modified: 2024-05-16 13:34 UTC (History)
0 users

See Also:
jhale: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pere_goriot99@yahoo.com 2024-05-07 13:53:48 UTC
Affects versions 3.4, 3.5.  3.3_1 works fine.

Using eg 'rsgain easy .' on a drectory contain one or more flac files causes a seg fault.

Back trace from .core file uing gdb:

Reading symbols from /usr/ports/audio/rsgain/work/stage/usr/local/bin/rsgain...
[New LWP 139340]
Core was generated by `/usr/ports/audio/rsgain/work/stage/usr/local/bin/rsgain easy .'.
Program terminated with signal SIGSEGV, Segmentation fault.
Address not mapped to object.
#0  0x00000008285e225d in ebur128_loudness_global_multiple () from /usr/local/lib/libebur128.so.1
(gdb) bt
#0  0x00000008285e225d in ebur128_loudness_global_multiple () from /usr/local/lib/libebur128.so.1
#1  0x0000000000244726 in ScanJob::calculate_album_loudness (this=0x104428011040) at /usr/ports/audio/rsgain/work/rsgain-3.5/src/scan.cpp:644
#2  0x0000000000240996 in ScanJob::calculate_loudness (this=0x104428011040) at /usr/ports/audio/rsgain/work/rsgain-3.5/src/scan.cpp:457
#3  0x000000000023e81c in ScanJob::scan (this=0x104428011040, ffmpeg_mutex=0x0) at /usr/ports/audio/rsgain/work/rsgain-3.5/src/scan.cpp:178
#4  0x000000000027149a in scan_easy (path=..., preset=..., nb_threads=1) at /usr/ports/audio/rsgain/work/rsgain-3.5/src/easymode.cpp:786
#5  0x000000000026e541 in easy_mode (argc=2, argv=0x8205059b8) at /usr/ports/audio/rsgain/work/rsgain-3.5/src/easymode.cpp:389
#6  0x000000000022b3d6 in main (argc=3, argv=0x8205059b0) at /usr/ports/audio/rsgain/work/rsgain-3.5/src/rsgain.cpp:378
Comment 1 Jason E. Hale freebsd_committer freebsd_triage 2024-05-15 23:50:10 UTC
Confirmed. I bisected the code and the regression was introduced in [1].

[1] https://github.com/complexlogic/rsgain/commit/63e87a4f7d3b5c816eab630fba41ba9a63b82519
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-05-16 00:05:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=99bafb68144c1824441d3b47c3dc141c7721148b

commit 99bafb68144c1824441d3b47c3dc141c7721148b
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2024-05-15 23:56:38 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2024-05-16 00:03:53 +0000

    audio/rsgain: Fix segmentation fault

    When calculating album loudness on a drectory containing one or more
    audio files using `rsgain easy .`, for example, a segmentation fault
    can occur.

    Affects versions 3.4 and 3.5.

    PR:             278838
    Reported by:    <pere_goriot99@yahoo.com>
    MFH:            2024Q2

 audio/rsgain/Makefile                       |  1 +
 audio/rsgain/files/patch-src_scan.cpp (new) | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-05-16 00:05:02 UTC
A commit in branch 2024Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=910c4d572da2fcc17dc9d646136dfb6d6e9fdcc4

commit 910c4d572da2fcc17dc9d646136dfb6d6e9fdcc4
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2024-05-15 23:56:38 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2024-05-16 00:04:35 +0000

    audio/rsgain: Fix segmentation fault

    When calculating album loudness on a drectory containing one or more
    audio files using `rsgain easy .`, for example, a segmentation fault
    can occur.

    Affects versions 3.4 and 3.5.

    PR:             278838
    Reported by:    <pere_goriot99@yahoo.com>
    MFH:            2024Q2

    (cherry picked from commit 99bafb68144c1824441d3b47c3dc141c7721148b)

 audio/rsgain/Makefile                       |  1 +
 audio/rsgain/files/patch-src_scan.cpp (new) | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
Comment 4 Jason E. Hale freebsd_committer freebsd_triage 2024-05-16 00:06:50 UTC
Should be fixed now. Thanks for the report!
Comment 5 pere_goriot99@yahoo.com 2024-05-16 13:34:20 UTC
Checked and confirmed fixed.

Many Thanks!