You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Igor Galić (JIRA)" <ji...@apache.org> on 2010/08/27 02:30:54 UTC

[jira] Created: (TS-427) Build ATS with clang

Build ATS with clang
--------------------

                 Key: TS-427
                 URL: https://issues.apache.org/jira/browse/TS-427
             Project: Traffic Server
          Issue Type: Improvement
          Components: Build
    Affects Versions: 2.1.3
         Environment: OS: Any; Clang --version:
clang version 1.1 (branches/release_27)
Target: x86_64-pc-linux-gnu
Thread model: posix
            Reporter: Igor Galić


I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:

i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
#! /bin/sh
#
# Created by configure

CC="clang"; export CC
CXX="clang"; export CXX
CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
"./configure" \
"--enable-layout=opt" \
"--with-user=proxy" \
"--with-group=proxy" \
"CC=clang" \
"CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
"LDFLAGS=-Wl,--as-needed" \
"CXX=clang" \
"$@"
i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %

Until I hit errors that seemed to include templates.
I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Galić updated TS-427:
--------------------------

    Comment: was deleted

(was: Here's a repaste of the above abort(), run through c++filt, so you can actually read it. -- n.b. I'm always compiling against llvm/clang from trunk (in silent that this is clang's issue, not mine ;)

FATAL: ./P_CacheInternal.h:617: failed assert `!part || this_ethread() != part->mutex->thread_holding`
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7fde1fdc6c11]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7fde1fdc6d80]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7fde1fdc5de2]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x8a)[0x7fde1fd5ffea]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadStartEarliest(int, Event*)+0xe50)[0x7fde1fd5d890]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleReadDone(int, Event*)+0xc59)[0x7fde1fd34259]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadStartEarliest(int, Event*)+0xd40)[0x7fde1fd5d780]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadFromWriter(int, Event*)+0x1831)[0x7fde1fd5ac01]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(Cache::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)+0x589)[0x7fde1fd580a9]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)+0xbc)[0x7fde1fb210dc]
/opt/trafficserver/bin/traffic_server(INKCacheRead+0x1a6)[0x7fde1fb192e6]
/opt/trafficserver/bin/traffic_server(cache_handler(void*, INKEvent, void*)+0x1679)[0x7fde1fb2cdf9]
/opt/trafficserver/bin/traffic_server(INKContInternal::handle_event(int, void*)+0xe5)[0x7fde1fb07895]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::calluser(int)+0xb6)[0x7fde1fd60146]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x117)[0x7fde1fd69757]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteWriteDone(int, Event*)+0x609)[0x7fde1fd69619]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleWriteLock(int, Event*)+0x16a)[0x7fde1fd50a1a]
/opt/trafficserver/bin/traffic_server(CacheVC::do_write_lock_call()+0xae)[0x7fde1fd6c60e]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x5b6)[0x7fde1fd69bf6]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteWriteDone(int, Event*)+0x609)[0x7fde1fd69619]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleWriteLock(int, Event*)+0x16a)[0x7fde1fd50a1a]
/opt/trafficserver/bin/traffic_server(CacheVC::do_write_lock_call()+0xae)[0x7fde1fd6c60e]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x5b6)[0x7fde1fd69bf6]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x11c)[0x7fde1fd6007c]
/opt/trafficserver/bin/traffic_server(Cache::open_write(Continuation*, INK_MD5*, CacheFragType, int, long, char*, int)+0x594)[0x7fde1fd6b344]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_write(Continuation*, INK_MD5*, CacheFragType, int, int, long, char*, int)+0x124)[0x7fde1fb21214]
/opt/trafficserver/bin/traffic_server(INKCacheWrite+0x1c9)[0x7fde1fb19509]
/opt/trafficserver/bin/traffic_server(RegressionTest_SDK_API_INKCache(RegressionTest*, int, int*)+0x327)[0x7fde1fb2e147]
/opt/trafficserver/bin/traffic_server(+0x437abd)[0x7fde1fdddabd]
/opt/trafficserver/bin/traffic_server(RegressionTest::run(char*)+0xa5)[0x7fde1fddd9e5]
/opt/trafficserver/bin/traffic_server(RegressionCont::mainEvent(int, Event*)+0xb6)[0x7fde1fb56d16]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(EThread::process_event(Event*, int)+0x171)[0x7fde1fdbc321]
/opt/trafficserver/bin/traffic_server(EThread::execute()+0x27f)[0x7fde1fdbc77f]
/opt/trafficserver/bin/traffic_server(main+0x194e)[0x7fde1fb5097e]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fde1d444c4d]
/opt/trafficserver/bin/traffic_server(+0x12ead9)[0x7fde1fad4ad9])

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Galić updated TS-427:
--------------------------

    Attachment: ats.clang.patch

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.1.3
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.patch
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906394#action_12906394 ] 

Igor Galić commented on TS-427:
-------------------------------

Here's a repaste of the above abort(), run through c++filt, so you can actually read it. -- n.b. I'm always compiling against llvm/clang from trunk (in silent that this is clang's issue, not mine ;)

FATAL: ./P_CacheInternal.h:617: failed assert `!part || this_ethread() != part->mutex->thread_holding`
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7fde1fdc6c11]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7fde1fdc6d80]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7fde1fdc5de2]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x8a)[0x7fde1fd5ffea]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadStartEarliest(int, Event*)+0xe50)[0x7fde1fd5d890]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleReadDone(int, Event*)+0xc59)[0x7fde1fd34259]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadStartEarliest(int, Event*)+0xd40)[0x7fde1fd5d780]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadFromWriter(int, Event*)+0x1831)[0x7fde1fd5ac01]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(Cache::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)+0x589)[0x7fde1fd580a9]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)+0xbc)[0x7fde1fb210dc]
/opt/trafficserver/bin/traffic_server(INKCacheRead+0x1a6)[0x7fde1fb192e6]
/opt/trafficserver/bin/traffic_server(cache_handler(void*, INKEvent, void*)+0x1679)[0x7fde1fb2cdf9]
/opt/trafficserver/bin/traffic_server(INKContInternal::handle_event(int, void*)+0xe5)[0x7fde1fb07895]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::calluser(int)+0xb6)[0x7fde1fd60146]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x117)[0x7fde1fd69757]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteWriteDone(int, Event*)+0x609)[0x7fde1fd69619]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleWriteLock(int, Event*)+0x16a)[0x7fde1fd50a1a]
/opt/trafficserver/bin/traffic_server(CacheVC::do_write_lock_call()+0xae)[0x7fde1fd6c60e]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x5b6)[0x7fde1fd69bf6]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteWriteDone(int, Event*)+0x609)[0x7fde1fd69619]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleWriteLock(int, Event*)+0x16a)[0x7fde1fd50a1a]
/opt/trafficserver/bin/traffic_server(CacheVC::do_write_lock_call()+0xae)[0x7fde1fd6c60e]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x5b6)[0x7fde1fd69bf6]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x11c)[0x7fde1fd6007c]
/opt/trafficserver/bin/traffic_server(Cache::open_write(Continuation*, INK_MD5*, CacheFragType, int, long, char*, int)+0x594)[0x7fde1fd6b344]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_write(Continuation*, INK_MD5*, CacheFragType, int, int, long, char*, int)+0x124)[0x7fde1fb21214]
/opt/trafficserver/bin/traffic_server(INKCacheWrite+0x1c9)[0x7fde1fb19509]
/opt/trafficserver/bin/traffic_server(RegressionTest_SDK_API_INKCache(RegressionTest*, int, int*)+0x327)[0x7fde1fb2e147]
/opt/trafficserver/bin/traffic_server(+0x437abd)[0x7fde1fdddabd]
/opt/trafficserver/bin/traffic_server(RegressionTest::run(char*)+0xa5)[0x7fde1fddd9e5]
/opt/trafficserver/bin/traffic_server(RegressionCont::mainEvent(int, Event*)+0xb6)[0x7fde1fb56d16]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(EThread::process_event(Event*, int)+0x171)[0x7fde1fdbc321]
/opt/trafficserver/bin/traffic_server(EThread::execute()+0x27f)[0x7fde1fdbc77f]
/opt/trafficserver/bin/traffic_server(main+0x194e)[0x7fde1fb5097e]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fde1d444c4d]
/opt/trafficserver/bin/traffic_server(+0x12ead9)[0x7fde1fad4ad9]

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903821#action_12903821 ] 

Igor Galić edited comment on TS-427 at 9/18/10 8:35 AM:
--------------------------------------------------------

This is the current state. It compiles and runs.. oh well.. almost:
CC="/opt/bw/bin/clang"; export CC
CXX="/opt/bw/bin/clang++"; export CXX
LD="/opt/bw/bin/clang++"; export LD
CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
CXXFLAGS="-x c++ -fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
"./configure" \
"--enable-layout=opt" \
"--with-user=proxy" \
"--with-group=proxy" \
"--enable-debug"

This will get us through the compile, but when running the regression test, and port 8080 is busy, we will segfault, as this happens with GCC the same, I'll leave that case out and we'll cut to the interesting one:

[SDK_API_INKContDataGet] INKContDataGet : [TestCase1] <<PASS>> { ok }
FATAL: ./P_CacheInternal.h:617: failed assert `!part || this_ethread() != part->mutex->thread_holding`
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7fde1fdc6c11]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7fde1fdc6d80]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7fde1fdc5de2]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x8a)[0x7fde1fd5ffea]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadStartEarliest(int, Event*)+0xe50)[0x7fde1fd5d890]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleReadDone(int, Event*)+0xc59)[0x7fde1fd34259]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadStartEarliest(int, Event*)+0xd40)[0x7fde1fd5d780]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadFromWriter(int, Event*)+0x1831)[0x7fde1fd5ac01]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(Cache::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)+0x589)[0x7fde1fd580a9]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)+0xbc)[0x7fde1fb210dc]
/opt/trafficserver/bin/traffic_server(INKCacheRead+0x1a6)[0x7fde1fb192e6]
/opt/trafficserver/bin/traffic_server(cache_handler(void*, INKEvent, void*)+0x1679)[0x7fde1fb2cdf9]
/opt/trafficserver/bin/traffic_server(INKContInternal::handle_event(int, void*)+0xe5)[0x7fde1fb07895]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::calluser(int)+0xb6)[0x7fde1fd60146]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x117)[0x7fde1fd69757]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteWriteDone(int, Event*)+0x609)[0x7fde1fd69619]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleWriteLock(int, Event*)+0x16a)[0x7fde1fd50a1a]
/opt/trafficserver/bin/traffic_server(CacheVC::do_write_lock_call()+0xae)[0x7fde1fd6c60e]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x5b6)[0x7fde1fd69bf6]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteWriteDone(int, Event*)+0x609)[0x7fde1fd69619]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleWriteLock(int, Event*)+0x16a)[0x7fde1fd50a1a]
/opt/trafficserver/bin/traffic_server(CacheVC::do_write_lock_call()+0xae)[0x7fde1fd6c60e]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x5b6)[0x7fde1fd69bf6]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x11c)[0x7fde1fd6007c]
/opt/trafficserver/bin/traffic_server(Cache::open_write(Continuation*, INK_MD5*, CacheFragType, int, long, char*, int)+0x594)[0x7fde1fd6b344]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_write(Continuation*, INK_MD5*, CacheFragType, int, int, long, char*, int)+0x124)[0x7fde1fb21214]
/opt/trafficserver/bin/traffic_server(INKCacheWrite+0x1c9)[0x7fde1fb19509]
/opt/trafficserver/bin/traffic_server(RegressionTest_SDK_API_INKCache(RegressionTest*, int, int*)+0x327)[0x7fde1fb2e147]
/opt/trafficserver/bin/traffic_server(+0x437abd)[0x7fde1fdddabd]
/opt/trafficserver/bin/traffic_server(RegressionTest::run(char*)+0xa5)[0x7fde1fddd9e5]
/opt/trafficserver/bin/traffic_server(RegressionCont::mainEvent(int, Event*)+0xb6)[0x7fde1fb56d16]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fde1fafbcc8]
/opt/trafficserver/bin/traffic_server(EThread::process_event(Event*, int)+0x171)[0x7fde1fdbc321]
/opt/trafficserver/bin/traffic_server(EThread::execute()+0x27f)[0x7fde1fdbc77f]
/opt/trafficserver/bin/traffic_server(main+0x194e)[0x7fde1fb5097e]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fde1d444c4d]
/opt/trafficserver/bin/traffic_server(+0x12ead9)[0x7fde1fad4ad9]
Aborted

