Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 931225 - media-gfx/jhead-3.08: Segmentaion fault
Summary: media-gfx/jhead-3.08: Segmentaion fault
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Andreas K. Hüttel
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-05 02:44 UTC by sam.revitch@gmail.com
Modified: 2024-05-05 22:01 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sam.revitch@gmail.com 2024-05-05 02:44:11 UTC
Any attempt to run the ebuild binary of jhead fails with SIGSEGV.


Reproducible: Always

Steps to Reproduce:
1. Install ebuild of media-gfx/jhead
2. Run "jhead"
Actual Results:  
$ jhead
Segmentation fault (core dumped)

Expected Results:  
No SIGSEGV.

Taking the tgz source archive and building by hand, without the ebuild patch, results in a working executable.
Comment 1 Jonas Stein gentoo-dev 2024-05-05 16:03:12 UTC
Thank you for the report. We need to have all information at hand before ticket assignment
as described on https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Please provide 

[ ] the complete build.log as attachment 
[ ] the output of emerge --info <category/packagename> in the comment text 

and reopen this ticket (Status:UNCONFIRMED) afterwards.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-05 16:23:26 UTC
In particular, see https://wiki.gentoo.org/wiki/Debugging#Per-package.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-05 16:35:30 UTC
I can reproduce. I'll take a look.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-05 16:39:33 UTC
```
$ valgrind ./jhead
==950677== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==950677==  Bad permissions for mapped region at address 0x108000
==950677==    at 0x108000: ??? (in /var/tmp/portage/media-gfx/jhead-3.08/work/jhead-3.08/jhead)
==950677==
```

lol:
```
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7fe1000 in ?? ()
(gdb) bt
#0  0x00007ffff7fe1000 in ?? ()
#1  0x0000000000000001 in ?? ()
#2  0x00007fffffffe54b in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb)
```

LDFLAGS is wrong, it tries to build the executable as a library.
Comment 5 Larry the Git Cow gentoo-dev 2024-05-05 16:41:16 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=736ee1f27b0f84869cb6b99db0afffd833e69413

commit 736ee1f27b0f84869cb6b99db0afffd833e69413
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-05 16:40:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-05 16:41:03 +0000

    media-gfx/jhead: fix LDFLAGS patch
    
    We don't want to build jhead itself with -shared, just libjhead.
    
    Closes: https://bugs.gentoo.org/931225
    Signed-off-by: Sam James <sam@gentoo.org>

 media-gfx/jhead/files/jhead-3.08-fix-makefile.patch         | 4 ++--
 media-gfx/jhead/{jhead-3.08.ebuild => jhead-3.08-r1.ebuild} | 0
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 6 Larry the Git Cow gentoo-dev 2024-05-05 16:45:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d994e07488e48d462dff33a281ab8692415c35c5

commit d994e07488e48d462dff33a281ab8692415c35c5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-05 16:44:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-05 16:44:21 +0000

    media-gfx/jhead: add (very basic) smoketest to src_test
    
    Left a TODO for someone else to improve.
    
    Bug: https://bugs.gentoo.org/931225
    Signed-off-by: Sam James <sam@gentoo.org>

 media-gfx/jhead/jhead-3.08-r1.ebuild | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 7 Sergei Trofimovich 2024-05-05 21:57:07 UTC
> +	jhead -V || die

I would expect `src_test()` to refer something from `$WORKDIR` or `./`, not `$PATH`. At least the test run on a system without `jhead` installed fails as:

    # FEATURES=test emerge -v1 jhead
    ...
    >>> Test phase: media-gfx/jhead-3.08-r1
    /dev/shm/portage/media-gfx/jhead-3.08-r1/temp/environment: line 1620: jhead: command not found
Comment 8 Larry the Git Cow gentoo-dev 2024-05-05 22:01:06 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a67ea57e40822e253dc734cad20e39559a39ff57

commit a67ea57e40822e253dc734cad20e39559a39ff57
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-05 22:00:06 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-05 22:00:31 +0000

    media-gfx/jhead: actually test the just-built binary
    
    Oops. Pointed out by slyfox on the bug.
    
    Bug: https://bugs.gentoo.org/931225
    Signed-off-by: Sam James <sam@gentoo.org>

 media-gfx/jhead/jhead-3.08-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)