Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 642210 - app-text/pdf2htmlEX-0.14.6 built with gcc-6.4.0: segmentation fault on any input
Summary: app-text/pdf2htmlEX-0.14.6 built with gcc-6.4.0: segmentation fault on any input
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: default-pie
  Show dependency tree
 
Reported: 2017-12-25 13:42 UTC by Andreas K. Hüttel
Modified: 2017-12-30 22:16 UTC (History)
3 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 Andreas K. Hüttel archtester gentoo-dev 2017-12-25 13:42:04 UTC
huettel@porto ~/Work/Regensburg/Web/Homepage/publications $ pdf2htmlEX paddle.pdf paddle.html
Speicherzugriffsfehler (Speicherabzug geschrieben)

(=segmentation fault, core dumped)

Backtrace:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  fprintf (__fmt=0x7f369daa45da "%s:\t%s\n", __stream=0x55e05bed5d70) at /usr/include/bits/stdio2.h:97
97        return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
(gdb) bt
#0  fprintf (__fmt=0x7f369daa45da "%s:\t%s\n", __stream=0x55e05bed5d70) at /usr/include/bits/stdio2.h:97
#1  NOUI_SavePrefs (not_if_script=<optimized out>) at noprefs.c:859
#2  0x00007f369d8b749b in NOUI_SetPrefs (name=0x55e05a686209 "DetectDiagonalStems", val1=0x7ffe63ebcd80, val2=0x0) at noprefs.c:431
#3  0x000055e05a67824e in ffw_init (debug=0) at /var/tmp/portage/app-text/pdf2htmlEX-0.14.6/work/pdf2htmlEX-0.14.6/src/util/ffw.c:77
#4  0x000055e05a665d62 in pdf2htmlEX::HTMLRenderer::HTMLRenderer (this=0x55e05be77c60, param=...)
    at /var/tmp/portage/app-text/pdf2htmlEX-0.14.6/work/pdf2htmlEX-0.14.6/src/HTMLRenderer/general.cc:58
#5  0x000055e05a648b14 in main (argc=<optimized out>, argv=<optimized out>)
    at /var/tmp/portage/app-text/pdf2htmlEX-0.14.6/work/pdf2htmlEX-0.14.6/src/pdf2htmlEX.cc:421

End of strace output: 

close(4)                                = 0
mprotect(0x7f7ff4ac5000, 4096, PROT_READ) = 0
brk(0x564b26d35000)                     = 0x564b26d35000
stat("/home/huettel/.config/fontforge", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
mkdir("/home", 0755)                    = -1 EEXIST (File exists)
mkdir("/home/huettel", 0755)            = -1 EEXIST (File exists)
mkdir("/home/huettel/.config", 0755)    = -1 EEXIST (File exists)
mkdir("/home/huettel/.config/fontforge", 0755) = -1 EEXIST (File exists)
stat("/home/huettel/.config/fontforge", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
mkdir("/home", 0755)                    = -1 EEXIST (File exists)
mkdir("/home/huettel", 0755)            = -1 EEXIST (File exists)
mkdir("/home/huettel/.config", 0755)    = -1 EEXIST (File exists)
mkdir("/home/huettel/.config/fontforge", 0755) = -1 EEXIST (File exists)
open("/home/huettel/.config/fontforge/prefs", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x26d14c90} ---
+++ killed by SIGSEGV (core dumped) +++

See also: 

https://groups.google.com/forum/#!topic/linux.debian.bugs.dist/2DvA7jt0Ydo
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2017-12-25 13:53:58 UTC
See also https://github.com/fontforge/fontforge/issues/2751
Comment 2 Larry the Git Cow gentoo-dev 2017-12-30 19:37:15 UTC
The bug has been referenced in the following commit(s):

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

commit ca40e3a175ee5cda3f248d1b84c6d8a596f3fcba
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2017-12-30 19:36:22 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2017-12-30 19:36:55 +0000

    app-text/pdf2htmlEX: Bump for debugging purposes. Builds with poppler-0.61 but crashes, see bug 642614 and bug 642210
    
    Closes: https://bugs.gentoo.org/642614
    Bug: https://bugs.gentoo.org/642210
    See-also: https://github.com/akhuettel/pdf2htmlEX/releases/tag/gentoo-v0.14.6.1
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 app-text/pdf2htmlEX/Manifest                   |  1 +
 app-text/pdf2htmlEX/pdf2htmlEX-0.14.6.1.ebuild | 32 ++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)}
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2017-12-30 21:38:12 UTC
When built with sys-devel/gcc-5.4.0-r3, the program works fine.

Note, I only rebuilt pdf2htmlEX; the whole remaining system was still the code generated with gcc-6 on 17.0 profile rebuild.
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2017-12-30 21:42:24 UTC
Adding -no-pie to CXXFLAGS and CFLAGS makes things work also with gcc-6 ...
Comment 5 Larry the Git Cow gentoo-dev 2017-12-30 21:57:48 UTC
The bug has been closed via the following commit(s):

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

commit 501d60fe95831fe5b55ab586fddbc966d5a39127
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2017-12-30 21:57:15 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2017-12-30 21:57:31 +0000

    app-text/pdf2htmlEX: Enforce building without PIE, bug 642210
    
    To do this cleanly we require at least gcc-6 (otherwise the ebuild
    becomes one big mess).
    
    Closes: https://bugs.gentoo.org/642210
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 app-text/pdf2htmlEX/pdf2htmlEX-0.14.6.1.ebuild | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2017-12-30 22:16:43 UTC
For the record the fontforge issues are a *different* crash (that we start seeing now, depending on the input; completely different backtrace). -> new bug for that