Hello,

It'd be nice if it showed an error and aborted cleanly instead of segfaulting.

However, at this stage, Wt cannot do anything to avoid segfaults: if I
try to write to some file and my code does not catch exceptions or
check the return code from the ofstream, the application will
segfault. It'd be easy to modify the example to catch the exception
and show some useful message like "docroot is not writable".

Ideally, libwt would be able to intercept fopen, fwrite, etc in libc
and redirect them to the docroot directory. Some LD_PRELOAD (Unix) or
SetWindowHookEx (Windows) magic would be needed for that. This would
be a very nice Summer of Code project, in my opinion.

On Thu, Nov 4, 2010 at 7:46 PM, Dmitriy Igrishin <[email protected]> wrote:
> Hey John and Pau,
>
> I think, that it should warn about it aborting with a message
> "Directory is not writable". But finishing with just segmentation
> fault seems to me bad.
> Pau can we do something with it ?
>
> 2010/11/4 Pau Garcia i Quiles <[email protected]>
>>
>> Hello,
>>
>> It's because /usr/share/doc/libwt-doc/examples/charts is not writable
>> by user 'john'. Try running the example with 'sudo', or copying
>> /usr/share/doc/libwt-doc/examples/charts to some other place where you
>> have write permissions.
>>
>> On Thu, Nov 4, 2010 at 6:44 PM, John Robson <[email protected]> wrote:
>> > Lately I'm having this error.
>> >
>> > j...@desktop:/usr/share/doc/libwt-doc/examples/charts$
>> > /home/john/Tmp/examples/charts/charts.wt --http-port 10000 --http-addr
>> > 0.0.0.0 --docroot .
>> > [2010-Nov-04 15:34:44.011235] 10637 - [notice] "Wt: initializing
>> > built-in httpd"
>> > [2010-Nov-04 15:34:44.011371] 10637 - [notice] "Reading Wt config
>> > file: /etc/wt/wt_config.xml (location =
>> > '/home/john/Tmp/examples/charts/charts.wt')"
>> > Segmentation fault
>> >
>> > Does anyone know how to solve?
>> >
>> > Tks,
>> > John
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > The Next 800 Companies to Lead America's Growth: New Video Whitepaper
>> > David G. Thomson, author of the best-selling book "Blueprint to a
>> > Billion" shares his insights and actions to help propel your
>> > business during the next growth cycle. Listen Now!
>> > http://p.sf.net/sfu/SAP-dev2dev
>> > _______________________________________________
>> > witty-interest mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/witty-interest
>> >
>>
>>
>>
>> --
>> Pau Garcia i Quiles
>> http://www.elpauer.org
>> (Due to my workload, I may need 10 days to answer)
>>
>>
>> ------------------------------------------------------------------------------
>> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
>> David G. Thomson, author of the best-selling book "Blueprint to a
>> Billion" shares his insights and actions to help propel your
>> business during the next growth cycle. Listen Now!
>> http://p.sf.net/sfu/SAP-dev2dev
>> _______________________________________________
>> witty-interest mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
>
> --
> // Dmitriy.
>
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to