I guess I'll have to look into those cases closer.

      was (Author: i.galic):
    This is the current state. It compiles and runs.. oh well.. almost:
CC="/opt/bw/bin/clang"; export CC
CXX="/opt/bw/bin/clang++"; export CXX
LD="/opt/bw/bin/clang++"; export LD
CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
CXXFLAGS="-x c++ -fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
"./configure" \
"--enable-layout=opt" \
"--with-user=proxy" \
"--with-group=proxy" \
"--enable-debug"

This will get us through the compile, but when running the regression test, and port 8080 is busy, we will segfault:
root@phoenix:~# /opt/trafficserver/bin/traffic_server -R 1
Layout configuration
          --prefix = '/opt/trafficserver'
     --exec_prefix = '/opt/trafficserver'
          --bindir = '/opt/trafficserver/bin'
         --sbindir = '/opt/trafficserver/sbin'
      --sysconfdir = '/etc/opt/trafficserver'
         --datadir = '/opt/trafficserver/share'
      --includedir = '/opt/trafficserver/include'
          --libdir = '/opt/trafficserver/lib'
      --libexecdir = '/opt/trafficserver/libexec'
   --localstatedir = '/var/opt/trafficserver'
  --sharedstatedir = '/opt/trafficserver'
      --runtimedir = '/var/opt/trafficserver/run'
          --logdir = '/var/opt/trafficserver/logs'
          --mandir = '/opt/trafficserver/man'
         --infodir = '/opt/trafficserver/info'
        --cachedir = '/var/opt/trafficserver/cache'
[TrafficServer] using root directory '/opt/trafficserver'
[Aug 28 15:15:29.056] {139700967716640} STATUS: opened /var/opt/trafficserver/logs/diags.log
[Aug 28 15:15:29.235] Server {139700967716640} ERROR: Could not bind or listen to port 8080 (error: -1)
[Aug 28 15:15:29.237] Server {139700771809040} FATAL: <HttpAccept.cc:98 (mainEvent)> HTTP accept received fatal error: errno = 9
FATAL: UnixUDPNet.cc:295: failed assert `event != NULL`
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7f0eaad33711]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7f0eaad33880]
NOTE: Traffic Server received Sig 11: Segmentation fault
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7f0eaad328d2]
/opt/trafficserver/bin/traffic_server(_ZN19UDPReadContinuationD1Ev+0x50)[0x7f0eaad06530]
/opt/trafficserver/bin/traffic_server(_ZN14ClassAllocatorI19UDPReadContinuationE6_protoD2Ev+0x15)[0x7f0eaad0d085]
/opt/trafficserver/bin/traffic_server(+0x1d2e02)[0x7f0eaaae1e02]
/lib/libpthread.so.0(+0xf8f0)[0x7f0ea9e0a8f0]
[0xffffffff]
Segmentation fault (core dumped)


When the port is not busy, it fails a certain test with abort:
[SDK_API_INKContDataGet] INKContDataGet : [TestCase1] <<PASS>> { ok }
FATAL: ./P_CacheInternal.h:617: failed assert `!part || this_ethread() != part->mutex->thread_holding`
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7f29fdf0a711]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7f29fdf0a880]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7f29fdf098d2]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC8callcontEi+0x8a)[0x7f29fdea43da]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC21openReadStartEarliestEiP5Event+0xe37)[0x7f29fdea1c27]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC14handleReadDoneEiP5Event+0xc67)[0x7f29fde78557]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC21openReadStartEarliestEiP5Event+0xd27)[0x7f29fdea1b17]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18openReadFromWriterEiP5Event+0x1840)[0x7f29fde9efb0]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN5Cache9open_readEP12ContinuationP7INK_MD513CacheFragTypePci+0x589)[0x7f29fde9c439]
/opt/trafficserver/bin/traffic_server(_ZN14CacheProcessor9open_readEP12ContinuationP7INK_MD513CacheFragTypePci+0xbc)[0x7f29fdc6131c]
/opt/trafficserver/bin/traffic_server(INKCacheRead+0x1a6)[0x7f29fdc594e6]
/opt/trafficserver/bin/traffic_server(_Z13cache_handlerPv8INKEventS_+0x1679)[0x7f29fdc6d069]
/opt/trafficserver/bin/traffic_server(_ZN15INKContInternal12handle_eventEiPv+0xe5)[0x7f29fdc47bf5]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC8calluserEi+0xb6)[0x7f29fdea4536]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC13openWriteMainEiP5Event+0x117)[0x7f29fdead867]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18openWriteWriteDoneEiP5Event+0x609)[0x7f29fdead729]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC15handleWriteLockEiP5Event+0x16a)[0x7f29fde94dda]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18do_write_lock_callEv+0xae)[0x7f29fdeb073e]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC13openWriteMainEiP5Event+0x5b6)[0x7f29fdeadd06]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18openWriteWriteDoneEiP5Event+0x609)[0x7f29fdead729]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC15handleWriteLockEiP5Event+0x16a)[0x7f29fde94dda]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18do_write_lock_callEv+0xae)[0x7f29fdeb073e]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC13openWriteMainEiP5Event+0x5b6)[0x7f29fdeadd06]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC8callcontEi+0x11c)[0x7f29fdea446c]
/opt/trafficserver/bin/traffic_server(_ZN5Cache10open_writeEP12ContinuationP7INK_MD513CacheFragTypeilPci+0x594)[0x7f29fdeaf454]
/opt/trafficserver/bin/traffic_server(_ZN14CacheProcessor10open_writeEP12ContinuationP7INK_MD513CacheFragTypeiilPci+0x124)[0x7f29fdc61454]
/opt/trafficserver/bin/traffic_server(INKCacheWrite+0x1c9)[0x7f29fdc59709]
/opt/trafficserver/bin/traffic_server(_Z31RegressionTest_SDK_API_INKCacheP14RegressionTestiPi+0x327)[0x7f29fdc6e3b7]
/opt/trafficserver/bin/traffic_server(+0x43b82d)[0x7f29fdf2182d]
/opt/trafficserver/bin/traffic_server(_ZN14RegressionTest3runEPc+0xa5)[0x7f29fdf21755]
/opt/trafficserver/bin/traffic_server(_ZN14RegressionCont9mainEventEiP5Event+0xb8)[0x7f29fdc970f8]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7EThread13process_eventEP5Eventi+0x171)[0x7f29fdefff41]
/opt/trafficserver/bin/traffic_server(_ZN7EThread7executeEv+0x282)[0x7f29fdf003a2]
/opt/trafficserver/bin/traffic_server(main+0x1a0d)[0x7f29fdc90cad]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f29fb584c4d]
/opt/trafficserver/bin/traffic_server(+0x12f0f9)[0x7f29fdc150f9]
Aborted

I guess I'll have to look into those cases closer.
  
> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Galić updated TS-427:
--------------------------

    Attachment: ats-trunk.clang-trunk.patch

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910844#action_12910844 ] 

John Plevyak commented on TS-427:
---------------------------------

OK, I have a test case:

#include "stdio.h"

class L {
  public:
    int i;
    L(int j) : i(j) { printf("L(%d)\n", i); }
    ~L() { if (i != 11) printf("~L(%d)\n", i); }
};

int main(int argc, char *argv[]) {
  {
    L b(argc) ;
    printf("goto\n");
    if (argc) goto l;
  }
 l:
  printf("here\n"); 
  return 5;
}


jplevyak:svn [982] % g++ x.cc ; a.out 
L(1)
goto
~L(1)
here

jplevyak:svn [983] %  clang++ x.cc ; a.out
L(1)
goto
here


> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TS-427) Build ATS with clang

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Plevyak resolved TS-427.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.4

Committed revision 1005119.


> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>            Assignee: John Plevyak
>             Fix For: 2.1.4
>
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903831#action_12903831 ] 

Igor Galić commented on TS-427:
-------------------------------

I have confirmed the segmentation fault with GCC on trafficserver trunk with --enable-debug, so I guess I can exclude my patchset as suspect, also, this should probably be a separate defect?

root@phoenix:~# /opt/ats-vanilla-gcc/bin/traffic_server -R 1
Layout configuration
          --prefix = '/opt/ats-vanilla-gcc'
     --exec_prefix = '/opt/ats-vanilla-gcc'
          --bindir = '/opt/ats-vanilla-gcc/bin'
         --sbindir = '/opt/ats-vanilla-gcc/sbin'
      --sysconfdir = '/etc/opt/ats-vanilla-gcc'
         --datadir = '/opt/ats-vanilla-gcc/share'
      --includedir = '/opt/ats-vanilla-gcc/include'
          --libdir = '/opt/ats-vanilla-gcc/lib'
      --libexecdir = '/opt/ats-vanilla-gcc/libexec'
   --localstatedir = '/var/opt/ats-vanilla-gcc'
  --sharedstatedir = '/opt/ats-vanilla-gcc'
      --runtimedir = '/var/opt/ats-vanilla-gcc/run'
          --logdir = '/var/opt/ats-vanilla-gcc/logs'
          --mandir = '/opt/ats-vanilla-gcc/man'
         --infodir = '/opt/ats-vanilla-gcc/info'
        --cachedir = '/var/opt/ats-vanilla-gcc/cache'
[TrafficServer] using root directory '/opt/ats-vanilla-gcc'
[Aug 28 16:42:57.423] {140617315079968} STATUS: opened /var/opt/ats-vanilla-gcc/logs/diags.log
[Aug 28 16:42:57.777] Server {140617315079968} ERROR: Could not bind or listen to port 8080 (error: -1)
[Aug 28 16:42:57.779] Server {140617191810832} FATAL: <HttpAccept.cc:98 (mainEvent)> HTTP accept received fatal error: errno = 9
FATAL: UnixUDPNet.cc:295: failed assert `event != NULL`
/opt/ats-vanilla-gcc/bin/traffic_server - STACK TRACE: 
NOTE: Traffic Server received Sig 11: Segmentation fault
/opt/ats-vanilla-gcc/bin/traffic_server - STACK TRACE: 
/opt/ats-vanilla-gcc/bin/traffic_server(ink_fatal_va+0xd4)[0x7fe4055cec18]
/opt/ats-vanilla-gcc/bin/traffic_server(ink_fatal+0xc9)[0x7fe4055ced04]
/opt/ats-vanilla-gcc/bin/traffic_server(_ink_assert+0xd1)[0x7fe4055cddb1]
/opt/ats-vanilla-gcc/bin/traffic_server(_ZN19UDPReadContinuationD1Ev+0x46)[0x7fe4055a4fb0]
/opt/ats-vanilla-gcc/bin/traffic_server(_ZN14ClassAllocatorI19UDPReadContinuationE6_protoD1Ev+0x18)[0x7fe4055abe4e]
/opt/ats-vanilla-gcc/bin/traffic_server(_ZN14ClassAllocatorI19UDPReadContinuationED1Ev+0x1c)[0x7fe4055ac55a]
/opt/ats-vanilla-gcc/bin/traffic_server(+0x1b0082)[0x7fe4053b1082]
/lib/libc.so.6(exit+0xe2)[0x7fe402cba262]
/lib/libpthread.so.0(+0xf8f0)[0x7fe404dd08f0]
/opt/ats-vanilla-gcc/bin/traffic_server(+0x136cb9)[0x[0xffffffff7fe405337cb9]
]
Segmentation fault (core dumped)


Produced with:

CC="gcc"; export CC
CXX="g++"; export CXX
CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
"./configure" \
"--prefix=/opt/ats-vanilla-gcc" \
"--enable-layout=opt" \
"--with-user=proxy" \
"--with-group=proxy" \
"--enable-debug" \
"CC=$CC" \
"CXX=$CXX" \
"CFLAGS=$CFLAGS" \
"CXXFLAGS=$CFLAGS" \
"LDFLAGS=$LDFLAGS" \
"$@"

