Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 21 Feb 2014 17:03:36 +0100
From: Daniel Cegiełka <daniel.cegielka@...il.com>
To: musl@...ts.openwall.com
Subject: Re: Re: Removing sbrk and brk

And what do we do with failures when sbrk is used?

# grep -r sbrk /usr/bin/
Binary file /usr/bin/readelf matches
Binary file /usr/bin/as matches
Binary file /usr/bin/addr2line matches
Binary file /usr/bin/c++filt matches
Binary file /usr/bin/ld matches
Binary file /usr/bin/objdump matches
Binary file /usr/bin/size matches
Binary file /usr/bin/ar matches
Binary file /usr/bin/objcopy matches
Binary file /usr/bin/elfedit matches
Binary file /usr/bin/strings matches
Binary file /usr/bin/ld.bfd matches
Binary file /usr/bin/strip matches
Binary file /usr/bin/gdb matches
Binary file /usr/bin/nm matches
Binary file /usr/bin/ranlib matches


eg ex/vi doesn't work with new musl (git) - sbrk is used internally:

http://ex-vi.cvs.sourceforge.net/viewvc/ex-vi/ex-vi/ex_subr.c?revision=1.8&view=markup

481int
482morelines(void)
483{
484#ifdef _SC_PAGESIZE
485 static long pg;
486
487 if (pg == 0) {
488 pg = sysconf(_SC_PAGESIZE);
489 if (pg <= 0 || pg >= 65536)
490 pg = 4096;
491 pg /= sizeof (line);
492 }
493 if ((char *)sbrk(pg * sizeof (line)) == (char *)-1)
494 return (-1);
495 endcore += pg;
496 return (0);
497#else /* !_SC_PAGESIZE */
498 if (sbrk(1024 * sizeof (line)) == (char *)-1)
499 return (-1);
500 endcore += 1024;
501 return (0);
502#endif /* !_SC_PAGESIZE */
503}

and

http://ex-vi.cvs.sourceforge.net/viewvc/ex-vi/ex-vi/ex.c?revision=1.4&view=markup

532 fendcore = (line *) sbrk(0);
533 endcore = fendcore - 2;

and errors (vi) didn't indicate what failing.

Best regards,
Daniel

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.