Reporting unix VM bugs (was: [Vm-dev] Compiling Interpreter VM on FreeBSD)

Frank Shearar frank.shearar at gmail.com
Thu Jan 10 14:01:00 UTC 2013


Hi Ian,

I've attached a patched sqUnixUUID.c, which rationalises the includes
of UUID libraries: you now won't have BOTH the sys/uuid AND uuid/uuid
libs included, should your machine happen to have both.

Eliot has already applied this change to the Cog VM branch.

Thanks!

On 10 January 2013 13:31, David T. Lewis <lewis at mail.msen.com> wrote:
>
> On Thu, Jan 10, 2013 at 12:43:45PM +0000, Frank Shearar wrote:
>>
>> On 8 January 2013 09:21, Frank Shearar <frank.shearar at gmail.com> wrote:
>> > On 8 January 2013 08:30, Frank Shearar <frank.shearar at gmail.com> wrote:
>> >> On 7 January 2013 22:41, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> >>>
>> >>> Surely we'd want to write it thus:?
>> >>>
>> >>> #if defined(HAVE_SYS_UUID_H)
>> >>> # include <sys/types.h>
>> >>> # include <sys/uuid.h>
>> >>> #elif defined(HAVE_UUID_UUID_H)
>> >>> # include <uuid/uuid.h>
>> >>> #elif defined(HAVE_UUID_H)
>> >>> # include <uuid.h>
>> >>> #else
>> >>> # error cannot find a uuid.h to include
>> >>> #endif
>> >>
>> >> Er yes, what you said :) I touch C code maybe once a year, hence my
>> >> incompetence!
>> >
>> > Also, with the #elif change in place, make runs to completion. I'm not
>> > sure how well the resulting VM works yet. Running this:
>> >
>> >   ./squeak -vm-sound-null -vm-display-null Squeak4.4.image 3+4.st
>> >
>> > where 3+4.st is
>> >
>> > FileStream stdout nextPutAll: (3 + 4) printString; flush.
>> >
>> > results in something saying "CHECKING squeakvm", but nothing
>> > completes, and I get no output. That might be just because I don't
>> > know what I'm doing.
>>
>> What can I do to help get this fix into the Interpreter branch?
>> Squeak-vm-unix-4.10.9-2663 still has the broken sys+userland ifdefs.
>>
>> frank
>
> Send email with a full copy of the the patched file to Ian Piumarta
> at ian at speakeasy.net. Ian is the author of the Unix VM and also maintains
> the unix platforms source tree.
>
>
> See the "reporting bugs" paragraph on the unix page of squeakvm.org:
>
>   http://squeakvm.org/unix/download.html#caveats
>
> Actually, I just noticed that the web page says to send the email to
> ian at vpri.org, but I know that ian commonly uses the ian at speakeasy.net
> address. I will CC him at both addresses just in case this is a mistake
> on the web page.
>
> Dave
>
>
>
>
>>
>> >
>> >> frank
>> >>
>> >>> On Mon, Jan 7, 2013 at 4:31 AM, Frank Shearar <frank.shearar at gmail.com> wrote:
>> >>>>
>> >>>>
>> >>>> On 3 January 2013 00:35, David T. Lewis <lewis at mail.msen.com> wrote:
>> >>>> >
>> >>>> > On Wed, Jan 02, 2013 at 07:22:42PM +0000, Frank Shearar wrote:
>> >>>> >>
>> >>>> >> I'm setting up more CI jobs, this time to give FreeBSD some love. So I
>> >>>> >> have a script that gets the bleeding edge Interpreter source, cd
>> >>>> >> platform/unix; make. The results are here:
>> >>>> >> http://squeakci.org/job/InterpreterVM-FreeBSD/13/console
>> >>>> >>
>> >>>> >> The punchline is that compilation fails thusly:
>> >>>> >>
>> >>>> >> In file included from
>> >>>> >> /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:9:
>> >>>> >> /usr/local/include/uuid/uuid.h:44: error: conflicting types for 'uuid_t'
>> >>>> >> /usr/include/sys/uuid.h:74: error: previous declaration of 'uuid_t' was here
>> >>>> >
>> >>>> > Frank,
>> >>>> >
>> >>>> > The error message above looks mighty suspicious to me. Where did that
>> >>>> > /usr/local/include/uuid/uuid.h come from? I have a hunch that you may
>> >>>> > have a locally installed libuuid package that is providing a header
>> >>>> > file that conflicts with a /usr/include/sys/uuid.h that came with your
>> >>>> > base FreeBSD distribution.
>> >>>>
>> >>>> If I adjust sqUnixUUID.c in this fashion:
>> >>>>
>> >>>>
>> >>>> #if defined(HAVE_SYS_UUID_H)
>> >>>> # include <sys/types.h>
>> >>>> # include <sys/uuid.h>
>> >>>> #endif
>> >>>>
>> >>>> + #if !(defined(HAVE_SYS_UUID_H)) && defined(HAVE_UUID_UUID_H)
>> >>>> - #if defined(HAVE_UUID_UUID_H)
>> >>>> # include <uuid/uuid.h>
>> >>>> #elif defined(HAVE_UUID_H)
>> >>>> # include <uuid.h>
>> >>>> #endif
>> >>>>
>> >>>> I can happily compile the UUID plugin! I think the issue arises for me
>> >>>> because config finds BOTH sys/uuid.h AND uuid/uuid.h.
>> >>>>
>> >>>> frank
>> >>>>
>> >>>> > I'm pretty sure that libuuid is entitled to some sort of Guiness world record
>> >>>> > for greatest number of stupid preventable bugs for a single small system
>> >>>> > library. The proliferation of include/uuid/uuid.h versus include/sys/uuid.h
>> >>>> > mismatches is a big part of it, but read our very own Mantis tale of woe for
>> >>>> > further entertainment:
>> >>>> >
>> >>>> > http://bugs.squeak.org/view.php?id=7358
>> >>>> >
>> >>>> > Dave
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> >> /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:
>> >>>> >> In function 'MakeUUID':
>> >>>> >> /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:29:
>> >>>> >> warning: passing argument 1 of 'uuidgen' from incompatible pointer
>> >>>> >>
>> >>>> >> The relevant source is here:
>> >>>> >>
>> >>>> >>
>> >>>> >> int MakeUUID(char *location)
>> >>>> >> {
>> >>>> >> #if defined(HAVE_UUID_CREATE) && !defined(HAVE_UUIDGEN) &&
>> >>>> >> !defined(HAVE_UUID_GENERATE)
>> >>>> >>   size_t  len= 16;      /* 128 bits */
>> >>>> >>   uuid_t *uuid;
>> >>>> >>   uuid_create(&uuid);
>> >>>> >>   uuid_make(uuid, UUID_MAKE_V1);
>> >>>> >>   uuid_export(uuid, UUID_FMT_BIN, (void **)&location, &len);
>> >>>> >>   uuid_destroy(uuid);
>> >>>> >> #else
>> >>>> >>   uuid_t uuid;
>> >>>> >> #  if defined(HAVE_UUIDGEN)
>> >>>> >>   uuidgen(&uuid, 1);   // <-- this is line 29, the offender
>> >>>> >> #  elif defined(HAVE_UUID_GENERATE)
>> >>>> >>   uuid_generate(uuid);
>> >>>> >> #  endif
>> >>>> >>   memcpy((void *)location, (void *)&uuid, sizeof(uuid));
>> >>>> >> #endif
>> >>>> >>   return 1;
>> >>>> >> }
>> >>>> >>
>> >>>> >> Any ideas? I'm happy to do legwork, but Bozhe moi! This I know from nothing!
>> >>>> >>
>> >>>> >> frank
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> best,
>> >>> Eliot
>> >>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqUnixUUID.c
Type: text/x-csrc
Size: 1642 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20130110/04263929/sqUnixUUID.c


More information about the Vm-dev mailing list