Once the regression test on the clang patchset is done, I'll test for the abort() -- then run the regression test with GCC compiled clang-patchset.

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.1.3
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.compile.patch, ats.clang.patch, ats.clang.patch
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906407#action_12906407 ] 

Igor Galić commented on TS-427:
-------------------------------

If I change the assert() to: ink_debug_assert(!part);
The stack trace looks like this:

REGRESSION TEST SDK_API_INKCache started
[SDK_API_INKCache] INKCacheReady : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKCacheKeyCreate : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKCacheKeySetDigest : [TestCase1] <<PASS>> { ok }
[SDK_API_INKContDataGet] INKContDataSet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKContDataGet] INKContDataGet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKActionCancel] INKActionCancel : [TestCase1] <<PASS>> { ok }
[SDK_API_INKContSchedule] INKContSchedule : [TestCase2] <<PASS>> { ok }
FATAL: ./P_CacheInternal.h:618: failed assert `!part`
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7fd02e8b5bd1]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7fd02e8b5d40]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7fd02e8b4da2]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x4b)[0x7fd02e84efab]
/opt/trafficserver/bin/traffic_server(Cache::open_write(Continuation*, INK_MD5*, CacheFragType, int, long, char*, int)+0x594)[0x7fd02e85a304]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_write(Continuation*, INK_MD5*, CacheFragType, int, int, long, char*, int)+0x124)[0x7fd02e610214]
/opt/trafficserver/bin/traffic_server(INKCacheWrite+0x1c9)[0x7fd02e608509]
/opt/trafficserver/bin/traffic_server(RegressionTest_SDK_API_INKCache(RegressionTest*, int, int*)+0x327)[0x7fd02e61d147]
/opt/trafficserver/bin/traffic_server(+0x437a7d)[0x7fd02e8cca7d]
/opt/trafficserver/bin/traffic_server(RegressionTest::run(char*)+0xa5)[0x7fd02e8cc9a5]
/opt/trafficserver/bin/traffic_server(RegressionCont::mainEvent(int, Event*)+0xb6)[0x7fd02e645d16]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7fd02e5eacc8]
/opt/trafficserver/bin/traffic_server(EThread::process_event(Event*, int)+0x171)[0x7fd02e8ab2e1]
/opt/trafficserver/bin/traffic_server(EThread::execute()+0x27f)[0x7fd02e8ab73f]
/opt/trafficserver/bin/traffic_server(main+0x194e)[0x7fd02e63f97e]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fd02bf33c4d]
/opt/trafficserver/bin/traffic_server(+0x12ead9)[0x7fd02e5c3ad9]

For ink_debug_assert(this_ethread() != part->mutex->thread_holding); it will look like this:

[SDK_API_INKActionCancel] INKActionCancel : [TestCase1] <<PASS>> { ok }
[SDK_API_INKContDataGet] INKContDataSet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKContDataGet] INKContDataGet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKCacheWrite : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKVIOReenable : [TestCase2] <<PASS>> { ok }
[SDK_API_INKCache] INKVIONBytesSet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKVConnWrite : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKVIOBufferGet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKVIOContGet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKVIOMutexGet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKVIOVConnGet : [TestCase1] <<PASS>> { ok }
[SDK_API_INKCache] INKVIOReaderGet : [TestCase1] <<PASS>> { ok }
FATAL: ./P_CacheInternal.h:618: failed assert `this_ethread() != part->mutex->thread_holding`
/opt/trafficserver/bin/traffic_server - STACK TRACE:
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7f4966520c01]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7f4966520d70]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7f496651fdd2]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x74)[0x7f49664b9fd4]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadStartEarliest(int, Event*)+0xe50)[0x7f49664b7890]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f4966255cc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleReadDone(int, Event*)+0xc59)[0x7f496648e259]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f4966255cc8]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadStartEarliest(int, Event*)+0xd40)[0x7f49664b7780]
/opt/trafficserver/bin/traffic_server(CacheVC::openReadFromWriter(int, Event*)+0x1831)[0x7f49664b4c01]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f4966255cc8]
/opt/trafficserver/bin/traffic_server(Cache::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)+0x589)[0x7f49664b20a9]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)+0xbc)[0x7f496627b0dc]
/opt/trafficserver/bin/traffic_server(INKCacheRead+0x1a6)[0x7f49662732e6]
/opt/trafficserver/bin/traffic_server(cache_handler(void*, INKEvent, void*)+0x1679)[0x7f4966286df9]
/opt/trafficserver/bin/traffic_server(INKContInternal::handle_event(int, void*)+0xe5)[0x7f4966261895]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f4966255cc8]
/opt/trafficserver/bin/traffic_server(CacheVC::calluser(int)+0xb6)[0x7f49664ba136]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x117)[0x7f49664c3747]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteWriteDone(int, Event*)+0x609)[0x7f49664c3609]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f4966255cc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleWriteLock(int, Event*)+0x16a)[0x7f49664aaa1a]
/opt/trafficserver/bin/traffic_server(CacheVC::do_write_lock_call()+0xae)[0x7f49664c65fe]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x5b6)[0x7f49664c3be6]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteWriteDone(int, Event*)+0x609)[0x7f49664c3609]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f4966255cc8]
/opt/trafficserver/bin/traffic_server(CacheVC::handleWriteLock(int, Event*)+0x16a)[0x7f49664aaa1a]
/opt/trafficserver/bin/traffic_server(CacheVC::do_write_lock_call()+0xae)[0x7f49664c65fe]
/opt/trafficserver/bin/traffic_server(CacheVC::openWriteMain(int, Event*)+0x5b6)[0x7f49664c3be6]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f4966255cc8]
/opt/trafficserver/bin/traffic_server(CacheVC::callcont(int)+0x106)[0x7f49664ba066]
/opt/trafficserver/bin/traffic_server(Cache::open_write(Continuation*, INK_MD5*, CacheFragType, int, long, char*, int)+0x594)[0x7f49664c5334]
/opt/trafficserver/bin/traffic_server(CacheProcessor::open_write(Continuation*, INK_MD5*, CacheFragType, int, int, long, char*, int)+0x124)[0x7f496627b214]
/opt/trafficserver/bin/traffic_server(INKCacheWrite+0x1c9)[0x7f4966273509]
/opt/trafficserver/bin/traffic_server(RegressionTest_SDK_API_INKCache(RegressionTest*, int, int*)+0x327)[0x7f4966288147]
/opt/trafficserver/bin/traffic_server(+0x437aad)[0x7f4966537aad]
/opt/trafficserver/bin/traffic_server(RegressionTest::run(char*)+0xa5)[0x7f49665379d5]
/opt/trafficserver/bin/traffic_server(RegressionCont::mainEvent(int, Event*)+0xb6)[0x7f49662b0d16]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f4966255cc8]
/opt/trafficserver/bin/traffic_server(EThread::process_event(Event*, int)+0x171)[0x7f4966516311]
/opt/trafficserver/bin/traffic_server(EThread::execute()+0x27f)[0x7f496651676f]
/opt/trafficserver/bin/traffic_server(main+0x194e)[0x7f49662aa97e]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f4963b9ec4d]
/opt/trafficserver/bin/traffic_server(+0x12ead9)[0x7f496622ead9]




> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Galić updated TS-427:
--------------------------

    Attachment: ats_clang_stuck.strace

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.1.3
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903639#action_12903639 ] 

Igor Galić commented on TS-427:
-------------------------------

The stuff with templates:

