cppcms-users Mailing List for CppCMS C++ Web Framework (Page 75)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Artyom B. <art...@ya...> - 2012-08-09 11:23:24
|
> On 08/09/2012 01:29 PM, Artyom Beilis wrote: >> Are you familiar with this? >> >> http://cppcms.com/wikipp/en/page/cppcms_1x#Comet.Programming > > No, I haven't followed that part of the tutorial, but I read it. > But thinking of it ... > > Will it work if instead of the long pooling connection I'll use the > EventStream in JS? I'm not familiar with EventStream of JS. But if it supports server side events... Than it does either long polling or some sort of streaming like hidden iframe or "never-ending" javascript etc. There are many COMET techniques. > > And after broadcasting something to every waiter that initialized that > connectionit I shouldn't call waiter->async_complete_response(); so I > don't close the connection. > > Is that correct? async_complete_response does what is defined - completes the response and closes the connection. The client is expected to reopen one - send a new XHR and wait again - also note that you can't get partial content using XHR API. If you want to not complete the response use async_flush_output with completion handler. > > -- Barbu Paul - Gheorghe > Common sense is not so common - Voltaire > Visit My GitHub profile to see my open-source projects - > https://github.com/paullik > Regards, Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
From: Barbu P. - G. <bar...@gm...> - 2012-08-09 11:14:23
|
On 08/09/2012 01:29 PM, Artyom Beilis wrote: > Are you familiar with this? > > http://cppcms.com/wikipp/en/page/cppcms_1x#Comet.Programming No, I haven't followed that part of the tutorial, but I read it. But thinking of it ... Will it work if instead of the long pooling connection I'll use the EventStream in JS? And after broadcasting something to every waiter that initialized that connectionit I shouldn't call waiter->async_complete_response(); so I don't close the connection. Is that correct? -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik |
From: Artyom B. <art...@ya...> - 2012-08-09 10:29:12
|
> I have the following app > https://github.com/paullik/webchat/blob/master/src/index.py it is a webchat that > > uses AJAX and server sent events (SSE). > > But I'd like (for exercise) to port it to C++ using CppCMS. Are you familiar with this? http://cppcms.com/wikipp/en/page/cppcms_1x#Comet.Programming > I'd like to use only the RAM, so I'd like to get rid of redis. > Will it work if I create a vector of messages (or a queue) where I'll store > the > messages and I'll pass this vector to the function at point 1 to sent the > messages to the other users, then remove that message from the vector in order > to be prepared for the next one? I may suggest to keep last X messages in the memory and if user logins too late it would get only last messages and make the user request messages in queue from some counter, something like that. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
From: Barbu P. - G. <bar...@gm...> - 2012-08-09 10:22:20
|
Hello. I have the following app https://github.com/paullik/webchat/blob/master/src/index.py it is a webchat that uses AJAX and server sent events (SSE). But I'd like (for exercise) to port it to C++ using CppCMS. I have some issues though: 1. How can I implement in CppCMS a function that acts like my sse_stream python function? Namely: this function has to return a response when something happens (a user says something on the chat) and then it has to continue working, so it should be a blocking function that patiently waits for users to submit messages via AJAX and when a message arrives it should send it as a response, then wait for another message and so on. 2. There (in my python app) I use redis to publish a message to all subscribers, because the application creates a thread for each connection, any of these threads can publish something (any user can send a message) and via redis I collect them and send them to everyone using sse_stream. The issue is that I'm unsure about how to replicate this system. I'd like to use only the RAM, so I'd like to get rid of redis. Will it work if I create a vector of messages (or a queue) where I'll store the messages and I'll pass this vector to the function at point 1 to sent the messages to the other users, then remove that message from the vector in order to be prepared for the next one? Please let me know what you think, I'll provide more details or I'll try to provide a better explanation of what I'm trying to do. PS: As you can see I'm a C++ beginner, please be kind... -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik |
From: <ele...@ex...> - 2012-08-08 22:20:50
|
> > > Ok.... > > > This is kind of stuff I actually would expect from FreeBSD users to find > very fast.... > All you need to do to prevent accidental crashes is to... Thanks, I thought it would be something to do with FBSD hence why I suggested posting it to FBSD mailing list. I haven't done any devel work on FBSD until a few months ago. |
From: Vinicius P. <ds...@ha...> - 2012-08-08 19:52:50
|
Artyom, Thank you very much. It's very nice to see your devotion to this and how you figure it out, hope I can contribute to this community when my C++ skills get better. As Petr told me, I will try to understand this better and post to FreeBSD list, I don't know if it's common sense the need for this flag in FreeBSD, if anyone think this is the right thing to do and wanna send please go ahead. One more time thanks for CppCMS =D Vinicius Em 08/08/2012, às 16:43, Artyom Beilis escreveu: > > > Ok.... > > > This is kind of stuff I actually would expect from FreeBSD users to find very fast.... > All you need to do to prevent accidental crashes is to... > > Link directly with pthread, i.e. add -lpthread flag... > > > These crashes caused by the fact that for some reason I don't 100% understand > libstdc++ does not perform atomic operations where they are needed (reference counting > of locale objects for example) > > This is an optimization for the single threaded case, but unfortunately > if you don't link the main executable directly with libpthread it does > not detect it properly (i.e. libcppcms linked to libpthread but not the main exe) > > So what happens that std::locale object that uses reference counting > finally gets invalid value. > > If it goes too high than the locale object is not either destroyed > (which leads to memory leak) or get destroyed to early - which > leads to the crash... > > Once you link with pthread directly the problem goes away. > > So in you example you send, change > > > LIBS=-lcppcms -lbooster -lcppdb > > to > > LIBS=-lcppcms -lbooster -lcppdb -lpthread > > And it would 100% work... > > I thought it was a critical bug in the framework and spend > half a day on it... I'm glad it is not. > > But you, FreeBSD users should be the first one to notice that > some threading stuff is missing. > > (BTW under Linux there is no such a problem, even > if it is not linked with -lpthread it works 100%) > > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > >>>> ________________________________ >>>> From: Vinicius Pavanelli <ds...@ha...> >>> >>>> Thanks for your reply Artyom, >>>> >>>> >>>> I'm checking my code, taking the smaller part that reproduce this bug to understand it, if needed can send but this only happens on FreeBSD. >>>> >>>> >>>> Is CppCMS under FreeBSD considered ok for production or it's mainly Linux? >>>> >>> >>> Yes it is production ready and tested on daily basis: >>> >>> http://cppcms.com/files/nightly-build-report.html >>> >>> (of course as in any case there may be a bug) >>> >>> >>>> >>>> The line at #2 is just: set_content_header("text/html"), inside http_response.cpp, this looks very strange to me, it's very ok. >>>> >>> >>> Ok, if so this does not related, you are right. >>> >>> >>>> >>>> I don't have info.h in my files so i'm assuming it's booster/booster/locale/info.h, is this correct, >>>> >>> >>> Ok I see. >>> >>> Also indeed this bug is exactly related. >>> >>> >>> http://sourceforge.net/tracker/?func=detail&aid=3535893&group_id=209965&atid=1011835 >>> >>> >>> I have several questions: >>> >>> - What version do you use? Trunk or Stable? (If trunk, does it happens on stable as well?) >> >> CppCMS-1.0.1 stable >> >>> - Do you compile libcppcms with ICU or without? >>> - If it is built with ICU, what version? >>> >> >> ICU 4.8.1.1_1 (from packages) >> >>> - What is the system locale? (output of locale) >>> >> >> freebsd# locale >> LANG= >> LC_CTYPE="C" >> LC_COLLATE="C" >> LC_TIME="C" >> LC_NUMERIC="C" >> LC_MONETARY="C" >> LC_MESSAGES="C" >> LC_ALL= >> >> >>> - What is the content header returned by the application (when it is not crashed) >> >> Content-Type: text/html; charset=utf-8 >> >>> >>> Now about libstdc++. >>> >>> - What version of GCC do you use, or you are using Clang? >>> >>> >>> Please note: I ask about building CppCMS not your application. >>> >> >> I used both gcc 4.2.1 (20070831) and clang 3.0 (20111021). >> >>> >>> - How many cores does you computer has? >> >> 4 cores >> >>> >>> - How do you link with libcppcms library statically or dynamically? >>> >> >> Dynamically >> >>> >>> I don't think it is related to threading library it may be a bug >>> connected to facets, locking and standard library. >> >> If I can provide any more info please let me know. >> >> Thanks for your help Artyom, >> >>> >>> >>>> >>>> >>>> Em 07/08/2012, às 00:57, Artyom Beilis escreveu: >>>> >>>> See: >>>>> >>>>> >>>>> 1 0x0000000800939cb3 in cppcms::http::response::set_content_header >>> (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >>>>> >>>>> >>>>> It looks like content_type you pass in info.h line 83 has very strange address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF >>>>> It seems strange to me check your code. >>>>> >>>>> >>>>> Artyom Beilis >>>>> -------------- >>>>> CppCMS - C++ Web Framework: http://cppcms.com/ >>>>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>>>> >>>>> >>>>> >>>>>> ________________________________ >>>>>> From: Vinicius Pavanelli <ds...@ha...> >>>>>> To: cpp...@li... >>>>>> Sent: Tuesday, August 7, 2012 5:15 AM >>>>>> Subject: [Cppcms-users] Segmentation fault on FreeBSD in high load >>>>>> >>>>>> Hi, >>>>>> >>>>>> I'm new to CppCMS and been doing some work on it, too see where I get. >>>>>> When I run the code on Linux/Gentoo it works fine, on FreeBSD it runs fine too, but on high loads it crashs (like when testing with siege). >>>>>> Can anyone help me on what may be wrong with it? It's my code, something on FreeBSD? >>>>>> >>>>>> By the way, I got 22k trans/sec with CppCMS on Gentoo, running the embedded web server, the Apache with static files is way bellow this. >>>>>> The performance gain from PHP to CppCMS is very impressive. >>>>>> >>>>>> Thanks in advance, >>>>>> Vinicius >>>>>> >>>>>> >>>>>> System: FreeBSD freebsd 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012 ro...@am...:/usr/obj/usr/src/sys/GENERIC amd64 >>>>>> >>>>>> The gdb log is: >>>>>> ---------------------- >>>>>> Program received signal SIGSEGV, Segmentation >>> fault. >>>>>> [Switching to Thread 804807400 (LWP 100101/wep)] >>>>>> 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >>>>>> (gdb) bt >>>>>> #0 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >>>>>> #1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >>>>>> #2 0x000000080093b90b in response (this=0x80ba7ac00, context=@0x807bf75b0) at /root/work/cppcms-1.0.1/src/http_response.cpp:116 >>>>>> #3 0x000000080094953d in context (this=0x807bf75b0, conn=Variable "conn" is not available. >>>>>> ) at /root/work/cppcms-1.0.1/src/http_context.cpp:58 >>>>>> #4 0x0000000800a2dc07 in booster::callback<void ()(booster::system::error_code const&)>::callable_impl<void, cppcms::impl::cgi::socket_acceptor<cppcms::impl::cgi::http, cppcms::impl::cgi::http_creator>::accept_binder>::operator() (this=Variable "this" is not available. >>>>>> ) at >>> cgi_acceptor.h:140 >>>>>> #5 0x0000000800cf9059 in operator() (this=0x8083feee0, e=Variable "e" is not available. >>>>>> ) at callback.h:211 >>>>>> #6 0x0000000800cee189 in booster::callback<void ()()>::callable_impl<void, booster::aio::event_loop_impl::event_handler_dispatcher>::operator() (this=Variable "this" is not available. >>>>>> ) >>>>>> at callback.h:211 >>>>>> #7 0x0000000800cef490 in booster::aio::event_loop_impl::run_one (this=0x804842200, evs=0x80480e000, evs_size=128) at callback.h:201 >>>>>> #8 0x0000000800cec349 in booster::aio::io_service::run (this=Variable "this" is not available. >>>>>> ) at /root/work/cppcms-1.0.1/booster/lib/aio/src/io_service.cpp:144 >>>>>> #9 0x0000000800918dde in cppcms::service::run (this=0x7fffffffda80) at /root/work/cppcms-1.0.1/src/service.cpp:574 >>>>>> #10 0x000000000040d472 in main (argc=Variable "argc" is not available. >>>>>> ) at >>> wep.cpp:167 >>>>>> ---------------------- >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Live Security Virtual Conference >>>>>> Exclusive live event will cover all the ways today's security and >>>>>> threat landscape has changed and how IT managers can respond. Discussions >>>>>> will include endpoint security, mobile security and the latest in malware >>>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>> _______________________________________________ >>>>>> Cppcms-users mailing list >>>>>> Cpp...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's security and >>>>> threat landscape has changed and how IT managers can respond. Discussions >>>>> will include endpoint security, mobile security and the latest in malware >>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ >>>>> Cppcms-users mailing list >>>>> Cpp...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>>> >>>> >>> >>> >>> >>> Artyom Beilis >>> -------------- >>> CppCMS - C++ Web Framework: http://cppcms.com/ >>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> >> > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom B. <art...@ya...> - 2012-08-08 19:43:58
|
Ok.... This is kind of stuff I actually would expect from FreeBSD users to find very fast.... All you need to do to prevent accidental crashes is to... Link directly with pthread, i.e. add -lpthread flag... These crashes caused by the fact that for some reason I don't 100% understand libstdc++ does not perform atomic operations where they are needed (reference counting of locale objects for example) This is an optimization for the single threaded case, but unfortunately if you don't link the main executable directly with libpthread it does not detect it properly (i.e. libcppcms linked to libpthread but not the main exe) So what happens that std::locale object that uses reference counting finally gets invalid value. If it goes too high than the locale object is not either destroyed (which leads to memory leak) or get destroyed to early - which leads to the crash... Once you link with pthread directly the problem goes away. So in you example you send, change LIBS=-lcppcms -lbooster -lcppdb to LIBS=-lcppcms -lbooster -lcppdb -lpthread And it would 100% work... I thought it was a critical bug in the framework and spend half a day on it... I'm glad it is not. But you, FreeBSD users should be the first one to notice that some threading stuff is missing. (BTW under Linux there is no such a problem, even if it is not linked with -lpthread it works 100%) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>> ________________________________ >>> From: Vinicius Pavanelli <ds...@ha...> >> >>> Thanks for your reply Artyom, >>> >>> >>> I'm checking my code, taking the smaller part that reproduce this bug to understand it, if needed can send but this only happens on FreeBSD. >>> >>> >>> Is CppCMS under FreeBSD considered ok for production or it's mainly Linux? >>> >> >> Yes it is production ready and tested on daily basis: >> >> http://cppcms.com/files/nightly-build-report.html >> >> (of course as in any case there may be a bug) >> >> >>> >>> The line at #2 is just: set_content_header("text/html"), inside http_response.cpp, this looks very strange to me, it's very ok. >>> >> >> Ok, if so this does not related, you are right. >> >> >>> >>> I don't have info.h in my files so i'm assuming it's booster/booster/locale/info.h, is this correct, >>> >> >> Ok I see. >> >> Also indeed this bug is exactly related. >> >> >> http://sourceforge.net/tracker/?func=detail&aid=3535893&group_id=209965&atid=1011835 >> >> >> I have several questions: >> >> - What version do you use? Trunk or Stable? (If trunk, does it happens on stable as well?) > >CppCMS-1.0.1 stable > >> - Do you compile libcppcms with ICU or without? >> - If it is built with ICU, what version? >> > >ICU 4.8.1.1_1 (from packages) > >> - What is the system locale? (output of locale) >> > >freebsd# locale >LANG= >LC_CTYPE="C" >LC_COLLATE="C" >LC_TIME="C" >LC_NUMERIC="C" >LC_MONETARY="C" >LC_MESSAGES="C" >LC_ALL= > > >> - What is the content header returned by the application (when it is not crashed) > >Content-Type: text/html; charset=utf-8 > >> >> Now about libstdc++. >> >> - What version of GCC do you use, or you are using Clang? >> >> >> Please note: I ask about building CppCMS not your application. >> > >I used both gcc 4.2.1 (20070831) and clang 3.0 (20111021). > >> >> - How many cores does you computer has? > >4 cores > >> >> - How do you link with libcppcms library statically or dynamically? >> > >Dynamically > >> >> I don't think it is related to threading library it may be a bug >> connected to facets, locking and standard library. > >If I can provide any more info please let me know. > >Thanks for your help Artyom, > >> >> >>> >>> >>> Em 07/08/2012, às 00:57, Artyom Beilis escreveu: >>> >>> See: >>>> >>>> >>>> 1 0x0000000800939cb3 in cppcms::http::response::set_content_header >> (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >>>> >>>> >>>> It looks like content_type you pass in info.h line 83 has very strange address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF >>>> It seems strange to me check your code. >>>> >>>> >>>> Artyom Beilis >>>> -------------- >>>> CppCMS - C++ Web Framework: http://cppcms.com/ >>>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>>> >>>> >>>> >>>>> ________________________________ >>>>> From: Vinicius Pavanelli <ds...@ha...> >>>>> To: cpp...@li... >>>>> Sent: Tuesday, August 7, 2012 5:15 AM >>>>> Subject: [Cppcms-users] Segmentation fault on FreeBSD in high load >>>>> >>>>> Hi, >>>>> >>>>> I'm new to CppCMS and been doing some work on it, too see where I get. >>>>> When I run the code on Linux/Gentoo it works fine, on FreeBSD it runs fine too, but on high loads it crashs (like when testing with siege). >>>>> Can anyone help me on what may be wrong with it? It's my code, something on FreeBSD? >>>>> >>>>> By the way, I got 22k trans/sec with CppCMS on Gentoo, running the embedded web server, the Apache with static files is way bellow this. >>>>> The performance gain from PHP to CppCMS is very impressive. >>>>> >>>>> Thanks in advance, >>>>> Vinicius >>>>> >>>>> >>>>> System: FreeBSD freebsd 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012 ro...@am...:/usr/obj/usr/src/sys/GENERIC amd64 >>>>> >>>>> The gdb log is: >>>>> ---------------------- >>>>> Program received signal SIGSEGV, Segmentation >> fault. >>>>> [Switching to Thread 804807400 (LWP 100101/wep)] >>>>> 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >>>>> (gdb) bt >>>>> #0 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >>>>> #1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >>>>> #2 0x000000080093b90b in response (this=0x80ba7ac00, context=@0x807bf75b0) at /root/work/cppcms-1.0.1/src/http_response.cpp:116 >>>>> #3 0x000000080094953d in context (this=0x807bf75b0, conn=Variable "conn" is not available. >>>>> ) at /root/work/cppcms-1.0.1/src/http_context.cpp:58 >>>>> #4 0x0000000800a2dc07 in booster::callback<void ()(booster::system::error_code const&)>::callable_impl<void, cppcms::impl::cgi::socket_acceptor<cppcms::impl::cgi::http, cppcms::impl::cgi::http_creator>::accept_binder>::operator() (this=Variable "this" is not available. >>>>> ) at >> cgi_acceptor.h:140 >>>>> #5 0x0000000800cf9059 in operator() (this=0x8083feee0, e=Variable "e" is not available. >>>>> ) at callback.h:211 >>>>> #6 0x0000000800cee189 in booster::callback<void ()()>::callable_impl<void, booster::aio::event_loop_impl::event_handler_dispatcher>::operator() (this=Variable "this" is not available. >>>>> ) >>>>> at callback.h:211 >>>>> #7 0x0000000800cef490 in booster::aio::event_loop_impl::run_one (this=0x804842200, evs=0x80480e000, evs_size=128) at callback.h:201 >>>>> #8 0x0000000800cec349 in booster::aio::io_service::run (this=Variable "this" is not available. >>>>> ) at /root/work/cppcms-1.0.1/booster/lib/aio/src/io_service.cpp:144 >>>>> #9 0x0000000800918dde in cppcms::service::run (this=0x7fffffffda80) at /root/work/cppcms-1.0.1/src/service.cpp:574 >>>>> #10 0x000000000040d472 in main (argc=Variable "argc" is not available. >>>>> ) at >> wep.cpp:167 >>>>> ---------------------- >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's security and >>>>> threat landscape has changed and how IT managers can respond. Discussions >>>>> will include endpoint security, mobile security and the latest in malware >>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>> _______________________________________________ >>>>> Cppcms-users mailing list >>>>> Cpp...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >>> >> >> >> >> Artyom Beilis >> -------------- >> CppCMS - C++ Web Framework: http://cppcms.com/ >> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users > > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: Artyom B. <art...@ya...> - 2012-08-08 11:06:53
|
I had reproduced it, but it is far from being simple. I suspect some problems in libstdc++ / reference counting / threading Same happens with gcc-46 from ports. It seems like some facets are either destroyed before the time and sometimes (more frequently) not destroyed at all. I'll update when I'll find what is the problem. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: "ele...@ex..." <ele...@ex...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Wednesday, August 8, 2012 1:28 PM >Subject: Re: [Cppcms-users] Segmentation fault on FreeBSD in high load > >> Got FreeBSD 9.0 64 bit, with the configuration you are talking with 4 >> cores (under VirtualBox)... >> Can't reproduce it even under high loads. >> >> >> Ok, I think I'll need a program that reproduces the problem, if you want >> to send it to >> me privately it is ok. >> >> Also few additional points: >> >> - what is your config.js file? >> - what locale do you use? >> >> Artyom Beilis > >Did you guys manage to find out whats wrong? > > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: <ele...@ex...> - 2012-08-08 10:28:56
|
> Got FreeBSD 9.0 64 bit, with the configuration you are talking with 4 > cores (under VirtualBox)... > Can't reproduce it even under high loads. > > > Ok, I think I'll need a program that reproduces the problem, if you want > to send it to > me privately it is ok. > > Also few additional points: > > - what is your config.js file? > - what locale do you use? > > Artyom Beilis Did you guys manage to find out whats wrong? |
From: Stanimir M. <sta...@zo...> - 2012-08-07 15:35:53
|
I knew that i am doing something wrong, but after I read some explanations for linking with static and dynamic libraries, and after several reordering was not able to do it. Thank you for this help and for the additional good tips for linking. Stanimir On Tue, Aug 7, 2012 at 5:40 PM, Artyom Beilis <art...@ya...> wrote: > Hello, > > > You are linking not correctly: > > a) You forget to link with ICU > b) You use incorrect link order > c) You forget to return to dynamic linking (in generally it is better to provide path to *.a files) > d) Don't forget order. > > -lboost_locale -lboost_thread > > Not the other way around as boost locale uses boost thread > > > This is how should you links (in the example there is a stage build) > > > This is the simplest way: > ------------------------ > > > The simplest way (full path), locale static, icu dynamic > > > g++ -O2 test.cpp -I /home/artik/Packages/boost/boost_1_49_0 /home/artik/Packages/boost/boost_1_49_0/stage/lib/libboost_locale.a /home/artik/Packages/boost/boost_1_49_0/stage/lib/libboost_thread.a -lpthread -licuuc -licui18n > > > > Boost-Locale Static and ICU Dynamic > > g++ -O2 test.cpp -I /home/artik/Packages/boost/boost_1_49_0 -L /home/artik/Packages/boost/boost_1_49_0/stage/lib/ -Wl,-Bstatic -lboost_locale -lboost_thread -Wl,-Bdynamic -lpthread -licuuc -licui18n > > > > Boost-Locale and ICU Static > > > g++ -O2 test.cpp -I /home/artik/Packages/boost/boost_1_49_0 -L /home/artik/Packages/boost/boost_1_49_0/stage/lib/ -Wl,-Bstatic -lboost_locale -lboost_thread -licui18n -licuuc -licudata -Wl,-Bdynamic -lpthread -ldl > > > Probably with more resent versions you'll need -lboost_system AFTER boost_thread > > Also such a question should go to boost mailing list :-) > > > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > > > ----- Original Message ----- >> From: Stanimir Mladenov <sta...@zo...> >> To: Artyom Beilis <art...@ya...>; cpp...@li... >> Cc: >> Sent: Tuesday, August 7, 2012 5:11 PM >> Subject: Re: [Cppcms-users] Boost locale with icu backend static linking. >> >> After i made a simple example for linking with boost_locale statically >> and building it on a clean machine the problems still exists. >> It could be something with the link order or something else, that i >> just can't see. >> >> Here are some info for my environment: >> Ubuntu 12.04 server x86_64 >> g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 - installed from the repository >> boost 1.49 - compiled from source and installed >> >> $ locale >> LANG=en_US.UTF-8 >> LANGUAGE= >> LC_CTYPE="en_US.UTF-8" >> LC_NUMERIC="en_US.UTF-8" >> LC_TIME="en_US.UTF-8" >> LC_COLLATE="en_US.UTF-8" >> LC_MONETARY="en_US.UTF-8" >> LC_MESSAGES="en_US.UTF-8" >> LC_PAPER="en_US.UTF-8" >> LC_NAME="en_US.UTF-8" >> LC_ADDRESS="en_US.UTF-8" >> LC_TELEPHONE="en_US.UTF-8" >> LC_MEASUREMENT="en_US.UTF-8" >> LC_IDENTIFICATION="en_US.UTF-8" >> LC_ALL= >> >> Here is the example that fails to compile: >> >> #include <boost/locale.hpp> >> #include <boost/locale/date_time.hpp> >> #include <boost/locale/info.hpp> >> #include <boost/locale/localization_backend.hpp> >> >> #include <string> >> >> int main(int argc, char* argv[]) >> { >> using namespace boost::locale; >> generator gen; >> std::locale l = gen("bg_BG.UTF-8"); >> std::locale::global(l); >> std::cout.imbue(l); >> boost::locale::date_time date = boost::locale::date_time(); >> std::cout << "info: " << >> std::use_facet<boost::locale::info>(l).country() << std::endl; >> std::cout << boost::locale::as::date << date << std::endl; >> } >> >> The expected output must be: >> >> info: BG >> 07.08.2012 >> >> Compiling with the following command line for dynamic linking works: >> g++ main.cpp -o test -lboost_filesystem -lboost_thread -lboost_system >> -lboost_locale -Wl,-Bdynamic >> >> The problematic link for static is: >> $ g++ -Wl,-Bstatic -lboost_system -lboost_filesystem -lboost_locale >> -static main.cpp -o test >> >> Here is the output of the command line for static: >> >> /tmp/ccosf6nV.o: In function `main': >> main.cpp:(.text+0x21): undefined reference to >> `boost::locale::generator::generator()' >> main.cpp:(.text+0xbd): undefined reference to >> `boost::locale::date_time::date_time()' >> main.cpp:(.text+0x149): undefined reference to >> `boost::locale::date_time::~date_time()' >> main.cpp:(.text+0x161): undefined reference to >> `boost::locale::generator::~generator()' >> main.cpp:(.text+0x1c3): undefined reference to >> `boost::locale::date_time::~date_time()' >> main.cpp:(.text+0x1e0): undefined reference to >> `boost::locale::generator::~generator()' >> /tmp/ccosf6nV.o: In function `boost::locale::as::date(std::ios_base&)': >> main.cpp:(.text._ZN5boost6locale2as4dateERSt8ios_base[boost::locale::as::date(std::ios_base&)]+0x14): >> undefined reference to `boost::locale::ios_info::get(std::ios_base&)' >> main.cpp:(.text._ZN5boost6locale2as4dateERSt8ios_base[boost::locale::as::date(std::ios_base&)]+0x21): >> undefined reference to >> `boost::locale::ios_info::display_flags(unsigned long)' >> /tmp/ccosf6nV.o: In function >> `boost::locale::generator::operator()(std::basic_string<char, >> std::char_traits<char>, std::allocator<char> > const&) >> const': >> main.cpp:(.text._ZNK5boost6locale9generatorclERKSs[boost::locale::generator::operator()(std::basic_string<char, >> std::char_traits<char>, std::allocator<char> > const&) >> const]+0x27): >> undefined reference to >> `boost::locale::generator::generate(std::basic_string<char, >> std::char_traits<char>, std::allocator<char> > const&) >> const' >> /tmp/ccosf6nV.o: In function `boost::locale::info const& >> std::use_facet<boost::locale::info>(std::locale const&)': >> main.cpp:(.text._ZSt9use_facetIN5boost6locale4infoEERKT_RKSt6locale[boost::locale::info >> const& std::use_facet<boost::locale::info>(std::locale >> const&)]+0xd): >> undefined reference to `boost::locale::info::id' >> /tmp/ccosf6nV.o: In function `std::basic_ostream<char, >> std::char_traits<char> >& boost::locale::operator<< >> <char>(std::basic_ostream<char, std::char_traits<char> >&, >> boost::locale::date_time const&)': >> main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, >> std::char_traits<char> >& boost::locale::operator<< >> <char>(std::basic_ostream<char, std::char_traits<char> >&, >> boost::locale::date_time const&)]+0x18): undefined reference to >> `boost::locale::date_time::time() const' >> main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, >> std::char_traits<char> >& boost::locale::operator<< >> <char>(std::basic_ostream<char, std::char_traits<char> >&, >> boost::locale::date_time const&)]+0x37): undefined reference to >> `boost::locale::ios_info::get(std::ios_base&)' >> main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, >> std::char_traits<char> >& boost::locale::operator<< >> <char>(std::basic_ostream<char, std::char_traits<char> >&, >> boost::locale::date_time const&)]+0x3f): undefined reference to >> `boost::locale::ios_info::display_flags() const' >> main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, >> std::char_traits<char> >& boost::locale::operator<< >> <char>(std::basic_ostream<char, std::char_traits<char> >&, >> boost::locale::date_time const&)]+0x8c): undefined reference to >> `boost::locale::ios_info::get(std::ios_base&)' >> main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, >> std::char_traits<char> >& boost::locale::operator<< >> <char>(std::basic_ostream<char, std::char_traits<char> >&, >> boost::locale::date_time const&)]+0x99): undefined reference to >> `boost::locale::ios_info::display_flags(unsigned long)' >> main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, >> std::char_traits<char> >& boost::locale::operator<< >> <char>(std::basic_ostream<char, std::char_traits<char> >&, >> boost::locale::date_time const&)]+0xc4): undefined reference to >> `boost::locale::ios_info::get(std::ios_base&)' >> main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, >> std::char_traits<char> >& boost::locale::operator<< >> <char>(std::basic_ostream<char, std::char_traits<char> >&, >> boost::locale::date_time const&)]+0xd3): undefined reference to >> `boost::locale::ios_info::display_flags(unsigned long)' >> collect2: ld returned 1 exit status >> >> On Thu, Jul 19, 2012 at 11:05 AM, Stanimir Mladenov >> <sta...@zo...> wrote: >>> Sorry for bothering you! It should be my something wrong with my >>> ubuntu development machine, so i will setup a new clean one and i bet >>> the problem will disappear. If it doesn't then i will write back >>> again. >>> >>> Actually, this looks to be very common problem, i.e. messing up >>> something bad with multiple installations. That's why i am tring to do >>> everything in a new virtual machine first, before posting again for >>> help. >>> >>> On Thu, Jul 19, 2012 at 10:54 AM, Artyom Beilis <art...@ya...> >> wrote: >>>> - What exactly the error? >>>> - What symbols are missing? >>>> - How exactly do you link? >>>> >>>> Artyom Beilis >>>> -------------- >>>> CppCMS - C++ Web Framework: http://cppcms.com/ >>>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>>> >>>> ________________________________ >>>> From: Stanimir Mladenov <sta...@zo...> >>>> To: CppCMS users group <cpp...@li...> >>>> Sent: Monday, July 16, 2012 7:10 PM >>>> Subject: [Cppcms-users] Boost locale with icu backend static linking. >>>> >>>> Boost locale with dynamic linking works just fine. When i try to link >>>> it statically i get bunch of unresolved externals. >>>> >>>> 1. I did try with plain icu api call and static linking. Works. >>>> 2. I tried a simple libboost_filesystem api call with static linking. >> Works. >>>> >>>> The only problem is when I try to link libboost_locale statically. >>>> Does someone is able to statically link it? >>>> >>>> Greetings, >>>> Stanimir >>>> >>>> >> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. >> Discussions >>>> will include endpoint security, mobile security and the latest in >> malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>>> >>>> >>>> >> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. >> Discussions >>>> will include endpoint security, mobile security and the latest in >> malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom B. <art...@ya...> - 2012-08-07 14:40:44
|
Hello, You are linking not correctly: a) You forget to link with ICU b) You use incorrect link order c) You forget to return to dynamic linking (in generally it is better to provide path to *.a files) d) Don't forget order. -lboost_locale -lboost_thread Not the other way around as boost locale uses boost thread This is how should you links (in the example there is a stage build) This is the simplest way: ------------------------ The simplest way (full path), locale static, icu dynamic g++ -O2 test.cpp -I /home/artik/Packages/boost/boost_1_49_0 /home/artik/Packages/boost/boost_1_49_0/stage/lib/libboost_locale.a /home/artik/Packages/boost/boost_1_49_0/stage/lib/libboost_thread.a -lpthread -licuuc -licui18n Boost-Locale Static and ICU Dynamic g++ -O2 test.cpp -I /home/artik/Packages/boost/boost_1_49_0 -L /home/artik/Packages/boost/boost_1_49_0/stage/lib/ -Wl,-Bstatic -lboost_locale -lboost_thread -Wl,-Bdynamic -lpthread -licuuc -licui18n Boost-Locale and ICU Static g++ -O2 test.cpp -I /home/artik/Packages/boost/boost_1_49_0 -L /home/artik/Packages/boost/boost_1_49_0/stage/lib/ -Wl,-Bstatic -lboost_locale -lboost_thread -licui18n -licuuc -licudata -Wl,-Bdynamic -lpthread -ldl Probably with more resent versions you'll need -lboost_system AFTER boost_thread Also such a question should go to boost mailing list :-) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: Stanimir Mladenov <sta...@zo...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Tuesday, August 7, 2012 5:11 PM > Subject: Re: [Cppcms-users] Boost locale with icu backend static linking. > > After i made a simple example for linking with boost_locale statically > and building it on a clean machine the problems still exists. > It could be something with the link order or something else, that i > just can't see. > > Here are some info for my environment: > Ubuntu 12.04 server x86_64 > g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 - installed from the repository > boost 1.49 - compiled from source and installed > > $ locale > LANG=en_US.UTF-8 > LANGUAGE= > LC_CTYPE="en_US.UTF-8" > LC_NUMERIC="en_US.UTF-8" > LC_TIME="en_US.UTF-8" > LC_COLLATE="en_US.UTF-8" > LC_MONETARY="en_US.UTF-8" > LC_MESSAGES="en_US.UTF-8" > LC_PAPER="en_US.UTF-8" > LC_NAME="en_US.UTF-8" > LC_ADDRESS="en_US.UTF-8" > LC_TELEPHONE="en_US.UTF-8" > LC_MEASUREMENT="en_US.UTF-8" > LC_IDENTIFICATION="en_US.UTF-8" > LC_ALL= > > Here is the example that fails to compile: > > #include <boost/locale.hpp> > #include <boost/locale/date_time.hpp> > #include <boost/locale/info.hpp> > #include <boost/locale/localization_backend.hpp> > > #include <string> > > int main(int argc, char* argv[]) > { > using namespace boost::locale; > generator gen; > std::locale l = gen("bg_BG.UTF-8"); > std::locale::global(l); > std::cout.imbue(l); > boost::locale::date_time date = boost::locale::date_time(); > std::cout << "info: " << > std::use_facet<boost::locale::info>(l).country() << std::endl; > std::cout << boost::locale::as::date << date << std::endl; > } > > The expected output must be: > > info: BG > 07.08.2012 > > Compiling with the following command line for dynamic linking works: > g++ main.cpp -o test -lboost_filesystem -lboost_thread -lboost_system > -lboost_locale -Wl,-Bdynamic > > The problematic link for static is: > $ g++ -Wl,-Bstatic -lboost_system -lboost_filesystem -lboost_locale > -static main.cpp -o test > > Here is the output of the command line for static: > > /tmp/ccosf6nV.o: In function `main': > main.cpp:(.text+0x21): undefined reference to > `boost::locale::generator::generator()' > main.cpp:(.text+0xbd): undefined reference to > `boost::locale::date_time::date_time()' > main.cpp:(.text+0x149): undefined reference to > `boost::locale::date_time::~date_time()' > main.cpp:(.text+0x161): undefined reference to > `boost::locale::generator::~generator()' > main.cpp:(.text+0x1c3): undefined reference to > `boost::locale::date_time::~date_time()' > main.cpp:(.text+0x1e0): undefined reference to > `boost::locale::generator::~generator()' > /tmp/ccosf6nV.o: In function `boost::locale::as::date(std::ios_base&)': > main.cpp:(.text._ZN5boost6locale2as4dateERSt8ios_base[boost::locale::as::date(std::ios_base&)]+0x14): > undefined reference to `boost::locale::ios_info::get(std::ios_base&)' > main.cpp:(.text._ZN5boost6locale2as4dateERSt8ios_base[boost::locale::as::date(std::ios_base&)]+0x21): > undefined reference to > `boost::locale::ios_info::display_flags(unsigned long)' > /tmp/ccosf6nV.o: In function > `boost::locale::generator::operator()(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&) > const': > main.cpp:(.text._ZNK5boost6locale9generatorclERKSs[boost::locale::generator::operator()(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&) > const]+0x27): > undefined reference to > `boost::locale::generator::generate(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&) > const' > /tmp/ccosf6nV.o: In function `boost::locale::info const& > std::use_facet<boost::locale::info>(std::locale const&)': > main.cpp:(.text._ZSt9use_facetIN5boost6locale4infoEERKT_RKSt6locale[boost::locale::info > const& std::use_facet<boost::locale::info>(std::locale > const&)]+0xd): > undefined reference to `boost::locale::info::id' > /tmp/ccosf6nV.o: In function `std::basic_ostream<char, > std::char_traits<char> >& boost::locale::operator<< > <char>(std::basic_ostream<char, std::char_traits<char> >&, > boost::locale::date_time const&)': > main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, > std::char_traits<char> >& boost::locale::operator<< > <char>(std::basic_ostream<char, std::char_traits<char> >&, > boost::locale::date_time const&)]+0x18): undefined reference to > `boost::locale::date_time::time() const' > main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, > std::char_traits<char> >& boost::locale::operator<< > <char>(std::basic_ostream<char, std::char_traits<char> >&, > boost::locale::date_time const&)]+0x37): undefined reference to > `boost::locale::ios_info::get(std::ios_base&)' > main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, > std::char_traits<char> >& boost::locale::operator<< > <char>(std::basic_ostream<char, std::char_traits<char> >&, > boost::locale::date_time const&)]+0x3f): undefined reference to > `boost::locale::ios_info::display_flags() const' > main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, > std::char_traits<char> >& boost::locale::operator<< > <char>(std::basic_ostream<char, std::char_traits<char> >&, > boost::locale::date_time const&)]+0x8c): undefined reference to > `boost::locale::ios_info::get(std::ios_base&)' > main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, > std::char_traits<char> >& boost::locale::operator<< > <char>(std::basic_ostream<char, std::char_traits<char> >&, > boost::locale::date_time const&)]+0x99): undefined reference to > `boost::locale::ios_info::display_flags(unsigned long)' > main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, > std::char_traits<char> >& boost::locale::operator<< > <char>(std::basic_ostream<char, std::char_traits<char> >&, > boost::locale::date_time const&)]+0xc4): undefined reference to > `boost::locale::ios_info::get(std::ios_base&)' > main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, > std::char_traits<char> >& boost::locale::operator<< > <char>(std::basic_ostream<char, std::char_traits<char> >&, > boost::locale::date_time const&)]+0xd3): undefined reference to > `boost::locale::ios_info::display_flags(unsigned long)' > collect2: ld returned 1 exit status > > On Thu, Jul 19, 2012 at 11:05 AM, Stanimir Mladenov > <sta...@zo...> wrote: >> Sorry for bothering you! It should be my something wrong with my >> ubuntu development machine, so i will setup a new clean one and i bet >> the problem will disappear. If it doesn't then i will write back >> again. >> >> Actually, this looks to be very common problem, i.e. messing up >> something bad with multiple installations. That's why i am tring to do >> everything in a new virtual machine first, before posting again for >> help. >> >> On Thu, Jul 19, 2012 at 10:54 AM, Artyom Beilis <art...@ya...> > wrote: >>> - What exactly the error? >>> - What symbols are missing? >>> - How exactly do you link? >>> >>> Artyom Beilis >>> -------------- >>> CppCMS - C++ Web Framework: http://cppcms.com/ >>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>> >>> ________________________________ >>> From: Stanimir Mladenov <sta...@zo...> >>> To: CppCMS users group <cpp...@li...> >>> Sent: Monday, July 16, 2012 7:10 PM >>> Subject: [Cppcms-users] Boost locale with icu backend static linking. >>> >>> Boost locale with dynamic linking works just fine. When i try to link >>> it statically i get bunch of unresolved externals. >>> >>> 1. I did try with plain icu api call and static linking. Works. >>> 2. I tried a simple libboost_filesystem api call with static linking. > Works. >>> >>> The only problem is when I try to link libboost_locale statically. >>> Does someone is able to statically link it? >>> >>> Greetings, >>> Stanimir >>> >>> > ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. > Discussions >>> will include endpoint security, mobile security and the latest in > malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >>> >>> > ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. > Discussions >>> will include endpoint security, mobile security and the latest in > malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Stanimir M. <sta...@zo...> - 2012-08-07 14:12:11
|
After i made a simple example for linking with boost_locale statically and building it on a clean machine the problems still exists. It could be something with the link order or something else, that i just can't see. Here are some info for my environment: Ubuntu 12.04 server x86_64 g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 - installed from the repository boost 1.49 - compiled from source and installed $ locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= Here is the example that fails to compile: #include <boost/locale.hpp> #include <boost/locale/date_time.hpp> #include <boost/locale/info.hpp> #include <boost/locale/localization_backend.hpp> #include <string> int main(int argc, char* argv[]) { using namespace boost::locale; generator gen; std::locale l = gen("bg_BG.UTF-8"); std::locale::global(l); std::cout.imbue(l); boost::locale::date_time date = boost::locale::date_time(); std::cout << "info: " << std::use_facet<boost::locale::info>(l).country() << std::endl; std::cout << boost::locale::as::date << date << std::endl; } The expected output must be: info: BG 07.08.2012 Compiling with the following command line for dynamic linking works: g++ main.cpp -o test -lboost_filesystem -lboost_thread -lboost_system -lboost_locale -Wl,-Bdynamic The problematic link for static is: $ g++ -Wl,-Bstatic -lboost_system -lboost_filesystem -lboost_locale -static main.cpp -o test Here is the output of the command line for static: /tmp/ccosf6nV.o: In function `main': main.cpp:(.text+0x21): undefined reference to `boost::locale::generator::generator()' main.cpp:(.text+0xbd): undefined reference to `boost::locale::date_time::date_time()' main.cpp:(.text+0x149): undefined reference to `boost::locale::date_time::~date_time()' main.cpp:(.text+0x161): undefined reference to `boost::locale::generator::~generator()' main.cpp:(.text+0x1c3): undefined reference to `boost::locale::date_time::~date_time()' main.cpp:(.text+0x1e0): undefined reference to `boost::locale::generator::~generator()' /tmp/ccosf6nV.o: In function `boost::locale::as::date(std::ios_base&)': main.cpp:(.text._ZN5boost6locale2as4dateERSt8ios_base[boost::locale::as::date(std::ios_base&)]+0x14): undefined reference to `boost::locale::ios_info::get(std::ios_base&)' main.cpp:(.text._ZN5boost6locale2as4dateERSt8ios_base[boost::locale::as::date(std::ios_base&)]+0x21): undefined reference to `boost::locale::ios_info::display_flags(unsigned long)' /tmp/ccosf6nV.o: In function `boost::locale::generator::operator()(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const': main.cpp:(.text._ZNK5boost6locale9generatorclERKSs[boost::locale::generator::operator()(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const]+0x27): undefined reference to `boost::locale::generator::generate(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /tmp/ccosf6nV.o: In function `boost::locale::info const& std::use_facet<boost::locale::info>(std::locale const&)': main.cpp:(.text._ZSt9use_facetIN5boost6locale4infoEERKT_RKSt6locale[boost::locale::info const& std::use_facet<boost::locale::info>(std::locale const&)]+0xd): undefined reference to `boost::locale::info::id' /tmp/ccosf6nV.o: In function `std::basic_ostream<char, std::char_traits<char> >& boost::locale::operator<< <char>(std::basic_ostream<char, std::char_traits<char> >&, boost::locale::date_time const&)': main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, std::char_traits<char> >& boost::locale::operator<< <char>(std::basic_ostream<char, std::char_traits<char> >&, boost::locale::date_time const&)]+0x18): undefined reference to `boost::locale::date_time::time() const' main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, std::char_traits<char> >& boost::locale::operator<< <char>(std::basic_ostream<char, std::char_traits<char> >&, boost::locale::date_time const&)]+0x37): undefined reference to `boost::locale::ios_info::get(std::ios_base&)' main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, std::char_traits<char> >& boost::locale::operator<< <char>(std::basic_ostream<char, std::char_traits<char> >&, boost::locale::date_time const&)]+0x3f): undefined reference to `boost::locale::ios_info::display_flags() const' main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, std::char_traits<char> >& boost::locale::operator<< <char>(std::basic_ostream<char, std::char_traits<char> >&, boost::locale::date_time const&)]+0x8c): undefined reference to `boost::locale::ios_info::get(std::ios_base&)' main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, std::char_traits<char> >& boost::locale::operator<< <char>(std::basic_ostream<char, std::char_traits<char> >&, boost::locale::date_time const&)]+0x99): undefined reference to `boost::locale::ios_info::display_flags(unsigned long)' main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, std::char_traits<char> >& boost::locale::operator<< <char>(std::basic_ostream<char, std::char_traits<char> >&, boost::locale::date_time const&)]+0xc4): undefined reference to `boost::locale::ios_info::get(std::ios_base&)' main.cpp:(.text._ZN5boost6localelsIcEERSt13basic_ostreamIT_St11char_traitsIS3_EES7_RKNS0_9date_timeE[std::basic_ostream<char, std::char_traits<char> >& boost::locale::operator<< <char>(std::basic_ostream<char, std::char_traits<char> >&, boost::locale::date_time const&)]+0xd3): undefined reference to `boost::locale::ios_info::display_flags(unsigned long)' collect2: ld returned 1 exit status On Thu, Jul 19, 2012 at 11:05 AM, Stanimir Mladenov <sta...@zo...> wrote: > Sorry for bothering you! It should be my something wrong with my > ubuntu development machine, so i will setup a new clean one and i bet > the problem will disappear. If it doesn't then i will write back > again. > > Actually, this looks to be very common problem, i.e. messing up > something bad with multiple installations. That's why i am tring to do > everything in a new virtual machine first, before posting again for > help. > > On Thu, Jul 19, 2012 at 10:54 AM, Artyom Beilis <art...@ya...> wrote: >> - What exactly the error? >> - What symbols are missing? >> - How exactly do you link? >> >> Artyom Beilis >> -------------- >> CppCMS - C++ Web Framework: http://cppcms.com/ >> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> ________________________________ >> From: Stanimir Mladenov <sta...@zo...> >> To: CppCMS users group <cpp...@li...> >> Sent: Monday, July 16, 2012 7:10 PM >> Subject: [Cppcms-users] Boost locale with icu backend static linking. >> >> Boost locale with dynamic linking works just fine. When i try to link >> it statically i get bunch of unresolved externals. >> >> 1. I did try with plain icu api call and static linking. Works. >> 2. I tried a simple libboost_filesystem api call with static linking. Works. >> >> The only problem is when I try to link libboost_locale statically. >> Does someone is able to statically link it? >> >> Greetings, >> Stanimir >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> |
From: Artyom B. <art...@ya...> - 2012-08-07 13:36:43
|
Got FreeBSD 9.0 64 bit, with the configuration you are talking with 4 cores (under VirtualBox)... Can't reproduce it even under high loads. Ok, I think I'll need a program that reproduces the problem, if you want to send it to me privately it is ok. Also few additional points: - what is your config.js file? - what locale do you use? Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: Vinicius Pavanelli <ds...@ha...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Tuesday, August 7, 2012 4:18 PM > Subject: Re: [Cppcms-users] Segmentation fault on FreeBSD in high load > > > Em 07/08/2012, às 04:21, Artyom Beilis escreveu: > >> >> >> >> >>> ________________________________ >>> From: Vinicius Pavanelli <ds...@ha...> >> >>> Thanks for your reply Artyom, >>> >>> >>> I'm checking my code, taking the smaller part that reproduce this > bug to understand it, if needed can send but this only happens on FreeBSD. >>> >>> >>> Is CppCMS under FreeBSD considered ok for production or it's mainly > Linux? >>> >> >> Yes it is production ready and tested on daily basis: >> >> http://cppcms.com/files/nightly-build-report.html >> >> (of course as in any case there may be a bug) >> >> >>> >>> The line at #2 is just: set_content_header("text/html"), > inside http_response.cpp, this looks very strange to me, it's very ok. >>> >> >> Ok, if so this does not related, you are right. >> >> >>> >>> I don't have info.h in my files so i'm assuming it's > booster/booster/locale/info.h, is this correct, >>> >> >> Ok I see. >> >> Also indeed this bug is exactly related. >> >> >> > http://sourceforge.net/tracker/?func=detail&aid=3535893&group_id=209965&atid=1011835 >> >> >> I have several questions: >> >> - What version do you use? Trunk or Stable? (If trunk, does it happens on > stable as well?) > > CppCMS-1.0.1 stable > >> - Do you compile libcppcms with ICU or without? >> - If it is built with ICU, what version? >> > > ICU 4.8.1.1_1 (from packages) > >> - What is the system locale? (output of locale) >> > > freebsd# locale > LANG= > LC_CTYPE="C" > LC_COLLATE="C" > LC_TIME="C" > LC_NUMERIC="C" > LC_MONETARY="C" > LC_MESSAGES="C" > LC_ALL= > > >> - What is the content header returned by the application (when it is not > crashed) > > Content-Type: text/html; charset=utf-8 > >> >> Now about libstdc++. >> >> - What version of GCC do you use, or you are using Clang? >> >> >> Please note: I ask about building CppCMS not your application. >> > > I used both gcc 4.2.1 (20070831) and clang 3.0 (20111021). > >> >> - How many cores does you computer has? > > 4 cores > >> >> - How do you link with libcppcms library statically or dynamically? >> > > Dynamically > >> >> I don't think it is related to threading library it may be a bug >> connected to facets, locking and standard library. > > If I can provide any more info please let me know. > > Thanks for your help Artyom, > >> >> >>> >>> >>> Em 07/08/2012, às 00:57, Artyom Beilis escreveu: >>> >>> See: >>>> >>>> >>>> 1 0x0000000800939cb3 in cppcms::http::response::set_content_header > >> (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >>>> >>>> >>>> It looks like content_type you pass in info.h line 83 has very > strange address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF >>>> It seems strange to me check your code. >>>> >>>> >>>> Artyom Beilis >>>> -------------- >>>> CppCMS - C++ Web Framework: http://cppcms.com/ >>>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>>> >>>> >>>> >>>>> ________________________________ >>>>> From: Vinicius Pavanelli <ds...@ha...> >>>>> To: cpp...@li... >>>>> Sent: Tuesday, August 7, 2012 5:15 AM >>>>> Subject: [Cppcms-users] Segmentation fault on FreeBSD in high > load >>>>> >>>>> Hi, >>>>> >>>>> I'm new to CppCMS and been doing some work on it, too see > where I get. >>>>> When I run the code on Linux/Gentoo it works fine, on FreeBSD > it runs fine too, but on high loads it crashs (like when testing with siege). >>>>> Can anyone help me on what may be wrong with it? It's my > code, something on FreeBSD? >>>>> >>>>> By the way, I got 22k trans/sec with CppCMS on Gentoo, running > the embedded web server, the Apache with static files is way bellow this. >>>>> The performance gain from PHP to CppCMS is very impressive. >>>>> >>>>> Thanks in advance, >>>>> Vinicius >>>>> >>>>> >>>>> System: FreeBSD freebsd 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 > #0: Tue Jun 12 02:52:29 UTC 2012 > ro...@am...:/usr/obj/usr/src/sys/GENERIC amd64 >>>>> >>>>> The gdb log is: >>>>> ---------------------- >>>>> Program received signal SIGSEGV, Segmentation >> fault. >>>>> [Switching to Thread 804807400 (LWP 100101/wep)] >>>>> 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info > () >>>>> (gdb) bt >>>>> #0 0x000000000061d870 in vtable for > __cxxabiv1::__class_type_info () >>>>> #1 0x0000000800939cb3 in > cppcms::http::response::set_content_header (this=0x80ba7ac00, > content_type=@0x7fffffffd590) at info.h:83 >>>>> #2 0x000000080093b90b in response (this=0x80ba7ac00, > context=@0x807bf75b0) at /root/work/cppcms-1.0.1/src/http_response.cpp:116 >>>>> #3 0x000000080094953d in context (this=0x807bf75b0, > conn=Variable "conn" is not available. >>>>> ) at /root/work/cppcms-1.0.1/src/http_context.cpp:58 >>>>> #4 0x0000000800a2dc07 in booster::callback<void > ()(booster::system::error_code const&)>::callable_impl<void, > cppcms::impl::cgi::socket_acceptor<cppcms::impl::cgi::http, > cppcms::impl::cgi::http_creator>::accept_binder>::operator() > (this=Variable "this" is not available. >>>>> ) at >> cgi_acceptor.h:140 >>>>> #5 0x0000000800cf9059 in operator() (this=0x8083feee0, > e=Variable "e" is not available. >>>>> ) at callback.h:211 >>>>> #6 0x0000000800cee189 in booster::callback<void > ()()>::callable_impl<void, > booster::aio::event_loop_impl::event_handler_dispatcher>::operator() > (this=Variable "this" is not available. >>>>> ) >>>>> at callback.h:211 >>>>> #7 0x0000000800cef490 in > booster::aio::event_loop_impl::run_one (this=0x804842200, evs=0x80480e000, > evs_size=128) at callback.h:201 >>>>> #8 0x0000000800cec349 in booster::aio::io_service::run > (this=Variable "this" is not available. >>>>> ) at > /root/work/cppcms-1.0.1/booster/lib/aio/src/io_service.cpp:144 >>>>> #9 0x0000000800918dde in cppcms::service::run > (this=0x7fffffffda80) at /root/work/cppcms-1.0.1/src/service.cpp:574 >>>>> #10 0x000000000040d472 in main (argc=Variable "argc" > is not available. >>>>> ) at >> wep.cpp:167 >>>>> ---------------------- >>>>> >>>>> >>>>> > ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's > security and >>>>> threat landscape has changed and how IT managers can respond. > Discussions >>>>> will include endpoint security, mobile security and the latest > in malware >>>>> threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>> _______________________________________________ >>>>> Cppcms-users mailing list >>>>> Cpp...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>>> >>>>> >>>>> > ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security > and >>>> threat landscape has changed and how IT managers can respond. > Discussions >>>> will include endpoint security, mobile security and the latest in > malware >>>> threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>> >>> > ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. > Discussions >>> will include endpoint security, mobile security and the latest in > malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >>> >> >> >> >> Artyom Beilis >> -------------- >> CppCMS - C++ Web Framework: http://cppcms.com/ >> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> > ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Vinicius P. <ds...@ha...> - 2012-08-07 13:18:37
|
Em 07/08/2012, às 04:21, Artyom Beilis escreveu: > > > > >> ________________________________ >> From: Vinicius Pavanelli <ds...@ha...> > >> Thanks for your reply Artyom, >> >> >> I'm checking my code, taking the smaller part that reproduce this bug to understand it, if needed can send but this only happens on FreeBSD. >> >> >> Is CppCMS under FreeBSD considered ok for production or it's mainly Linux? >> > > Yes it is production ready and tested on daily basis: > > http://cppcms.com/files/nightly-build-report.html > > (of course as in any case there may be a bug) > > >> >> The line at #2 is just: set_content_header("text/html"), inside http_response.cpp, this looks very strange to me, it's very ok. >> > > Ok, if so this does not related, you are right. > > >> >> I don't have info.h in my files so i'm assuming it's booster/booster/locale/info.h, is this correct, >> > > Ok I see. > > Also indeed this bug is exactly related. > > > http://sourceforge.net/tracker/?func=detail&aid=3535893&group_id=209965&atid=1011835 > > > I have several questions: > > - What version do you use? Trunk or Stable? (If trunk, does it happens on stable as well?) CppCMS-1.0.1 stable > - Do you compile libcppcms with ICU or without? > - If it is built with ICU, what version? > ICU 4.8.1.1_1 (from packages) > - What is the system locale? (output of locale) > freebsd# locale LANG= LC_CTYPE="C" LC_COLLATE="C" LC_TIME="C" LC_NUMERIC="C" LC_MONETARY="C" LC_MESSAGES="C" LC_ALL= > - What is the content header returned by the application (when it is not crashed) Content-Type: text/html; charset=utf-8 > > Now about libstdc++. > > - What version of GCC do you use, or you are using Clang? > > > Please note: I ask about building CppCMS not your application. > I used both gcc 4.2.1 (20070831) and clang 3.0 (20111021). > > - How many cores does you computer has? 4 cores > > - How do you link with libcppcms library statically or dynamically? > Dynamically > > I don't think it is related to threading library it may be a bug > connected to facets, locking and standard library. If I can provide any more info please let me know. Thanks for your help Artyom, > > >> >> >> Em 07/08/2012, às 00:57, Artyom Beilis escreveu: >> >> See: >>> >>> >>> 1 0x0000000800939cb3 in cppcms::http::response::set_content_header > (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >>> >>> >>> It looks like content_type you pass in info.h line 83 has very strange address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF >>> It seems strange to me check your code. >>> >>> >>> Artyom Beilis >>> -------------- >>> CppCMS - C++ Web Framework: http://cppcms.com/ >>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>> >>> >>> >>>> ________________________________ >>>> From: Vinicius Pavanelli <ds...@ha...> >>>> To: cpp...@li... >>>> Sent: Tuesday, August 7, 2012 5:15 AM >>>> Subject: [Cppcms-users] Segmentation fault on FreeBSD in high load >>>> >>>> Hi, >>>> >>>> I'm new to CppCMS and been doing some work on it, too see where I get. >>>> When I run the code on Linux/Gentoo it works fine, on FreeBSD it runs fine too, but on high loads it crashs (like when testing with siege). >>>> Can anyone help me on what may be wrong with it? It's my code, something on FreeBSD? >>>> >>>> By the way, I got 22k trans/sec with CppCMS on Gentoo, running the embedded web server, the Apache with static files is way bellow this. >>>> The performance gain from PHP to CppCMS is very impressive. >>>> >>>> Thanks in advance, >>>> Vinicius >>>> >>>> >>>> System: FreeBSD freebsd 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012 ro...@am...:/usr/obj/usr/src/sys/GENERIC amd64 >>>> >>>> The gdb log is: >>>> ---------------------- >>>> Program received signal SIGSEGV, Segmentation > fault. >>>> [Switching to Thread 804807400 (LWP 100101/wep)] >>>> 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >>>> (gdb) bt >>>> #0 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >>>> #1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >>>> #2 0x000000080093b90b in response (this=0x80ba7ac00, context=@0x807bf75b0) at /root/work/cppcms-1.0.1/src/http_response.cpp:116 >>>> #3 0x000000080094953d in context (this=0x807bf75b0, conn=Variable "conn" is not available. >>>> ) at /root/work/cppcms-1.0.1/src/http_context.cpp:58 >>>> #4 0x0000000800a2dc07 in booster::callback<void ()(booster::system::error_code const&)>::callable_impl<void, cppcms::impl::cgi::socket_acceptor<cppcms::impl::cgi::http, cppcms::impl::cgi::http_creator>::accept_binder>::operator() (this=Variable "this" is not available. >>>> ) at > cgi_acceptor.h:140 >>>> #5 0x0000000800cf9059 in operator() (this=0x8083feee0, e=Variable "e" is not available. >>>> ) at callback.h:211 >>>> #6 0x0000000800cee189 in booster::callback<void ()()>::callable_impl<void, booster::aio::event_loop_impl::event_handler_dispatcher>::operator() (this=Variable "this" is not available. >>>> ) >>>> at callback.h:211 >>>> #7 0x0000000800cef490 in booster::aio::event_loop_impl::run_one (this=0x804842200, evs=0x80480e000, evs_size=128) at callback.h:201 >>>> #8 0x0000000800cec349 in booster::aio::io_service::run (this=Variable "this" is not available. >>>> ) at /root/work/cppcms-1.0.1/booster/lib/aio/src/io_service.cpp:144 >>>> #9 0x0000000800918dde in cppcms::service::run (this=0x7fffffffda80) at /root/work/cppcms-1.0.1/src/service.cpp:574 >>>> #10 0x000000000040d472 in main (argc=Variable "argc" is not available. >>>> ) at > wep.cpp:167 >>>> ---------------------- >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>>> >>>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> >> > > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom B. <art...@ya...> - 2012-08-07 07:21:51
|
>________________________________ > From: Vinicius Pavanelli <ds...@ha...> >Thanks for your reply Artyom, > > >I'm checking my code, taking the smaller part that reproduce this bug to understand it, if needed can send but this only happens on FreeBSD. > > >Is CppCMS under FreeBSD considered ok for production or it's mainly Linux? > Yes it is production ready and tested on daily basis: http://cppcms.com/files/nightly-build-report.html (of course as in any case there may be a bug) > >The line at #2 is just: set_content_header("text/html"), inside http_response.cpp, this looks very strange to me, it's very ok. > Ok, if so this does not related, you are right. > >I don't have info.h in my files so i'm assuming it's booster/booster/locale/info.h, is this correct, > Ok I see. Also indeed this bug is exactly related. http://sourceforge.net/tracker/?func=detail&aid=3535893&group_id=209965&atid=1011835 I have several questions: - What version do you use? Trunk or Stable? (If trunk, does it happens on stable as well?) - Do you compile libcppcms with ICU or without? - If it is built with ICU, what version? - What is the system locale? (output of locale) - What is the content header returned by the application (when it is not crashed) Now about libstdc++. - What version of GCC do you use, or you are using Clang? Please note: I ask about building CppCMS not your application. - How many cores does you computer has? - How do you link with libcppcms library statically or dynamically? I don't think it is related to threading library it may be a bug connected to facets, locking and standard library. > > >Em 07/08/2012, às 00:57, Artyom Beilis escreveu: > >See: >> >> >>1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >> >> >>It looks like content_type you pass in info.h line 83 has very strange address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF >>It seems strange to me check your code. >> >> >>Artyom Beilis >>-------------- >>CppCMS - C++ Web Framework: http://cppcms.com/ >>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> >> >>>________________________________ >>> From: Vinicius Pavanelli <ds...@ha...> >>>To: cpp...@li... >>>Sent: Tuesday, August 7, 2012 5:15 AM >>>Subject: [Cppcms-users] Segmentation fault on FreeBSD in high load >>> >>>Hi, >>> >>>I'm new to CppCMS and been doing some work on it, too see where I get. >>>When I run the code on Linux/Gentoo it works fine, on FreeBSD it runs fine too, but on high loads it crashs (like when testing with siege). >>>Can anyone help me on what may be wrong with it? It's my code, something on FreeBSD? >>> >>>By the way, I got 22k trans/sec with CppCMS on Gentoo, running the embedded web server, the Apache with static files is way bellow this. >>>The performance gain from PHP to CppCMS is very impressive. >>> >>>Thanks in advance, >>>Vinicius >>> >>> >>>System: FreeBSD freebsd 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012 ro...@am...:/usr/obj/usr/src/sys/GENERIC amd64 >>> >>>The gdb log is: >>>---------------------- >>>Program received signal SIGSEGV, Segmentation fault. >>>[Switching to Thread 804807400 (LWP 100101/wep)] >>>0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >>>(gdb) bt >>>#0 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >>>#1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >>>#2 0x000000080093b90b in response (this=0x80ba7ac00, context=@0x807bf75b0) at /root/work/cppcms-1.0.1/src/http_response.cpp:116 >>>#3 0x000000080094953d in context (this=0x807bf75b0, conn=Variable "conn" is not available. >>>) at /root/work/cppcms-1.0.1/src/http_context.cpp:58 >>>#4 0x0000000800a2dc07 in booster::callback<void ()(booster::system::error_code const&)>::callable_impl<void, cppcms::impl::cgi::socket_acceptor<cppcms::impl::cgi::http, cppcms::impl::cgi::http_creator>::accept_binder>::operator() (this=Variable "this" is not available. >>>) at cgi_acceptor.h:140 >>>#5 0x0000000800cf9059 in operator() (this=0x8083feee0, e=Variable "e" is not available. >>>) at callback.h:211 >>>#6 0x0000000800cee189 in booster::callback<void ()()>::callable_impl<void, booster::aio::event_loop_impl::event_handler_dispatcher>::operator() (this=Variable "this" is not available. >>>) >>> at callback.h:211 >>>#7 0x0000000800cef490 in booster::aio::event_loop_impl::run_one (this=0x804842200, evs=0x80480e000, evs_size=128) at callback.h:201 >>>#8 0x0000000800cec349 in booster::aio::io_service::run (this=Variable "this" is not available. >>>) at /root/work/cppcms-1.0.1/booster/lib/aio/src/io_service.cpp:144 >>>#9 0x0000000800918dde in cppcms::service::run (this=0x7fffffffda80) at /root/work/cppcms-1.0.1/src/service.cpp:574 >>>#10 0x000000000040d472 in main (argc=Variable "argc" is not available. >>>) at wep.cpp:167 >>>---------------------- >>> >>> >>>------------------------------------------------------------------------------ >>>Live Security Virtual Conference >>>Exclusive live event will cover all the ways today's security and >>>threat landscape has changed and how IT managers can respond. Discussions >>>will include endpoint security, mobile security and the latest in malware >>>threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>_______________________________________________ >>>Cppcms-users mailing list >>>Cpp...@li... >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >>>------------------------------------------------------------------------------ >>Live Security Virtual Conference >>Exclusive live event will cover all the ways today's security and >>threat landscape has changed and how IT managers can respond. Discussions >>will include endpoint security, mobile security and the latest in malware >>threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
From: <ele...@ex...> - 2012-08-07 06:02:51
|
I'd still try to compile all the FBSD libraries that are making the mismatched free/delete with symbols so you can see the line number and investigate further. |
From: <ele...@ex...> - 2012-08-07 05:53:37
|
Nevermind, unless you are using FBSD 10, it should still be using gnu. Sorry for the noise, but it might still be a good idea to cross-post FBSD mailing list. |
From: Vinicius P. <ds...@ha...> - 2012-08-07 05:52:14
|
Hi Petr, I tried that just now, moved to clang to check if it's something with the old gcc in freebsd, but the crash remains. The crash most of the time is after set_content_header, and info.h:83 there's some code about the encoding, maybe something in FreeBSD is different and it crash? Anyway I like FreeBSD for production servers and will try to track it down more, the suspect I had on my code, database and C code for smtp is no more, I reduced the code and only rendering a template will crash it here, it's almost like the tutorial code on templates. Someone else having this give some hope to solve this. Regards, Vinicius Em 07/08/2012, às 02:49, ele...@ex... escreveu: > libstdc++ on freebsd is a fairly new kid on the block. It's a replacement > for GNU stdc++ > > Are you using clang or gcc? try both. I was using gcc 4.1 in the base system. > > Petr > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: <ele...@ex...> - 2012-08-07 05:49:58
|
libstdc++ on freebsd is a fairly new kid on the block. It's a replacement for GNU stdc++ Are you using clang or gcc? try both. I was using gcc 4.1 in the base system. Petr |
From: <ele...@ex...> - 2012-08-07 05:43:46
|
> valgrind says there's some leaks and a lot of Mismatched free(), but I > think it's on FreeBSD libs: > You might want to post it on FBSD mailing lists and/or compile libthr and other related libraries with debugging symbols. Petr |
From: <ele...@ex...> - 2012-08-07 05:39:35
|
> Hi, > > I'm new to CppCMS and been doing some work on it, too see where I get. > When I run the code on Linux/Gentoo it works fine, on FreeBSD it runs fine > too, but on high loads it crashs (like when testing with siege). > Can anyone help me on what may be wrong with it? It's my code, something > on FreeBSD? > Probably related: http://sourceforge.net/tracker/?func=detail&aid=3535893&group_id=209965&atid=1011835 Also on FBSD. I didn't have time to track it down since it happened only once or twice during the 3 months I was working on the application. The production is on Linux and it's all good there. |
From: Vinicius P. <ds...@ha...> - 2012-08-07 05:39:27
|
Em 07/08/2012, às 01:55, augustin escreveu: > On Tuesday, August 07, 2012 11:57:14 AM Artyom Beilis wrote: >> 1 0x0000000800939cb3 in cppcms::http::response::set_content_header >> (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >> >> It looks like content_type you pass in info.h line 83 has very strange >> address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF It seems >> strange to me check your code. > > > High load + high memory address => running out of memory? Memory leak? Loop in > the code filling memory??? > > Check the memory usage on the server. See also what valgrind says... > valgrind says there's some leaks and a lot of Mismatched free(), but I think it's on FreeBSD libs: ==74403== 12 bytes in 1 blocks are definitely lost in loss record 26 of 153 ==74403== at 0x102110B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) ==74403== by 0x2BD7DFD: pthread_mutexattr_init (in /basejail/lib/libthr.so.3) ==74403== by 0x172D42B: booster::recursive_mutex::recursive_mutex() (pthread.cpp:131) ==74403== Mismatched free() / delete / delete [] ==74403== at 0x1020EDE: free (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) ==74403== by 0x13B52E3: cppcms::crypto::key::reset() (crypto.cpp:423) ==74403== by 0x139767C: cppcms::sessions::impl::hmac_factory::~hmac_factory() (hmac_encryptor.h:23) ==74403== by 0x1390AF6: cppcms::session_pool::~session_pool() (memory:259) ==74403== by 0x12D5010: cppcms::impl::service::~service() (memory:259) ==74403== by 0x12D5440: cppcms::service::~service() (hold_ptr.h:27) ==74403== Mismatched free() / delete / delete [] ==74403== at 0x1020EDE: free (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) ==74403== by 0x1C5260C: std::locale::~locale() (in /basejail/usr/lib/libstdc++.so.6) ==74403== by 0x12D4F7E: cppcms::impl::service::~service() (service.cpp:991) ==74403== by 0x12D5440: cppcms::service::~service() (hold_ptr.h:27) I never used valgrind since 2 days ago, by this log there's problems in libstdc++, libthr and something in cppcms too. In Gentoo it don't show any leaks, only some warnings like: ==14171== Use of uninitialised value of size 8 ==14171== at 0x52926C6: booster::aio::io_service::set_timer_event(booster::ptime const&, booster::callback<void (booster::system::error_code const&)> const&) (io_service.cpp:207) ==14171== by 0x5290A63: booster::aio::deadline_timer::async_wait(booster::callback<void (booster::system::error_code const&)> const&) (deadline_timer.cpp:95) ==14171== by 0x4FBD25F: cppcms::impl::cgi::http_watchdog::check(booster::system::error_code const&) (http_api.cpp:728) ==14171== by 0x4FC24AF: cppcms::impl::cgi::http_creator::http_creator(booster::aio::io_service&, cppcms::json::value const&, std::string const&, int) (http_api.cpp:98) ==14171== by 0x4FBD52F: cppcms::impl::cgi::http_api_factory(cppcms::service&, std::string, int, int) (http_api.cpp:740) ==14171== by 0x4EE7B7D: cppcms::service::setup_acceptor(cppcms::json::value const&, int, int) (service.cpp:765) ==14171== by 0x4EE80ED: cppcms::service::start_acceptor(bool) (service.cpp:823) ==14171== by 0x4EEB11C: cppcms::service::run() (service.cpp:557) ==14171== by 0x406D99: main (wep.cpp:167) Sorry for all this verbose logs in the list, if this doesn't help let me know please > Just some thoughts in passing... > > Good luck, > > Augustin. > Thanks for your time, Vinicius > > > -- > Friends: http://www.reuniting.info/ > My projects: > http://astralcity.org/ http://lesenjeux.fr/ http://linux.overshoot.tv/ > http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ > http://openteacher.info/ http://minguo.info/ http://jacqueslemaire.fr/ > http://www.wechange.org/ http://searching911.info/ > > > > > > > > > > > > > . > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Vinicius P. <ds...@ha...> - 2012-08-07 05:21:24
|
Thanks for your reply Artyom, I'm checking my code, taking the smaller part that reproduce this bug to understand it, if needed can send but this only happens on FreeBSD. Is CppCMS under FreeBSD considered ok for production or it's mainly Linux? The line at #2 is just: set_content_header("text/html"), inside http_response.cpp, this looks very strange to me, it's very ok. I don't have info.h in my files so i'm assuming it's booster/booster/locale/info.h, is this correct, The code is very simple, just getting data from mysql with cppdb and rendering a template with the data into a variable, but the dump don't show any of my code in the backtrace. Valgrind shows me a lot of problems in FreeBSD like: ==74403== Mismatched free() / delete / delete [] ==74403== at 0x1020EDE: free (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) ==74403== by 0x1C51DB4: std::locale::_Impl::~_Impl() (in /basejail/usr/lib/libstdc++.so.6) ==74403== by 0x1C5260C: std::locale::~locale() (in /basejail/usr/lib/libstdc++.so.6) ==74403== by 0x12D4F7E: cppcms::impl::service::~service() (service.cpp:991) ==74403== by 0x12D5440: cppcms::service::~service() (hold_ptr.h:27) And sometimes I got this: (gdb) bt #0 0x0000000801281ae4 in std::locale::_Impl::~_Impl () from /usr/lib/libstdc++.so.6 #1 0x000000080128239d in std::locale::~locale () from /usr/lib/libstdc++.so.6 #2 0x000000080092f168 in ~response (this=Variable "this" is not available. ) at basic_ios.h:268 #3 0x0000000800939dbf in ~context (this=0x80e3ffaf0) at memory:259 #4 0x000000080093d802 in booster::detail::sp_counted_impl_p<cppcms::http::context>::dispose (this=Variable "this" is not available. ) at checked_delete.h:30 #5 0x0000000800cee2e9 in booster::detail::sp_counted_base::release (this=0x80f7f9f40) at /root/work/cppcms-1.0.1/booster/lib/smart_ptr/src/sp_counted_base.cpp:272 #6 0x000000080093cf2d in ~callable_impl (this=0x8077c5940) at shared_count.h:115 #7 0x00000008009202d6 in ~callable_impl (this=0x807a8ee70) at intrusive_ptr.h:68 #8 0x0000000800a26adb in ~callable_impl (this=0x80f7f9fd0) at refcounted.h:58 #9 0x0000000800ceb8e7 in ~reader_some (this=0x804bb0040) at refcounted.h:58 #10 0x0000000800cdef1d in ~callable_impl (this=0x804bf90a0) at refcounted.h:58 #11 0x0000000800ce04af in booster::aio::event_loop_impl::run_one (this=0x804842200, evs=0x80480e000, evs_size=128) at refcounted.h:58 #12 0x0000000800cdd349 in booster::aio::io_service::run (this=Variable "this" is not available. ) at /root/work/cppcms-1.0.1/booster/lib/aio/src/io_service.cpp:144 #13 0x0000000800909dde in cppcms::service::run (this=0x7fffffffda88) at /root/work/cppcms-1.0.1/src/service.cpp:574 #14 0x0000000000403b71 in main (argc=3, argv=0x7fffffffdaf8) at wep.cpp:71 Thank you very much for your time, Vinicius Em 07/08/2012, às 00:57, Artyom Beilis escreveu: > See: > > 1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 > > It looks like content_type you pass in info.h line 83 has very strange address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF > It seems strange to me check your code. > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > From: Vinicius Pavanelli <ds...@ha...> > To: cpp...@li... > Sent: Tuesday, August 7, 2012 5:15 AM > Subject: [Cppcms-users] Segmentation fault on FreeBSD in high load > > Hi, > > I'm new to CppCMS and been doing some work on it, too see where I get. > When I run the code on Linux/Gentoo it works fine, on FreeBSD it runs fine too, but on high loads it crashs (like when testing with siege). > Can anyone help me on what may be wrong with it? It's my code, something on FreeBSD? > > By the way, I got 22k trans/sec with CppCMS on Gentoo, running the embedded web server, the Apache with static files is way bellow this. > The performance gain from PHP to CppCMS is very impressive. > > Thanks in advance, > Vinicius > > > System: FreeBSD freebsd 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012 ro...@am...:/usr/obj/usr/src/sys/GENERIC amd64 > > The gdb log is: > ---------------------- > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 804807400 (LWP 100101/wep)] > 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () > (gdb) bt > #0 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () > #1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 > #2 0x000000080093b90b in response (this=0x80ba7ac00, context=@0x807bf75b0) at /root/work/cppcms-1.0.1/src/http_response.cpp:116 > #3 0x000000080094953d in context (this=0x807bf75b0, conn=Variable "conn" is not available. > ) at /root/work/cppcms-1.0.1/src/http_context.cpp:58 > #4 0x0000000800a2dc07 in booster::callback<void ()(booster::system::error_code const&)>::callable_impl<void, cppcms::impl::cgi::socket_acceptor<cppcms::impl::cgi::http, cppcms::impl::cgi::http_creator>::accept_binder>::operator() (this=Variable "this" is not available. > ) at cgi_acceptor.h:140 > #5 0x0000000800cf9059 in operator() (this=0x8083feee0, e=Variable "e" is not available. > ) at callback.h:211 > #6 0x0000000800cee189 in booster::callback<void ()()>::callable_impl<void, booster::aio::event_loop_impl::event_handler_dispatcher>::operator() (this=Variable "this" is not available. > ) > at callback.h:211 > #7 0x0000000800cef490 in booster::aio::event_loop_impl::run_one (this=0x804842200, evs=0x80480e000, evs_size=128) at callback.h:201 > #8 0x0000000800cec349 in booster::aio::io_service::run (this=Variable "this" is not available. > ) at /root/work/cppcms-1.0.1/booster/lib/aio/src/io_service.cpp:144 > #9 0x0000000800918dde in cppcms::service::run (this=0x7fffffffda80) at /root/work/cppcms-1.0.1/src/service.cpp:574 > #10 0x000000000040d472 in main (argc=Variable "argc" is not available. > ) at wep.cpp:167 > ---------------------- > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: augustin <aug...@ov...> - 2012-08-07 04:55:23
|
On Tuesday, August 07, 2012 11:57:14 AM Artyom Beilis wrote: > 1 0x0000000800939cb3 in cppcms::http::response::set_content_header > (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 > > It looks like content_type you pass in info.h line 83 has very strange > address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF It seems > strange to me check your code. High load + high memory address => running out of memory? Memory leak? Loop in the code filling memory??? Check the memory usage on the server. See also what valgrind says... Just some thoughts in passing... Good luck, Augustin. -- Friends: http://www.reuniting.info/ My projects: http://astralcity.org/ http://lesenjeux.fr/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://jacqueslemaire.fr/ http://www.wechange.org/ http://searching911.info/ . |
From: Artyom B. <art...@ya...> - 2012-08-07 03:57:21
|
See: 1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 It looks like content_type you pass in info.h line 83 has very strange address 0x7fffffffd590 - i.e. it is very close to 0x7FFFFFFFF It seems strange to me check your code. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Vinicius Pavanelli <ds...@ha...> >To: cpp...@li... >Sent: Tuesday, August 7, 2012 5:15 AM >Subject: [Cppcms-users] Segmentation fault on FreeBSD in high load > >Hi, > >I'm new to CppCMS and been doing some work on it, too see where I get. >When I run the code on Linux/Gentoo it works fine, on FreeBSD it runs fine too, but on high loads it crashs (like when testing with siege). >Can anyone help me on what may be wrong with it? It's my code, something on FreeBSD? > >By the way, I got 22k trans/sec with CppCMS on Gentoo, running the embedded web server, the Apache with static files is way bellow this. >The performance gain from PHP to CppCMS is very impressive. > >Thanks in advance, >Vinicius > > >System: FreeBSD freebsd 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012 ro...@am...:/usr/obj/usr/src/sys/GENERIC amd64 > >The gdb log is: >---------------------- >Program received signal SIGSEGV, Segmentation fault. >[Switching to Thread 804807400 (LWP 100101/wep)] >0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >(gdb) bt >#0 0x000000000061d870 in vtable for __cxxabiv1::__class_type_info () >#1 0x0000000800939cb3 in cppcms::http::response::set_content_header (this=0x80ba7ac00, content_type=@0x7fffffffd590) at info.h:83 >#2 0x000000080093b90b in response (this=0x80ba7ac00, context=@0x807bf75b0) at /root/work/cppcms-1.0.1/src/http_response.cpp:116 >#3 0x000000080094953d in context (this=0x807bf75b0, conn=Variable "conn" is not available. >) at /root/work/cppcms-1.0.1/src/http_context.cpp:58 >#4 0x0000000800a2dc07 in booster::callback<void ()(booster::system::error_code const&)>::callable_impl<void, cppcms::impl::cgi::socket_acceptor<cppcms::impl::cgi::http, cppcms::impl::cgi::http_creator>::accept_binder>::operator() (this=Variable "this" is not available. >) at cgi_acceptor.h:140 >#5 0x0000000800cf9059 in operator() (this=0x8083feee0, e=Variable "e" is not available. >) at callback.h:211 >#6 0x0000000800cee189 in booster::callback<void ()()>::callable_impl<void, booster::aio::event_loop_impl::event_handler_dispatcher>::operator() (this=Variable "this" is not available. >) > at callback.h:211 >#7 0x0000000800cef490 in booster::aio::event_loop_impl::run_one (this=0x804842200, evs=0x80480e000, evs_size=128) at callback.h:201 >#8 0x0000000800cec349 in booster::aio::io_service::run (this=Variable "this" is not available. >) at /root/work/cppcms-1.0.1/booster/lib/aio/src/io_service.cpp:144 >#9 0x0000000800918dde in cppcms::service::run (this=0x7fffffffda80) at /root/work/cppcms-1.0.1/src/service.cpp:574 >#10 0x000000000040d472 in main (argc=Variable "argc" is not available. >) at wep.cpp:167 >---------------------- > > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |