Bug 527121 - fortify_fail in erlang code
Summary: fortify_fail in erlang code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-04 17:28 UTC by Yanko Kaneti
Modified: 2009-10-06 06:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-10-06 06:27:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
preprocessed erl_drv_thread.c (435.21 KB, text/plain)
2009-10-04 17:28 UTC, Yanko Kaneti
no flags Details

Description Yanko Kaneti 2009-10-04 17:28:17 UTC
Created attachment 363604 [details]
preprocessed erl_drv_thread.c

gcc-4.4.1-17.fc12.x86_64  , but also tried erlang rebuilt with 4.4.1-18

Description of problem:
Trying to start couchdb in rawhide fails in a fortify check in erlang code
*** buffer overflow detected ***: /usr/lib64/erlang/erts-5.7.2/bin/beam.smp terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f0202351507]
/lib64/libc.so.6(+0xf8470)[0x7f020234f470]
/usr/lib64/erlang/erts-5.7.2/bin/beam.smp(erl_drv_rwlock_create+0x59)[0x501079]
/usr/lib64/erlang/lib/crypto-1.6/priv/lib/crypto_drv.so(+0x22ed)[0x7f01fd8b02ed]
/usr/lib64/erlang/erts-5.7.2/bin/beam.smp(erts_add_driver_entry+0x1b4)[0x484e34]
/usr/lib64/erlang/erts-5.7.2/bin/beam.smp[0x44bc92]
/usr/lib64/erlang/erts-5.7.2/bin/beam.smp(erl_ddll_try_load_3+0x992)[0x44dc12]
/usr/lib64/erlang/erts-5.7.2/bin/beam.smp(process_main+0x1c2a)[0x50f32a]
/usr/lib64/erlang/erts-5.7.2/bin/beam.smp[0x491903]
/usr/lib64/erlang/erts-5.7.2/bin/beam.smp[0x584893]
....

The code in erts/emulator/beam/erl_drv_thread.c has not seen changes in recent years, so I am assuming something in it does not agree with the fortify gcc protection.

The build line is 
gcc   -O3 -fomit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -I/home/yaneti/rpmbuild/BUILD/otp_src_R13B01/erts/x86_64-unknown-linux-gnu   -fno-tree-copyrename  -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS  -Ix86_64-unknown-linux-gnu/opt/smp -Ibeam -Isys/unix -Isys/common -Ix86_64-unknown-linux-gnu -Izlib -Ipcre -Ihipe -I../include/internal -I../include/internal/x86_64-unknown-linux-gnu -c beam/erl_drv_thread.c -o obj/x86_64-unknown-linux-gnu/opt/smp/erl_drv_thread.o

Attaching the preprocessed code. (I hope the correct thing)

Comment 1 Yanko Kaneti 2009-10-06 04:55:08 UTC
Yup, couchdb starts ok here with erlang built with -19


Note You need to log in before you can comment on or make changes to this bug.