libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] Possible bug on macOS Sierra


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Possible bug on macOS Sierra
Date: Wed, 28 Feb 2018 22:34:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Try casting the 8*1024*1024 to a "size_t" explicitly. I suspect on your
Mac-Machine, you have maybe a 64-bit size_t and then things go very
wrong if you pass a 32-bit argument.

Note that the microhttpd2-API that I've started to hack on is supposed
to categorically eliminate such API-usage bugs, but it'll take quite
some time to be implemented (main lesson I've learned so far: the change
is HUGE).

Happy hacking!

Christian

On 02/28/2018 12:05 PM, Giovanni Mascellani wrote:
> Dear developers of microhttpd,
> 
> trying to port an application using microhttpd to macOS, I hit a strange
> behaviour. Could you help me understanding whether it is my fault or a
> hint of a bug?
> 
> Consider the attached file micro.c, which is the example on [1] with a
> few modifications in the parameters of MHD_start_daemon. If I compile it
> on Linux (Debian unstable with distributed microhttpd), it works fine.
> 
>  [1] https://www.gnu.org/software/libmicrohttpd/
> 
> If I compile it on macOS Sierra (with microhttpd 0.9.59 from brew), the
> compilation succeeds, but when I execute:
> 
> $ ./micro 1234
> Failed to create listen thread: Resource temporarily unavailable
> 
> However, if I switch MHD_OPTION_NOTIFY_COMPLETED and
> MHD_OPTION_THREAD_STACK_SIZE (together with their arguments), or if I
> remove either of the two, then it compiles and runs correctly. Is this
> the intended behaviour?
> 
> (to my actual case it matters very few, since switching back the two
> options is perfectly fine; however, this seems funny, and I thought that
> you might want to check it thoroughly, if this is not meant to happen)
> 
> Please Cc me when replying, I am not subscribed to the list.
> 
> Thanks for your work on microhttpd!
> 
> Giovanni.
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]