make[1]: Entering directory `/home/i.galic/Projects/asf/trafficserver/librecords'
clang -DHAVE_CONFIG_H -DREC_BUILD_MGMT2 -I. -I../libinktomi++ -I../librecords -I../iocore/eventsystem -I../iocore/net -I../iocore/cache -I../iocore/aio -I../iocore/utils -I../iocore/cluster -I../iocore/dns -I../iocore/hostdb -I../proxy/mgmt2 -I../proxy/mgmt2/cluster -I../proxy/mgmt2/snmp -I../proxy/mgmt2/web2 -I../proxy/mgmt2/api2/include -I../proxy/mgmt2/utils -I../proxy/http2 -I../proxy/hdrs -I../proxy -I../libinktomi++ -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 -D_GNU_SOURCE -D_REENTRANT -Dlinux -I/usr/include/tcl8.5 -DPROCESS_MANAGER -fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2 -g -pipe -Wall -Werror -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof -MT librecprocess_a-RecProcess.o -MD -MP -MF .deps/librecprocess_a-RecProcess.Tpo -c -o librecprocess_a-RecProcess.o `test -f 'RecProcess.cc' || echo './'`RecProcess.cc
In file included from RecProcess.cc:24:
In file included from ../libinktomi++/inktomi++.h:86:
In file included from ../libinktomi++/DAllocator.h:44:
../libinktomi++/List.h:245:16: error: use of undeclared identifier 'prev'
    tail = (C*)prev(e);
               ^
               this->
In file included from RecProcess.cc:26:
In file included from ../iocore/eventsystem/P_EventSystem.h:41:
In file included from ../iocore/eventsystem/I_EventSystem.h:37:
In file included from ../iocore/eventsystem/I_EThread.h:30:
../iocore/eventsystem/I_PriorityEventQueue.h:98:23: note: in instantiation of member function 'Queue<class Event, class Event::Link_link>::remove' requested here
    after[e->in_heap].remove(e);
                      ^
In file included from RecProcess.cc:24:
In file included from ../libinktomi++/inktomi++.h:86:
In file included from ../libinktomi++/DAllocator.h:44:
../libinktomi++/List.h:150:7: note: must qualify identifier to find this declaration in dependent base class
  C *&prev(C *e) { return *(C**)&L::prev_link(e); }
      ^
3 diagnostics generated.
make[1]: *** [librecprocess_a-RecProcess.o] Error 1


is explained here: http://www.parashift.com/c++-faq-lite/templates.html#faq-35.19

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.1.3
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.patch
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Galić updated TS-427:
--------------------------

    Comment: was deleted

(was: I have confirmed the segmentation fault with GCC on trafficserver trunk with --enable-debug, so I guess I can exclude my patchset as suspect, also, this should probably be a separate defect?

root@phoenix:~# /opt/ats-vanilla-gcc/bin/traffic_server -R 1
Layout configuration
          --prefix = '/opt/ats-vanilla-gcc'
     --exec_prefix = '/opt/ats-vanilla-gcc'
          --bindir = '/opt/ats-vanilla-gcc/bin'
         --sbindir = '/opt/ats-vanilla-gcc/sbin'
      --sysconfdir = '/etc/opt/ats-vanilla-gcc'
         --datadir = '/opt/ats-vanilla-gcc/share'
      --includedir = '/opt/ats-vanilla-gcc/include'
          --libdir = '/opt/ats-vanilla-gcc/lib'
      --libexecdir = '/opt/ats-vanilla-gcc/libexec'
   --localstatedir = '/var/opt/ats-vanilla-gcc'
  --sharedstatedir = '/opt/ats-vanilla-gcc'
      --runtimedir = '/var/opt/ats-vanilla-gcc/run'
          --logdir = '/var/opt/ats-vanilla-gcc/logs'
          --mandir = '/opt/ats-vanilla-gcc/man'
         --infodir = '/opt/ats-vanilla-gcc/info'
        --cachedir = '/var/opt/ats-vanilla-gcc/cache'
[TrafficServer] using root directory '/opt/ats-vanilla-gcc'
[Aug 28 16:42:57.423] {140617315079968} STATUS: opened /var/opt/ats-vanilla-gcc/logs/diags.log
[Aug 28 16:42:57.777] Server {140617315079968} ERROR: Could not bind or listen to port 8080 (error: -1)
[Aug 28 16:42:57.779] Server {140617191810832} FATAL: <HttpAccept.cc:98 (mainEvent)> HTTP accept received fatal error: errno = 9
FATAL: UnixUDPNet.cc:295: failed assert `event != NULL`
/opt/ats-vanilla-gcc/bin/traffic_server - STACK TRACE: 
NOTE: Traffic Server received Sig 11: Segmentation fault
/opt/ats-vanilla-gcc/bin/traffic_server - STACK TRACE: 
/opt/ats-vanilla-gcc/bin/traffic_server(ink_fatal_va+0xd4)[0x7fe4055cec18]
/opt/ats-vanilla-gcc/bin/traffic_server(ink_fatal+0xc9)[0x7fe4055ced04]
/opt/ats-vanilla-gcc/bin/traffic_server(_ink_assert+0xd1)[0x7fe4055cddb1]
/opt/ats-vanilla-gcc/bin/traffic_server(_ZN19UDPReadContinuationD1Ev+0x46)[0x7fe4055a4fb0]
/opt/ats-vanilla-gcc/bin/traffic_server(_ZN14ClassAllocatorI19UDPReadContinuationE6_protoD1Ev+0x18)[0x7fe4055abe4e]
/opt/ats-vanilla-gcc/bin/traffic_server(_ZN14ClassAllocatorI19UDPReadContinuationED1Ev+0x1c)[0x7fe4055ac55a]
/opt/ats-vanilla-gcc/bin/traffic_server(+0x1b0082)[0x7fe4053b1082]
/lib/libc.so.6(exit+0xe2)[0x7fe402cba262]
/lib/libpthread.so.0(+0xf8f0)[0x7fe404dd08f0]
/opt/ats-vanilla-gcc/bin/traffic_server(+0x136cb9)[0x[0xffffffff7fe405337cb9]
]
Segmentation fault (core dumped)


Produced with:

CC="gcc"; export CC
CXX="g++"; export CXX
CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
"./configure" \
"--prefix=/opt/ats-vanilla-gcc" \
"--enable-layout=opt" \
"--with-user=proxy" \
"--with-group=proxy" \
"--enable-debug" \
"CC=$CC" \
"CXX=$CXX" \
"CFLAGS=$CFLAGS" \
"CXXFLAGS=$CFLAGS" \
"LDFLAGS=$LDFLAGS" \
"$@"

Once the regression test on the clang patchset is done, I'll test for the abort() -- then run the regression test with GCC compiled clang-patchset.)

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903678#action_12903678 ] 

Igor Galić commented on TS-427:
-------------------------------

error: address of register variable requested
num_chars channot be a register variable anymore -> http://stackoverflow.com/questions/1256246/address-of-register-variable

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.1.3
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.patch
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918414#action_12918414 ] 

John Plevyak commented on TS-427:
---------------------------------

I have gotten 2 patches from the clang team (thanx!) but I have another in the pipe:

http://llvm.org/bugs/show_bug.cgi?id=8310



> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Galić updated TS-427:
--------------------------

    Attachment: ats.clang.patch

This is the current state. It compiles and runs.. oh well.. almost:
CC="/opt/bw/bin/clang"; export CC
CXX="/opt/bw/bin/clang++"; export CXX
LD="/opt/bw/bin/clang++"; export LD
CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
CXXFLAGS="-x c++ -fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
"./configure" \
"--enable-layout=opt" \
"--with-user=proxy" \
"--with-group=proxy" \
"--enable-debug"

This will get us through the compile, but when running the regression test, and port 8080 is busy, we will segfault:
root@phoenix:~# /opt/trafficserver/bin/traffic_server -R 1
Layout configuration
          --prefix = '/opt/trafficserver'
     --exec_prefix = '/opt/trafficserver'
          --bindir = '/opt/trafficserver/bin'
         --sbindir = '/opt/trafficserver/sbin'
      --sysconfdir = '/etc/opt/trafficserver'
         --datadir = '/opt/trafficserver/share'
      --includedir = '/opt/trafficserver/include'
          --libdir = '/opt/trafficserver/lib'
      --libexecdir = '/opt/trafficserver/libexec'
   --localstatedir = '/var/opt/trafficserver'
  --sharedstatedir = '/opt/trafficserver'
      --runtimedir = '/var/opt/trafficserver/run'
          --logdir = '/var/opt/trafficserver/logs'
          --mandir = '/opt/trafficserver/man'
         --infodir = '/opt/trafficserver/info'
        --cachedir = '/var/opt/trafficserver/cache'
[TrafficServer] using root directory '/opt/trafficserver'
[Aug 28 15:15:29.056] {139700967716640} STATUS: opened /var/opt/trafficserver/logs/diags.log
[Aug 28 15:15:29.235] Server {139700967716640} ERROR: Could not bind or listen to port 8080 (error: -1)
[Aug 28 15:15:29.237] Server {139700771809040} FATAL: <HttpAccept.cc:98 (mainEvent)> HTTP accept received fatal error: errno = 9
FATAL: UnixUDPNet.cc:295: failed assert `event != NULL`
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7f0eaad33711]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7f0eaad33880]
NOTE: Traffic Server received Sig 11: Segmentation fault
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7f0eaad328d2]
/opt/trafficserver/bin/traffic_server(_ZN19UDPReadContinuationD1Ev+0x50)[0x7f0eaad06530]
/opt/trafficserver/bin/traffic_server(_ZN14ClassAllocatorI19UDPReadContinuationE6_protoD2Ev+0x15)[0x7f0eaad0d085]
/opt/trafficserver/bin/traffic_server(+0x1d2e02)[0x7f0eaaae1e02]
/lib/libpthread.so.0(+0xf8f0)[0x7f0ea9e0a8f0]
[0xffffffff]
Segmentation fault (core dumped)


When the port is not busy, it fails a certain test with abort:
[SDK_API_INKContDataGet] INKContDataGet : [TestCase1] <<PASS>> { ok }
FATAL: ./P_CacheInternal.h:617: failed assert `!part || this_ethread() != part->mutex->thread_holding`
/opt/trafficserver/bin/traffic_server - STACK TRACE: 
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7f29fdf0a711]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7f29fdf0a880]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7f29fdf098d2]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC8callcontEi+0x8a)[0x7f29fdea43da]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC21openReadStartEarliestEiP5Event+0xe37)[0x7f29fdea1c27]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC14handleReadDoneEiP5Event+0xc67)[0x7f29fde78557]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC21openReadStartEarliestEiP5Event+0xd27)[0x7f29fdea1b17]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18openReadFromWriterEiP5Event+0x1840)[0x7f29fde9efb0]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN5Cache9open_readEP12ContinuationP7INK_MD513CacheFragTypePci+0x589)[0x7f29fde9c439]
/opt/trafficserver/bin/traffic_server(_ZN14CacheProcessor9open_readEP12ContinuationP7INK_MD513CacheFragTypePci+0xbc)[0x7f29fdc6131c]
/opt/trafficserver/bin/traffic_server(INKCacheRead+0x1a6)[0x7f29fdc594e6]
/opt/trafficserver/bin/traffic_server(_Z13cache_handlerPv8INKEventS_+0x1679)[0x7f29fdc6d069]
/opt/trafficserver/bin/traffic_server(_ZN15INKContInternal12handle_eventEiPv+0xe5)[0x7f29fdc47bf5]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC8calluserEi+0xb6)[0x7f29fdea4536]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC13openWriteMainEiP5Event+0x117)[0x7f29fdead867]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18openWriteWriteDoneEiP5Event+0x609)[0x7f29fdead729]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC15handleWriteLockEiP5Event+0x16a)[0x7f29fde94dda]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18do_write_lock_callEv+0xae)[0x7f29fdeb073e]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC13openWriteMainEiP5Event+0x5b6)[0x7f29fdeadd06]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18openWriteWriteDoneEiP5Event+0x609)[0x7f29fdead729]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC15handleWriteLockEiP5Event+0x16a)[0x7f29fde94dda]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC18do_write_lock_callEv+0xae)[0x7f29fdeb073e]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC13openWriteMainEiP5Event+0x5b6)[0x7f29fdeadd06]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7CacheVC8callcontEi+0x11c)[0x7f29fdea446c]
/opt/trafficserver/bin/traffic_server(_ZN5Cache10open_writeEP12ContinuationP7INK_MD513CacheFragTypeilPci+0x594)[0x7f29fdeaf454]
/opt/trafficserver/bin/traffic_server(_ZN14CacheProcessor10open_writeEP12ContinuationP7INK_MD513CacheFragTypeiilPci+0x124)[0x7f29fdc61454]
/opt/trafficserver/bin/traffic_server(INKCacheWrite+0x1c9)[0x7f29fdc59709]
/opt/trafficserver/bin/traffic_server(_Z31RegressionTest_SDK_API_INKCacheP14RegressionTestiPi+0x327)[0x7f29fdc6e3b7]
/opt/trafficserver/bin/traffic_server(+0x43b82d)[0x7f29fdf2182d]
/opt/trafficserver/bin/traffic_server(_ZN14RegressionTest3runEPc+0xa5)[0x7f29fdf21755]
/opt/trafficserver/bin/traffic_server(_ZN14RegressionCont9mainEventEiP5Event+0xb8)[0x7f29fdc970f8]
/opt/trafficserver/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x78)[0x7f29fdc3bfb8]
/opt/trafficserver/bin/traffic_server(_ZN7EThread13process_eventEP5Eventi+0x171)[0x7f29fdefff41]
/opt/trafficserver/bin/traffic_server(_ZN7EThread7executeEv+0x282)[0x7f29fdf003a2]
/opt/trafficserver/bin/traffic_server(main+0x1a0d)[0x7f29fdc90cad]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f29fb584c4d]
/opt/trafficserver/bin/traffic_server(+0x12f0f9)[0x7f29fdc150f9]
Aborted

I guess I'll have to look into those cases closer.

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.1.3
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.compile.patch, ats.clang.patch, ats.clang.patch
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910842#action_12910842 ] 

John Plevyak commented on TS-427:
---------------------------------

There is a bug in clang.

Here is the code:

Action *
Cache::open_read(Continuation * cont, CacheKey * key, CacheFragType type, char *hostname, int host_len)
{
  if (!CACHE_READY(type)) {
    cont->handleEvent(CACHE_EVENT_OPEN_READ_FAILED, (void *) -ECACHE_NOT_READY);
    return ACTION_RESULT_DONE;
  }
  ink_assert(caches[type] == this);

  Part *part = key_to_part(key, hostname, host_len);
  Dir result, *last_collision = NULL;
  ProxyMutex *mutex = cont->mutex;
  OpenDirEntry *od = NULL;
  CacheVC *c = NULL;
  {
    CACHE_TRY_LOCK(lock, part->mutex, mutex->thread_holding);
    if (!lock || (od = part->open_read(key)) || dir_probe(key, part, &result, &last_collision)) {
      c = new_CacheVC(cont);
      SET_CONTINUATION_HANDLER(c, &CacheVC::openReadStartHead);
      c->vio.op = VIO::READ;
      c->base_stat = cache_read_active_stat;
      CACHE_INCREMENT_DYN_STAT(c->base_stat + CACHE_STAT_ACTIVE);
      c->first_key = c->key = c->earliest_key = *key;
      c->part = part;
      c->frag_type = type;
      c->od = od;
    }
    if (!c)
      goto Lmiss;
    if (!lock) {
      CONT_SCHED_LOCK_RETRY(c);
      return &c->_action;
    }
    if (c->od)
      goto Lwriter;
    c->dir = result;
    c->last_collision = last_collision;
    switch(c->do_read_call(&c->key)) {
      case EVENT_DONE: return ACTION_RESULT_DONE;
      case EVENT_RETURN: goto Lcallreturn;
      default: return &c->_action;
    }
  }
Lmiss:
  CACHE_INCREMENT_DYN_STAT(cache_read_failure_stat);
  cont->handleEvent(CACHE_EVENT_OPEN_READ_FAILED, (void *) -ECACHE_NO_DOC);
  return ACTION_RESULT_DONE;
Lwriter:
  SET_CONTINUATION_HANDLER(c, &CacheVC::openReadFromWriter);
  if (c->handleEvent(EVENT_IMMEDIATE, 0) == EVENT_DONE)
    return ACTION_RESULT_DONE;
  return &c->_action;
Lcallreturn:
  if (c->handleEvent(AIO_EVENT_DONE, 0) == EVENT_DONE)
    return ACTION_RESULT_DONE;
  return &c->_action;
}


The stack trace says that we are in a call at

  SET_CONTINUATION_HANDLER(c, &CacheVC::openReadFromWriter);
  if (c->handleEvent(EVENT_IMMEDIATE, 0) == EVENT_DONE)                         <<<<<<<<<<<<<<<<<<<<<<<< HERE
    return ACTION_RESULT_DONE;
  return &c->_action;


But that the destructor for the object created at:

    CACHE_TRY_LOCK(lock, part->mutex, mutex->thread_holding);  <<<<<<<<<<<<<<<<<<<<<<<< HERE

is not getting called.

That object is a MutexTryLock.

The assembly code makes this clear.  That code is attached at the bottom, but the critical bits
are this call path:

1) openReadFromWriter is only accessible from LBB21_53
2) which is only accessible from LBB21_30
3) which must pass through the setting of the OpenReadStartHead via SET_CONTINUATION_HANDLER
     which is in the liveness block of 'lock'
4) ~MutexTryLock does not appear along this path

There are 2 instances of the destructor (~MutexTryLock()) being called, one below LBB21_39 which is in the path
after the (inlined) do_read_call()  and the other is in the exception block at the end of the function.

I have tried to make a smaller test case, to no avail.  I am not sure what the trigger is.


	.text
	.globl	Cache::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int)
	.align	16, 0x90
	.type	Cache::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int),@function
Cache::open_read(Continuation*, INK_MD5*, CacheFragType, char*, int):
.Leh_func_begin21:
.Lfunc_begin21:
.Ltmp434:
	pushq	%rbp
.Ltmp431:
	movq	%rsp, %rbp
.Ltmp432:
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
.Ltmp433:
	movl	%r9d, %ebx
.Ltmp435:
	movq	%r8, %r14
.Ltmp436:
.Ltmp437:
	movq	%rdx, %r15
.Ltmp438:
.Ltmp439:
.Ltmp440:
.Ltmp441:
	movq	CacheProcessor::cache_ready@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	btl	%ecx, %eax
	movq	%rsi, -88(%rbp)
	jb	.LBB21_4
.Ltmp442:
.Ltmp443:
.Ltmp444:
.Ltmp445:
	movq	%rsi, %rdi
	movq	8(%rdi), %r14
	addq	16(%rdi), %rdi
	movq	%rdi, -88(%rbp)
	testb	$1, %r14b
	je	.LBB21_3
	movq	-88(%rbp), %rdi
	movq	(%rdi), %r15
	movq	-1(%r14,%r15), %r14
.LBB21_3:
	movl	$1103, %esi
	movq	$-20407, %rdx
	movq	-88(%rbp), %rdi
	callq	*%r14
	jmp	.LBB21_51
.LBB21_4:
	movl	%ecx, %eax
	movl	%eax, -116(%rbp)
	movq	%rdi, %r12
.Ltmp446:
.Ltmp447:
	movl	%eax, %eax
	movq	caches@GOTPCREL(%rip), %rcx
	cmpq	%r12, (%rcx,%rax,8)
	je	.LBB21_6
	leaq	.L.str(%rip), %rdi
	leaq	.L.str1(%rip), %rsi
	movl	$39, %edx
	callq	_ink_assert@PLT
.LBB21_6:
	movl	%ebx, %ecx
	movq	%r14, %rdx
.Ltmp448:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	Cache::key_to_part(INK_MD5*, char*, int)@PLT
	movq	%rax, -96(%rbp)
	movw	$0, -48(%rbp)
	movq	$0, -56(%rbp)
.Ltmp449:
	movq	$0, -64(%rbp)
.Ltmp450:
	movq	32(%rax), %r8
.Ltmp451:
.Ltmp452:
.Ltmp453:
.Ltmp454:
.Ltmp455:
.Ltmp456:
.Ltmp457:
.Ltmp458:
.Ltmp459:
.Ltmp460:
.Ltmp461:
.Ltmp462:
	movq	-88(%rbp), %rdi
	movq	32(%rdi), %rax
.Ltmp463:
.Ltmp464:
	movq	%rax, -104(%rbp)
	movq	56(%rax), %r9
	leaq	-80(%rbp), %rdi
.Ltmp465:
.Ltmp466:
.Ltmp467:
.Ltmp468:
.Ltmp469:
.Ltmp470:
.Ltmp471:
.Ltmp472:
	leaq	.L.str1(%rip), %rsi
	movl	$47, %edx
	movq	$0, -112(%rbp)
	xorl	%ecx, %ecx
	callq	MutexTryLock::MutexTryLock(char const*, int, char const*, ProxyMutex*, EThread*)@PLT
	testb	$1, -72(%rbp)
	je	.LBB21_12
.Ltmp473:
.Ltmp474:
.Ltmp475:
.Ltmp409:
.Ltmp476:
	movq	-96(%rbp), %rax
	leaq	464(%rax), %rdi
	movq	%r15, %rsi
	callq	OpenDir::open_read(INK_MD5*)@PLT
.Ltmp410:
.Ltmp477:
.Ltmp478:
	testq	%rax, %rax
	je	.LBB21_10
	movq	%rax, -112(%rbp)
	jmp	.LBB21_12
.LBB21_10:
.Ltmp411:
	leaq	-56(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	movq	%r15, %rdi
	movq	-96(%rbp), %rsi
	callq	dir_probe(INK_MD5*, Part*, Dir*, Dir**)@PLT
.Ltmp412:
	testl	%eax, %eax
	je	.LBB21_40
.LBB21_12:
.Ltmp479:
.Ltmp413:
	movq	-88(%rbp), %rdi
	callq	new_CacheVC(Continuation*)@PLT
.Ltmp414:
	movq	%rax, %rbx
.Ltmp480:
	movq	CacheVC::openReadStartHead(int, Event*)@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movq	$0, 16(%rbx)
	leaq	.L.str2(%rip), %rax
	movq	%rax, 24(%rbx)
.Ltmp481:
	movl	$1, 640(%rbx)
.Ltmp482:
	movl	$13, 856(%rbx)
.Ltmp483:
	movq	cache_rsb@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	-104(%rbp), %rax
	movq	56(%rax), %r12
.Ltmp484:
	cmpl	$13, 20(%r14)
.Ltmp485:
.Ltmp486:
.Ltmp487:
.Ltmp488:
.Ltmp489:
.Ltmp490:
.Ltmp491:
.Ltmp492:
	jg	.LBB21_15
.Ltmp415:
	leaq	.L.str93(%rip), %rdi
	leaq	.L.str94(%rip), %rsi
	movl	$115, %edx
	callq	_ink_assert@PLT
.Ltmp416:
.LBB21_15:
.Ltmp493:
	testq	%r12, %r12
	jne	.LBB21_17
.Ltmp494:
	movq	Thread::thread_data_key@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
.Ltmp495:
.Ltmp496:
	callq	pthread_getspecific@PLT
.Ltmp497:
.Ltmp498:
	movq	%rax, %r12
.LBB21_17:
.Ltmp499:
	movq	(%r14), %rax
.Ltmp500:
.Ltmp501:
	incq	416(%rax,%r12)
.Ltmp502:
	incq	424(%rax,%r12)
.Ltmp503:
.Ltmp504:
	movq	-96(%rbp), %rax
	movq	4688(%rax), %rax
	movq	48(%rax), %r14
	movq	-104(%rbp), %rax
	movq	56(%rax), %r12
.Ltmp505:
	movslq	856(%rbx), %r13
	testq	%r13, %r13
.Ltmp506:
.Ltmp507:
.Ltmp508:
.Ltmp509:
.Ltmp510:
.Ltmp511:
	js	.LBB21_19
.Ltmp512:
	cmpl	%r13d, 20(%r14)
	jg	.LBB21_20
.LBB21_19:
.Ltmp417:
	leaq	.L.str93(%rip), %rdi
	leaq	.L.str94(%rip), %rsi
	movl	$115, %edx
	callq	_ink_assert@PLT
.Ltmp418:
.LBB21_20:
.Ltmp513:
	testq	%r12, %r12
	jne	.LBB21_22
.Ltmp514:
	movq	Thread::thread_data_key@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
.Ltmp515:
.Ltmp516:
	callq	pthread_getspecific@PLT
.Ltmp517:
.Ltmp518:
	movq	%rax, %r12
.LBB21_22:
	addq	(%r14), %r12
.Ltmp519:
.Ltmp520:
	shlq	$5, %r13
	incq	(%r13,%r12)
.Ltmp521:
	incq	8(%r13,%r12)
.Ltmp522:
	movq	(%r15), %rax
	movq	%rax, 96(%rbx)
	movq	8(%r15), %rax
	movq	%rax, 104(%rbx)
.Ltmp523:
	movq	(%r15), %rax
	movq	%rax, 64(%rbx)
	movq	8(%r15), %rax
	movq	%rax, 72(%rbx)
.Ltmp524:
	movq	(%r15), %rax
	movq	%rax, 80(%rbx)
	movq	8(%r15), %rax
	movq	%rax, 88(%rbx)
.Ltmp525:
.Ltmp526:
	movq	-96(%rbp), %rax
	movq	%rax, 792(%rbx)
.Ltmp527:
	movl	-116(%rbp), %ecx
	movl	%ecx, 696(%rbx)
.Ltmp528:
	movq	-112(%rbp), %rax
	movq	%rax, 400(%rbx)
	testq	%rbx, %rbx
	je	.LBB21_40
	testb	$1, -72(%rbp)
.Ltmp529:
.Ltmp530:
.Ltmp531:
	jne	.LBB21_30
	movq	32(%rbx), %rax
.Ltmp532:
	movq	56(%rax), %r14
.Ltmp533:
.Ltmp534:
	movq	2560(%r14), %rax
.Ltmp535:
.Ltmp536:
.Ltmp537:
.Ltmp538:
.Ltmp539:
.Ltmp540:
	testq	%rax, %rax
	je	.LBB21_26
.Ltmp541:
	movq	(%rax), %rcx
	movq	%rcx, 2560(%r14)
.Ltmp542:
	decl	2552(%r14)
.Ltmp543:
	movq	eventAllocator@GOTPCREL(%rip), %rcx
	movq	48(%rcx), %rcx
	movq	%rcx, (%rax)
	jmp	.LBB21_28
.LBB21_26:
.Ltmp544:
.Ltmp422:
	movq	eventAllocator@GOTPCREL(%rip), %rdi
	callq	ink_freelist_new@PLT
.Ltmp423:
.Ltmp545:
.Ltmp546:
.Ltmp547:
	movq	eventAllocator@GOTPCREL(%rip), %rcx
	movq	48(%rcx), %rdx
	movq	%rdx, (%rax)
	movq	56(%rcx), %rdx
	movq	%rdx, 8(%rax)
	movq	64(%rcx), %rdx
	movq	%rdx, 16(%rax)
	movq	72(%rcx), %rdx
	movq	%rdx, 24(%rax)
	movq	80(%rcx), %rdx
	movq	%rdx, 32(%rax)
	movq	88(%rcx), %rdx
	movq	%rdx, 40(%rax)
	movq	96(%rcx), %rdx
	movq	%rdx, 48(%rax)
	movq	104(%rcx), %rdx
	movq	%rdx, 56(%rax)
	movq	112(%rcx), %rdx
	movq	%rdx, 64(%rax)
	movq	120(%rcx), %rdx
	movq	%rdx, 72(%rax)
	movq	128(%rcx), %rdx
	movq	%rdx, 80(%rax)
	movq	136(%rcx), %rcx
	movq	%rcx, 88(%rax)
.Ltmp548:
.LBB21_28:
.Ltmp549:
	movl	$2, 44(%rax)
.Ltmp550:
.Ltmp551:
	movq	$0, 64(%rax)
.Ltmp552:
	movq	Thread::cur_time@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
.Ltmp553:
	movq	%rbx, 8(%rax)
.Ltmp554:
.Ltmp555:
	addq	$20000000, %rcx
.Ltmp556:
	movq	%rcx, 48(%rax)
.Ltmp557:
	movq	$0, 56(%rax)
.Ltmp558:
	movl	40(%rax), %edx
	andl	$-5, %edx
.Ltmp559:
.Ltmp560:
	testq	%rcx, %rcx
	sete	%cl
.Ltmp561:
	movzbl	%cl, %ecx
	shll	$2, %ecx
.Ltmp562:
.Ltmp563:
.Ltmp564:
.Ltmp565:
	addl	%edx, %ecx
	movl	%ecx, 40(%rax)
.Ltmp566:
	movl	$0, 24(%rax)
.Ltmp424:
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	EThread::schedule_local(Event*)@PLT
.Ltmp425:
.Ltmp567:
.LBB21_29:
.Ltmp568:
	addq	$168, %rbx
	jmp	.LBB21_39
.Ltmp569:
.LBB21_30:
.Ltmp570:
	cmpq	$0, -112(%rbp)
	jne	.LBB21_53
.Ltmp571:
	movw	-48(%rbp), %ax
	movw	%ax, 136(%rbx)
	movq	-56(%rbp), %rax
	movq	%rax, 128(%rbx)
.Ltmp572:
	movq	-64(%rbp), %rax
	movq	%rax, 800(%rbx)
.Ltmp573:
.Ltmp574:
.Ltmp575:
	movq	$0, 904(%rbx)
.Ltmp576:
.Ltmp577:
	leaq	64(%rbx), %rax
.Ltmp578:
	movq	%rax, 816(%rbx)
.Ltmp579:
	movzwl	130(%rbx), %eax
	movl	%eax, %ecx
	shrl	$8, %ecx
	andl	$3, %ecx
	leal	(%rcx,%rcx,2), %ecx
	movl	$512, %edx
	shll	%cl, %edx
	shrl	$10, %eax
	incl	%eax
	imull	%edx, %eax
	movq	%rax, 480(%rbx)
.Ltmp580:
	movq	8(%rbx), %rax
	movq	16(%rbx), %rcx
	testq	%rcx, %rcx
	setne	%dl
	testq	%rax, %rax
	setne	%sil
	cmpq	CacheVC::dead(int, Event*)@GOTPCREL(%rip), %rax
	jne	.LBB21_35
	andb	%dl, %sil
	cmpb	$1, %sil
	je	.LBB21_35
.Ltmp426:
	leaq	.L.str58(%rip), %rdi
	leaq	.L.str59(%rip), %rsi
	movl	$635, %edx
	callq	_ink_assert@PLT
.Ltmp427:
	movq	8(%rbx), %rax
	movq	16(%rbx), %rcx
.LBB21_35:
	movq	%rax, 824(%rbx)
	movq	%rcx, 832(%rbx)
	movq	CacheVC::handleRead(int, Event*)@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	movq	$0, 16(%rbx)
.Ltmp428:
	movl	$4, %esi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	callq	CacheVC::handleRead(int, Event*)@PLT
.Ltmp429:
.Ltmp581:
.Ltmp582:
	cmpl	$5, %eax
	je	.LBB21_56
	testl	%eax, %eax
	jne	.LBB21_29
	movl	$3, %ebx
.LBB21_39:
	leaq	-80(%rbp), %rdi
	callq	MutexTryLock::~MutexTryLock()@PLT
.Ltmp583:
.Ltmp584:
	movq	%rbx, %rax
	jmp	.LBB21_52
.LBB21_40:
.Ltmp585:
	movq	cache_rsb@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rbx
	movq	-104(%rbp), %rax
	movq	56(%rax), %r14
.Ltmp586:
	cmpl	$15, 20(%rbx)
.Ltmp587:
.Ltmp588:
.Ltmp589:
.Ltmp590:
.Ltmp591:
.Ltmp592:
.Ltmp593:
.Ltmp594:
	jg	.LBB21_42
.Ltmp595:
	leaq	.L.str93(%rip), %rdi
	leaq	.L.str94(%rip), %rsi
	movl	$115, %edx
	callq	_ink_assert@PLT
.LBB21_42:
.Ltmp596:
	testq	%r14, %r14
	jne	.LBB21_44
.Ltmp597:
	movq	Thread::thread_data_key@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
.Ltmp598:
.Ltmp599:
	callq	pthread_getspecific@PLT
.Ltmp600:
.Ltmp601:
	movq	%rax, %r14
.LBB21_44:
.Ltmp602:
	movq	(%rbx), %rbx
.Ltmp603:
.Ltmp604:
	incq	480(%rbx,%r14)
.Ltmp605:
	incq	488(%rbx,%r14)
.Ltmp606:
.Ltmp607:
	movq	-96(%rbp), %rax
	movq	4688(%rax), %rbx
	movq	48(%rbx), %rbx
	movq	-104(%rbp), %rax
	movq	56(%rax), %r14
.Ltmp608:
	cmpl	$15, 20(%rbx)
.Ltmp609:
.Ltmp610:
.Ltmp611:
.Ltmp612:
.Ltmp613:
.Ltmp614:
.Ltmp615:
.Ltmp616:
	jg	.LBB21_46
.Ltmp617:
	leaq	.L.str93(%rip), %rdi
	leaq	.L.str94(%rip), %rsi
	movl	$115, %edx
	callq	_ink_assert@PLT
.LBB21_46:
.Ltmp618:
	testq	%r14, %r14
	jne	.LBB21_48
.Ltmp619:
	movq	Thread::thread_data_key@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
.Ltmp620:
.Ltmp621:
	callq	pthread_getspecific@PLT
.Ltmp622:
.Ltmp623:
	movq	%rax, %r14
.LBB21_48:
.Ltmp624:
	movq	(%rbx), %rbx
.Ltmp625:
.Ltmp626:
	incq	480(%rbx,%r14)
.Ltmp627:
	incq	488(%rbx,%r14)
.Ltmp628:
.Ltmp629:
.Ltmp630:
.Ltmp631:
.Ltmp632:
	movq	-88(%rbp), %rdi
	movq	8(%rdi), %rbx
	addq	16(%rdi), %rdi
	movq	%rdi, -88(%rbp)
	testb	$1, %bl
	je	.LBB21_50
	movq	-88(%rbp), %rdi
	movq	(%rdi), %rax
	movq	-1(%rbx,%rax), %rbx
.LBB21_50:
	movl	$1103, %esi
	movq	$-20400, %rdx
	movq	-88(%rbp), %rdi
	callq	*%rbx
.LBB21_51:
	movl	$3, %eax
.Ltmp633:
.LBB21_52:
.Ltmp634:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	ret
.LBB21_53:
.Ltmp635:
	movq	CacheVC::openReadFromWriter(int, Event*)@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
.Ltmp636:
.Ltmp637:
.Ltmp638:
.Ltmp639:
	movq	$0, 16(%rbx)
	leaq	.L.str3(%rip), %rax
	movq	%rax, 24(%rbx)
	movl	$1, %esi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	callq	CacheVC::openReadFromWriter(int, Event*)@PLT
.LBB21_54:
	testl	%eax, %eax
	je	.LBB21_51
.Ltmp640:
	movq	%rbx, %rax
	addq	$168, %rax
	jmp	.LBB21_52
.LBB21_56:
.Ltmp641:
.Ltmp642:
.Ltmp643:
.Ltmp644:
	movq	8(%rbx), %rax
	movq	16(%rbx), %rdi
	addq	%rbx, %rdi
	testb	$1, %al
	je	.LBB21_58
	movq	(%rdi), %rcx
	movq	-1(%rax,%rcx), %rax
.LBB21_58:
	movl	$3900, %esi
	xorl	%edx, %edx
	callq	*%rax
	jmp	.LBB21_54
.LBB21_59:
.Ltmp419:
.Ltmp645:
.Ltmp646:
	movq	%rax, %rbx
.Ltmp420:
	leaq	-80(%rbp), %rdi
	callq	MutexTryLock::~MutexTryLock()@PLT
.Ltmp421:
.Ltmp647:
.Ltmp648:
.Ltmp649:
	movq	%rbx, %rdi
	callq	_Unwind_Resume_or_Rethrow@PLT
.LBB21_61:
.Ltmp430:
.Ltmp650:
	callq	std::terminate()@PLT
.Ltmp651:
.Ltmp652:



> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Galić updated TS-427:
--------------------------

    Comment: was deleted

(was: Regression tests:

root@phoenix:~# time /opt/ats-vanilla-gcc/bin/traffic_server -R 1 2>&1| grep -w FAIL
[SDK_API_INKfopen] mkstemp : [std func] <<FAIL>> { can't create file for writing }
[SDK_API_INKPluginDirGet] INKPluginDirGet : [TestCase2] <<FAIL>> { plugin dir(/opt/ats-vanilla-gcc/libexec) is incorrect, expected (libexec/trafficserver) in path }
[SDK_API_INKCache] INKCacheRemove : [TestCase1] <<FAIL>> { can't remove cached item }
[SDK_API_INKHttpConnectServerIntercept] INKHttpConnect : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectServerIntercept] INKHttpTxnServerIntercept : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpConnect : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpTxnIntercept : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_HttpAltInfo] INKHttpAltInfo : [All] <<FAIL>> { Test not executed even once }
[SDK_API_HttpTxnTransform] INKHttpTxnUntransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKHttpTxnTransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transformed_resp_cache }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass untransformed_resp_cache }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transform_create }
[SDK_API_HttpHookAdd] INKHttpHookAdd : [TestCase1] <<FAIL>> { Hooks not called or request failure. Hook mask = 1 }
[SDK_API_HttpHookAdd] INKHttpTxnReenable : [TestCase1] <<FAIL>> { Txn not reenabled properly }

real	1m52.899s
user	0m16.830s
sys	0m1.290s
root@phoenix:~# 


root@phoenix:~# time /opt/ats-clangpatch-gcc/bin/traffic_server -R 1  2>&1| grep -w FAIL
[SDK_API_INKfopen] mkstemp : [std func] <<FAIL>> { can't create file for writing }
[SDK_API_INKPluginDirGet] INKPluginDirGet : [TestCase2] <<FAIL>> { plugin dir(/opt/ats-clangpatch-gcc/libexec) is incorrect, expected (libexec/trafficserver) in path }
[SDK_API_INKHttpConnectServerIntercept] INKHttpConnect : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectServerIntercept] INKHttpTxnServerIntercept : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpConnect : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpTxnIntercept : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_HttpAltInfo] INKHttpAltInfo : [All] <<FAIL>> { Test not executed even once }
[SDK_API_HttpTxnTransform] INKHttpTxnUntransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKHttpTxnTransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transformed_resp_cache }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transform_create }
[SDK_API_HttpHookAdd] INKHttpHookAdd : [TestCase1] <<FAIL>> { Hooks not called or request failure. Hook mask = 1 }
[SDK_API_HttpHookAdd] INKHttpTxnReenable : [TestCase1] <<FAIL>> { Txn not reenabled properly }

real	1m46.821s
user	0m10.670s
sys	0m0.500s
root@phoenix:~# 


Now, for whatsoever reason, we run into some kind of condition in the ``Regression test(SDK_API_INKCache'', hence the Ctrl+C -- this is clang specific, just like the above abort() -- it doesn't happen with gcc, no matter the patching or the --enable-debug.

root@phoenix:~# time /opt/trafficserver/bin/traffic_server -R 1 2>&1| grep -w FAIL
[SDK_API_INKfopen] mkstemp : [std func] <<FAIL>> { can't create file for writing }
[SDK_API_INKPluginDirGet] INKPluginDirGet : [TestCase2] <<FAIL>> { plugin dir(/opt/trafficserver/libexec) is incorrect, expected (libexec/trafficserver) in path }
[SDK_API_INKHttpConnectServerIntercept] INKHttpConnect : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectServerIntercept] INKHttpTxnServerIntercept : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpConnect : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpTxnIntercept : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_HttpAltInfo] INKHttpAltInfo : [All] <<FAIL>> { Test not executed even once }
[SDK_API_HttpTxnTransform] INKHttpTxnUntransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKHttpTxnTransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transformed_resp_cache }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transform_create }
[SDK_API_HttpHookAdd] INKHttpHookAdd : [TestCase1] <<FAIL>> { Hooks not called or request failure. Hook mask = 1 }
[SDK_API_HttpHookAdd] INKHttpTxnReenable : [TestCase1] <<FAIL>> { Txn not reenabled properly }
^C

real	4m44.578s
user	0m10.780s
sys	0m0.700s
root@phoenix:~# 


The different run times of the first two are caused by the fact that one of them is compiled with --enable-debug:
-rwxr-xr-x 1 root root 108M 2010-08-28 16:12 /opt/ats-vanilla-gcc/bin/traffic_server
-rwxr-xr-x 1 root root  26M 2010-08-28 16:14 /opt/ats-clangpatch-gcc/bin/traffic_server

)

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12911004#action_12911004 ] 

Igor Galić commented on TS-427:
-------------------------------

8175 fixed in llvm r114259
In testing it, I hit, much, much later, a new assert, in gdb:



(gdb) print *d
$29 = {<Continuation> = {<force_VFPT_to_top> = {_vptr$force_VFPT_to_top = 0x7ffff8276af0}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f7c490 "&Part::aggWriteDone", mutex = {m_ptr = 0x7ffff8868380}, 
    link = {<SLink<Continuation>> = {next = 0x0}, prev = 0x0}}, path = 0x7ffff88cee80 "/var/opt/trafficserver/cache/cache.db", hash_id = 0x7ffff88ced10 "/var/opt/trafficserver/cache/cache.db 16384:9727", hash_id_md5 = {b = {
      6127868384971469622, 16013774615526535559}}, fd = 24, raw_dir = 0x7ffff88d7000 "\r\360\320\361\025", dir = 0x7ffff88d9000, header = 0x7ffff88d7000, footer = 0x7ffff88f3000, segments = 1, buckets = 2482, recover_pos = 8961024, 
  prev_recover_pos = 468992, scan_pos = 10532864, skip = 16384, start = 262144, len = 79683584, data_blocks = 9697, hit_evacuate_window = 0, io = {<AIOCallback> = {<Continuation> = {<force_VFPT_to_top> = {
          _vptr$force_VFPT_to_top = 0x7ffff8276bb0}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f77770 "&AIOCallbackInternal::io_complete", mutex = {m_ptr = 0x7ffff8868380}, link = {<SLink<Continuation>> = {
            next = 0x0}, prev = 0x0}}, aiocb = {aio_fildes = 0, aio_buf = 0x7ffff03be000, aio_nbytes = 103424, aio_offset = 572416, aio_reqprio = 0, aio_lio_opcode = 2, aio_state = 0, aio__pad = {0}}, action = {_vptr$Action = 0x0, 
        continuation = 0x7ffff88d56f0, mutex = {m_ptr = 0x7ffff8868380}, cancelled = 0}, thread = 0xffffffffffffffff, then = 0x0, aio_result = 103424}, first = 0x0, aio_req = 0x7fffec02b600, sleep_time = 0}, agg = {<DLL> = {head = 0x0}, 
    tail = 0x0}, stat_cache_vcs = {<DLL> = {head = 0x0}, tail = 0x0}, sync = {<DLL> = {head = 0x0}, tail = 0x0}, agg_buffer = 0x7ffff03be000 "\023\233\022_\204\206\001", agg_todo_size = 0, agg_buf_pos = 0, trigger = 0x0, 
  open_dir = {<Continuation> = {<force_VFPT_to_top> = {_vptr$force_VFPT_to_top = 0x7ffff8276b30}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f77d20 "&OpenDir::signal_readers", mutex = {m_ptr = 0x7ffff8868380}, 
      link = {<SLink<Continuation>> = {next = 0x0}, prev = 0x0}}, delayed_readers = {<DLL> = {head = 0x0}, tail = 0x0}, bucket = {{head = 0x0} <repeats 256 times>}}, ram_cache = 0x7fffeccca250, evacuate_size = 6, 
  evacuate = 0x7ffff88cee20, lookaside = {{head = 0x0} <repeats 256 times>}, doc_evacuator = 0x7c30f00df00d, init_info = 0x0, disk = 0x7fffec02b4a0, cache = 0x7ffff88ced70, cache_part = 0x7ffff88cea70, last_sync_serial = 4, 
  last_write_serial = 0, sector_size = 512, recover_wrapped = false, dir_sync_waiting = false, dir_sync_in_progress = false, writing_end_marker = false, first_fragment_key = {b = {0, 0}}, first_fragment_offset = 4294993844, 
  first_fragment_data = {m_ptr = 0x0}}
(gdb) print *thread
$30 = <incomplete type>
(gdb) print lock
$31 = {m = {m_ptr = 0x0}, lock_acquired = false}
(gdb) continue
Continuing.
FATAL: CacheDir.cc:1288: failed assert `lock`
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7f3aac0a1a31]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7f3aac0a1ba0]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7f3aac0a0c02]
/opt/trafficserver/bin/traffic_server(RegressionTest_Cache_dir(RegressionTest*, int, int*)+0xde)[0x7f3aac01e61e]
/opt/trafficserver/bin/traffic_server(+0x41d88d)[0x7f3aac0b888d]
/opt/trafficserver/bin/traffic_server(RegressionTest::run_some()+0x124)[0x7f3aac0b8a34]
/opt/trafficserver/bin/traffic_server(RegressionTest::check_status()+0x2f)[0x7f3aac0b8aaf]
/opt/trafficserver/bin/traffic_server(RegressionCont::mainEvent(int, Event*)+0xd4)[0x7f3aabe2d9d4]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f3aabdd6718]
/opt/trafficserver/bin/traffic_server(EThread::process_event(Event*, int)+0x171)[0x7f3aac096f91]
/opt/trafficserver/bin/traffic_server(EThread::execute()+0x27f)[0x7f3aac0973ef]
/opt/trafficserver/bin/traffic_server(main+0x1903)[0x7f3aabe278a3]
/lib/libc.so.6(__libc_start_main+0xfe)[0x7f3aa9739d8e]

Program received signal SIGABRT, Aborted.
0x00007ffff55b0ba5 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb)

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12911004#action_12911004 ] 

Igor Galić edited comment on TS-427 at 9/18/10 8:24 AM:
--------------------------------------------------------

8175 fixed in llvm r114259
In testing it, I hit, much, much later, a new assert



(gdb) print *d
$29 = {<Continuation> = {<force_VFPT_to_top> = {_vptr$force_VFPT_to_top = 0x7ffff8276af0}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f7c490 "&Part::aggWriteDone", mutex = {m_ptr = 0x7ffff8868380}, 
    link = {<SLink<Continuation>> = {next = 0x0}, prev = 0x0}}, path = 0x7ffff88cee80 "/var/opt/trafficserver/cache/cache.db", hash_id = 0x7ffff88ced10 "/var/opt/trafficserver/cache/cache.db 16384:9727", hash_id_md5 = {b = {
      6127868384971469622, 16013774615526535559}}, fd = 24, raw_dir = 0x7ffff88d7000 "\r\360\320\361\025", dir = 0x7ffff88d9000, header = 0x7ffff88d7000, footer = 0x7ffff88f3000, segments = 1, buckets = 2482, recover_pos = 8961024, 
  prev_recover_pos = 468992, scan_pos = 10532864, skip = 16384, start = 262144, len = 79683584, data_blocks = 9697, hit_evacuate_window = 0, io = {<AIOCallback> = {<Continuation> = {<force_VFPT_to_top> = {
          _vptr$force_VFPT_to_top = 0x7ffff8276bb0}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f77770 "&AIOCallbackInternal::io_complete", mutex = {m_ptr = 0x7ffff8868380}, link = {<SLink<Continuation>> = {
            next = 0x0}, prev = 0x0}}, aiocb = {aio_fildes = 0, aio_buf = 0x7ffff03be000, aio_nbytes = 103424, aio_offset = 572416, aio_reqprio = 0, aio_lio_opcode = 2, aio_state = 0, aio__pad = {0}}, action = {_vptr$Action = 0x0, 
        continuation = 0x7ffff88d56f0, mutex = {m_ptr = 0x7ffff8868380}, cancelled = 0}, thread = 0xffffffffffffffff, then = 0x0, aio_result = 103424}, first = 0x0, aio_req = 0x7fffec02b600, sleep_time = 0}, agg = {<DLL> = {head = 0x0}, 
    tail = 0x0}, stat_cache_vcs = {<DLL> = {head = 0x0}, tail = 0x0}, sync = {<DLL> = {head = 0x0}, tail = 0x0}, agg_buffer = 0x7ffff03be000 "\023\233\022_\204\206\001", agg_todo_size = 0, agg_buf_pos = 0, trigger = 0x0, 
  open_dir = {<Continuation> = {<force_VFPT_to_top> = {_vptr$force_VFPT_to_top = 0x7ffff8276b30}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f77d20 "&OpenDir::signal_readers", mutex = {m_ptr = 0x7ffff8868380}, 
      link = {<SLink<Continuation>> = {next = 0x0}, prev = 0x0}}, delayed_readers = {<DLL> = {head = 0x0}, tail = 0x0}, bucket = {{head = 0x0} <repeats 256 times>}}, ram_cache = 0x7fffeccca250, evacuate_size = 6, 
  evacuate = 0x7ffff88cee20, lookaside = {{head = 0x0} <repeats 256 times>}, doc_evacuator = 0x7c30f00df00d, init_info = 0x0, disk = 0x7fffec02b4a0, cache = 0x7ffff88ced70, cache_part = 0x7ffff88cea70, last_sync_serial = 4, 
  last_write_serial = 0, sector_size = 512, recover_wrapped = false, dir_sync_waiting = false, dir_sync_in_progress = false, writing_end_marker = false, first_fragment_key = {b = {0, 0}}, first_fragment_offset = 4294993844, 
  first_fragment_data = {m_ptr = 0x0}}
(gdb) print *thread
$30 = <incomplete type>
(gdb) print lock
$31 = {m = {m_ptr = 0x0}, lock_acquired = false}
(gdb) continue
Continuing.
FATAL: CacheDir.cc:1288: failed assert `lock`
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7f3aac0a1a31]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7f3aac0a1ba0]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7f3aac0a0c02]
/opt/trafficserver/bin/traffic_server(RegressionTest_Cache_dir(RegressionTest*, int, int*)+0xde)[0x7f3aac01e61e]
/opt/trafficserver/bin/traffic_server(+0x41d88d)[0x7f3aac0b888d]
/opt/trafficserver/bin/traffic_server(RegressionTest::run_some()+0x124)[0x7f3aac0b8a34]
/opt/trafficserver/bin/traffic_server(RegressionTest::check_status()+0x2f)[0x7f3aac0b8aaf]
/opt/trafficserver/bin/traffic_server(RegressionCont::mainEvent(int, Event*)+0xd4)[0x7f3aabe2d9d4]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f3aabdd6718]
/opt/trafficserver/bin/traffic_server(EThread::process_event(Event*, int)+0x171)[0x7f3aac096f91]
/opt/trafficserver/bin/traffic_server(EThread::execute()+0x27f)[0x7f3aac0973ef]
/opt/trafficserver/bin/traffic_server(main+0x1903)[0x7f3aabe278a3]
/lib/libc.so.6(__libc_start_main+0xfe)[0x7f3aa9739d8e]

Program received signal SIGABRT, Aborted.
0x00007ffff55b0ba5 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb)

      was (Author: i.galic):
    8175 fixed in llvm r114259
In testing it, I hit, much, much later, a new assert, in gdb:



(gdb) print *d
$29 = {<Continuation> = {<force_VFPT_to_top> = {_vptr$force_VFPT_to_top = 0x7ffff8276af0}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f7c490 "&Part::aggWriteDone", mutex = {m_ptr = 0x7ffff8868380}, 
    link = {<SLink<Continuation>> = {next = 0x0}, prev = 0x0}}, path = 0x7ffff88cee80 "/var/opt/trafficserver/cache/cache.db", hash_id = 0x7ffff88ced10 "/var/opt/trafficserver/cache/cache.db 16384:9727", hash_id_md5 = {b = {
      6127868384971469622, 16013774615526535559}}, fd = 24, raw_dir = 0x7ffff88d7000 "\r\360\320\361\025", dir = 0x7ffff88d9000, header = 0x7ffff88d7000, footer = 0x7ffff88f3000, segments = 1, buckets = 2482, recover_pos = 8961024, 
  prev_recover_pos = 468992, scan_pos = 10532864, skip = 16384, start = 262144, len = 79683584, data_blocks = 9697, hit_evacuate_window = 0, io = {<AIOCallback> = {<Continuation> = {<force_VFPT_to_top> = {
          _vptr$force_VFPT_to_top = 0x7ffff8276bb0}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f77770 "&AIOCallbackInternal::io_complete", mutex = {m_ptr = 0x7ffff8868380}, link = {<SLink<Continuation>> = {
            next = 0x0}, prev = 0x0}}, aiocb = {aio_fildes = 0, aio_buf = 0x7ffff03be000, aio_nbytes = 103424, aio_offset = 572416, aio_reqprio = 0, aio_lio_opcode = 2, aio_state = 0, aio__pad = {0}}, action = {_vptr$Action = 0x0, 
        continuation = 0x7ffff88d56f0, mutex = {m_ptr = 0x7ffff8868380}, cancelled = 0}, thread = 0xffffffffffffffff, then = 0x0, aio_result = 103424}, first = 0x0, aio_req = 0x7fffec02b600, sleep_time = 0}, agg = {<DLL> = {head = 0x0}, 
    tail = 0x0}, stat_cache_vcs = {<DLL> = {head = 0x0}, tail = 0x0}, sync = {<DLL> = {head = 0x0}, tail = 0x0}, agg_buffer = 0x7ffff03be000 "\023\233\022_\204\206\001", agg_todo_size = 0, agg_buf_pos = 0, trigger = 0x0, 
  open_dir = {<Continuation> = {<force_VFPT_to_top> = {_vptr$force_VFPT_to_top = 0x7ffff8276b30}, handler = {ptr = <error reading variable>, handler_name = 0x7ffff7f77d20 "&OpenDir::signal_readers", mutex = {m_ptr = 0x7ffff8868380}, 
      link = {<SLink<Continuation>> = {next = 0x0}, prev = 0x0}}, delayed_readers = {<DLL> = {head = 0x0}, tail = 0x0}, bucket = {{head = 0x0} <repeats 256 times>}}, ram_cache = 0x7fffeccca250, evacuate_size = 6, 
  evacuate = 0x7ffff88cee20, lookaside = {{head = 0x0} <repeats 256 times>}, doc_evacuator = 0x7c30f00df00d, init_info = 0x0, disk = 0x7fffec02b4a0, cache = 0x7ffff88ced70, cache_part = 0x7ffff88cea70, last_sync_serial = 4, 
  last_write_serial = 0, sector_size = 512, recover_wrapped = false, dir_sync_waiting = false, dir_sync_in_progress = false, writing_end_marker = false, first_fragment_key = {b = {0, 0}}, first_fragment_offset = 4294993844, 
  first_fragment_data = {m_ptr = 0x0}}
(gdb) print *thread
$30 = <incomplete type>
(gdb) print lock
$31 = {m = {m_ptr = 0x0}, lock_acquired = false}
(gdb) continue
Continuing.
FATAL: CacheDir.cc:1288: failed assert `lock`
/opt/trafficserver/bin/traffic_server(ink_fatal_va+0x111)[0x7f3aac0a1a31]
/opt/trafficserver/bin/traffic_server(ink_fatal+0x150)[0x7f3aac0a1ba0]
/opt/trafficserver/bin/traffic_server(_ink_assert+0x112)[0x7f3aac0a0c02]
/opt/trafficserver/bin/traffic_server(RegressionTest_Cache_dir(RegressionTest*, int, int*)+0xde)[0x7f3aac01e61e]
/opt/trafficserver/bin/traffic_server(+0x41d88d)[0x7f3aac0b888d]
/opt/trafficserver/bin/traffic_server(RegressionTest::run_some()+0x124)[0x7f3aac0b8a34]
/opt/trafficserver/bin/traffic_server(RegressionTest::check_status()+0x2f)[0x7f3aac0b8aaf]
/opt/trafficserver/bin/traffic_server(RegressionCont::mainEvent(int, Event*)+0xd4)[0x7f3aabe2d9d4]
/opt/trafficserver/bin/traffic_server(Continuation::handleEvent(int, void*)+0x78)[0x7f3aabdd6718]
/opt/trafficserver/bin/traffic_server(EThread::process_event(Event*, int)+0x171)[0x7f3aac096f91]
/opt/trafficserver/bin/traffic_server(EThread::execute()+0x27f)[0x7f3aac0973ef]
/opt/trafficserver/bin/traffic_server(main+0x1903)[0x7f3aabe278a3]
/lib/libc.so.6(__libc_start_main+0xfe)[0x7f3aa9739d8e]

Program received signal SIGABRT, Aborted.
0x00007ffff55b0ba5 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb)
  
> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910852#action_12910852 ] 

John Plevyak commented on TS-427:
---------------------------------

submitted to llvm, bug # 8175


> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TS-427) Build ATS with clang

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Plevyak reassigned TS-427:
-------------------------------

    Assignee: John Plevyak

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>            Assignee: John Plevyak
>             Fix For: 2.1.4
>
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom updated TS-427:
-----------------------------

    Affects Version/s: 2.3.0
                           (was: 2.1.3)

Targeting this for v2.3.0, feel free to rearrange if you think this can make it in for v2.1.3.

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903844#action_12903844 ] 

Igor Galić commented on TS-427:
-------------------------------

Regression tests:

root@phoenix:~# time /opt/ats-vanilla-gcc/bin/traffic_server -R 1 2>&1| grep -w FAIL
[SDK_API_INKfopen] mkstemp : [std func] <<FAIL>> { can't create file for writing }
[SDK_API_INKPluginDirGet] INKPluginDirGet : [TestCase2] <<FAIL>> { plugin dir(/opt/ats-vanilla-gcc/libexec) is incorrect, expected (libexec/trafficserver) in path }
[SDK_API_INKCache] INKCacheRemove : [TestCase1] <<FAIL>> { can't remove cached item }
[SDK_API_INKHttpConnectServerIntercept] INKHttpConnect : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectServerIntercept] INKHttpTxnServerIntercept : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpConnect : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpTxnIntercept : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_HttpAltInfo] INKHttpAltInfo : [All] <<FAIL>> { Test not executed even once }
[SDK_API_HttpTxnTransform] INKHttpTxnUntransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKHttpTxnTransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transformed_resp_cache }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass untransformed_resp_cache }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transform_create }
[SDK_API_HttpHookAdd] INKHttpHookAdd : [TestCase1] <<FAIL>> { Hooks not called or request failure. Hook mask = 1 }
[SDK_API_HttpHookAdd] INKHttpTxnReenable : [TestCase1] <<FAIL>> { Txn not reenabled properly }

real	1m52.899s
user	0m16.830s
sys	0m1.290s
root@phoenix:~# 


root@phoenix:~# time /opt/ats-clangpatch-gcc/bin/traffic_server -R 1  2>&1| grep -w FAIL
[SDK_API_INKfopen] mkstemp : [std func] <<FAIL>> { can't create file for writing }
[SDK_API_INKPluginDirGet] INKPluginDirGet : [TestCase2] <<FAIL>> { plugin dir(/opt/ats-clangpatch-gcc/libexec) is incorrect, expected (libexec/trafficserver) in path }
[SDK_API_INKHttpConnectServerIntercept] INKHttpConnect : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectServerIntercept] INKHttpTxnServerIntercept : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpConnect : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpTxnIntercept : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_HttpAltInfo] INKHttpAltInfo : [All] <<FAIL>> { Test not executed even once }
[SDK_API_HttpTxnTransform] INKHttpTxnUntransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKHttpTxnTransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transformed_resp_cache }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transform_create }
[SDK_API_HttpHookAdd] INKHttpHookAdd : [TestCase1] <<FAIL>> { Hooks not called or request failure. Hook mask = 1 }
[SDK_API_HttpHookAdd] INKHttpTxnReenable : [TestCase1] <<FAIL>> { Txn not reenabled properly }

real	1m46.821s
user	0m10.670s
sys	0m0.500s
root@phoenix:~# 


Now, for whatsoever reason, we run into some kind of condition in the ``Regression test(SDK_API_INKCache'', hence the Ctrl+C -- this is clang specific, just like the above abort() -- it doesn't happen with gcc, no matter the patching or the --enable-debug.

root@phoenix:~# time /opt/trafficserver/bin/traffic_server -R 1 2>&1| grep -w FAIL
[SDK_API_INKfopen] mkstemp : [std func] <<FAIL>> { can't create file for writing }
[SDK_API_INKPluginDirGet] INKPluginDirGet : [TestCase2] <<FAIL>> { plugin dir(/opt/trafficserver/libexec) is incorrect, expected (libexec/trafficserver) in path }
[SDK_API_INKHttpConnectServerIntercept] INKHttpConnect : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectServerIntercept] INKHttpTxnServerIntercept : [TestCase2] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpConnect : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_INKHttpConnectIntercept] INKHttpTxnIntercept : [TestCase1] <<FAIL>> { Unexpected response }
[SDK_API_HttpAltInfo] INKHttpAltInfo : [All] <<FAIL>> { Test not executed even once }
[SDK_API_HttpTxnTransform] INKHttpTxnUntransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKHttpTxnTransformedResponseCache : [TestCase1] <<FAIL>> { Value's Mismatch }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transformed_resp_cache }
[SDK_API_HttpTxnTransform] INKTransformCreate : [TestCase1] <<FAIL>> { did not pass transform_create }
[SDK_API_HttpHookAdd] INKHttpHookAdd : [TestCase1] <<FAIL>> { Hooks not called or request failure. Hook mask = 1 }
[SDK_API_HttpHookAdd] INKHttpTxnReenable : [TestCase1] <<FAIL>> { Txn not reenabled properly }
^C

real	4m44.578s
user	0m10.780s
sys	0m0.700s
root@phoenix:~# 


The different run times of the first two are caused by the fact that one of them is compiled with --enable-debug:
-rwxr-xr-x 1 root root 108M 2010-08-28 16:12 /opt/ats-vanilla-gcc/bin/traffic_server
-rwxr-xr-x 1 root root  26M 2010-08-28 16:14 /opt/ats-clangpatch-gcc/bin/traffic_server



> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.1.3
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.compile.patch, ats.clang.patch, ats.clang.patch
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-427) Build ATS with clang

Posted by "John Plevyak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918558#action_12918558 ] 

John Plevyak commented on TS-427:
---------------------------------

This patch (or at least the big that still applies) now works
with the latest clang svn (as of at least 115787),

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats-trunk.clang-trunk.patch, ats.clang.compile.patch, ats.clang.patch, ats.clang.patch, ats_clang_stuck.strace
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-427) Build ATS with clang

Posted by "Igor Galić (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Galić updated TS-427:
--------------------------

    Attachment: ats.clang.compile.patch

This patch gets us far enough to compile ATS with clang.
However, there are some things which need attention.
In some places there are comments which suggest that my patch will fail with VC++.
For one, for the other: Format strings in printf dervates need attention. Or better yet, a wrapper like APR has.

> Build ATS with clang
> --------------------
>
>                 Key: TS-427
>                 URL: https://issues.apache.org/jira/browse/TS-427
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 2.1.3
>         Environment: OS: Any; Clang --version:
> clang version 1.1 (branches/release_27)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
>            Reporter: Igor Galić
>         Attachments: ats.clang.compile.patch, ats.clang.patch
>
>
> I've started compiling, and cleaning up traffic-server from trunk with clang, with this config:
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] % cat config.notnice
> #! /bin/sh
> #
> # Created by configure
> CC="clang"; export CC
> CXX="clang"; export CXX
> CFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CFLAGS
> CXXFLAGS="-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2"; export CXXFLAGS
> LDFLAGS="-Wl,--as-needed -Wl,--warn-common"; export LDFLAGS
> "./configure" \
> "--enable-layout=opt" \
> "--with-user=proxy" \
> "--with-group=proxy" \
> "CC=clang" \
> "CFLAGS=-fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2" \
> "LDFLAGS=-Wl,--as-needed" \
> "CXX=clang" \
> "$@"
> i.galic@phoenix ~/Projects/asf/trafficserver (svn)-[trunk:989985] %
> Until I hit errors that seemed to include templates.
> I'm uploading the current patch for you to sanity-check and review. If it makes sense, I suppose it does a bit of a clean-up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.