[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

View: New views
11 Messages — Rating Filter:   Alert me  

[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


URL:
  <http://savannah.gnu.org/bugs/?24380>

                 Summary: gv 3.6.6 on Mac OS X: Undefined symbols: _strndup
                 Project: GNU gv
            Submitted by: ryandesign
            Submitted on: Fri 26 Sep 2008 07:39:45 AM GMT
                Category: Sources configuration
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None

    _______________________________________________________

Details:

Trying to compile gv 3.6.6 on Mac OS X 10.4.11 Intel with Xcode 2.5 I get
this:

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
_strndup

3.6.5 did not have this problem.

My understanding based on some brief Google research is that strndup does not
exist on Mac OS X.

http://www.google.com/search?q=strndup+mac






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #24380 (project gv):

                  Status:                    None => In Progress            
             Assigned to:                    None => msteinbo              
                 Release:                    None => 3.6.6                  

    _______________________________________________________

Follow-up Comment #1:

Thanks for the bug report. Obviously the patch from "2008-09-09  Olaf Kirch
<okir@...>" introduces the usage of "strndup". The purpose is to make
calls to sscanf overflow free.

I'll check what can be done soon.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #24380 (project gv):

                  Status:             In Progress => Need Info              

    _______________________________________________________

Follow-up Comment #2:

Could you please add the following code at the beginning of src/secsscanf.c
just after the includes and report me if it helps? If so, I will modify the
configure script to conditionally insert this code if needed.

/* begin test code */
size_t strnlen(const char *s, size_t len)
{
    size_t i;
    for(i=0; i<len && *(s+i); i++);
    return i;
}

char* strndup (char const *s, size_t n)
{
  size_t len = strnlen (s, n);
  char *new = malloc (len + 1);

  if (new == NULL)
    return NULL;

  new[len] = '



Re: [bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Markus Steinborn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For some reason this mail does not contain the full code to insert. On
https://savannah.gnu.org/bugs/?24380 the code is not cropped. I have no
idea why...

On Fri, 26 Sep 2008, Markus Steinborn wrote:

>
> Update of bug #24380 (project gv):
>
>                  Status:             In Progress => Need Info
>
>    _______________________________________________________
>
> Follow-up Comment #2:
>
> Could you please add the following code at the beginning of src/secsscanf.c
> just after the includes and report me if it helps? If so, I will modify the
> configure script to conditionally insert this code if needed.
>
> /* begin test code */
> size_t strnlen(const char *s, size_t len)
> {
>    size_t i;
>    for(i=0; i<len && *(s+i); i++);
>    return i;
> }
>
> char* strndup (char const *s, size_t n)
> {
>  size_t len = strnlen (s, n);
>  char *new = malloc (len + 1);
>
>  if (new == NULL)
>    return NULL;
>
>  new[len] = '
>



[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #3, bug #24380 (project gv):

Yes, that does compile now, thanks!

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #24380 (project gv):

                  Status:               Need Info => Workaround available  

    _______________________________________________________

Follow-up Comment #4:

Thanks. The next release will contain the fix as announced.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #5, bug #24380 (project gv):

Fixed in CVS by providing an strndup implementation called GNU_strndup und
using it instead of strndup.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #6, bug #24380 (project gv):

Can a release be made to correct this?

It is a problem also on Solaris systems as their libc does not implement
strndup.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #7, bug #24380 (project gv):

GNU gv 3.6.7 will be released this weekend.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #8, bug #24380 (project gv):

That's great. Thanks.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #24380] gv 3.6.6 on Mac OS X: Undefined symbols: _strndup

by Jordan Uggla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #24380 (project gv):

                  Status:    Workaround available => Fixed                  
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #9:

GNU gv 3.6.7 has been released. It contains the bug fix, so I can close this
bug.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24380>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/