unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Douglas Mencken <dougmencken@gmail.com>
Cc: bug-guile@gnu.org
Subject: Re: build errors: 9172 Broken pipe and 9173 Segmentation fault
Date: Sat, 16 Apr 2011 22:34:40 -0400	[thread overview]
Message-ID: <87mxjp4ncv.fsf@netris.org> (raw)
In-Reply-To: <BANLkTik8yKovzgB=EXytqxL3cggL4-cbNA@mail.gmail.com> (Douglas Mencken's message of "Sat, 16 Apr 2011 13:19:55 +0200")

[-- Attachment #1: Type: text/plain, Size: 1450 bytes --]

Douglas Mencken <dougmencken@gmail.com> writes:
> #3  0x480e0f44 in scm_decoding_error (subr=<value optimized out>,
> err=38, message=<value optimized out>, port=<value optimized out>) at
> strings.c:1438
> #4  0x480e1190 in scm_from_stringn (str=0x48128754 ������, len=<value
> optimized out>, encoding=<value optimized out>, handler=<value
> optimized out>) at strings.c:1494
> #5  0x480e11e8 in scm_from_locale_stringn (str=0x48128754 ������,
> len=<value optimized out>) at strings.c:1535
> #6  0x480e7304 in scm_from_locale_symboln (sym=<value optimized out>,
> len=<value optimized out>) at symbols.c:444
> #7  0x480e7328 in scm_from_locale_symbol (sym=<value optimized out>)
> at symbols.c:438
> #8  0x48050410 in scm_init_array_handle () at array-handle.c:138

Douglas and I did some investigation over this over IRC, and discovered
that this problem is not within Guile.  On his platform (uClibc on
PowerPC, using GCC 4.6.0 and libunistring-0.9.3) u32_conv_from_encoding
does not work correctly, as demonstrated by the attached minimal C
program, which is not linked with Guile.

In particular, the following call returns NULL on his platform:

  uint32_t *result;
  size_t result_size;
  result = u32_conv_from_encoding ("ASCII", iconveh_question_mark,
                                   "a", 1,
                                   NULL, NULL, &result_size);

     Best,
      Mark



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Example of libunistring failure on uClibc/PPC --]
[-- Type: text/x-csrc, Size: 706 bytes --]

/* but first, write a little minimal C program that calls u32_conv_from_encoding 
 * with the same parameters used here:
 * fromcode=="ASCII", handler==iconveh_question_mark, src=="a", srclen==1, offsets==NULL, 
 * resultbuf==NULL, and lengthp should be a pointer to a size_t variable
 */

#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>

#include <uniconv.h>
#include <unistring/iconveh.h>

static const char a_str[] = { 0x61, 0x00 };

int
main (int argc, char *argv[])
{
  uint32_t *result;
  size_t some_size;
  
  result = u32_conv_from_encoding ("ASCII", iconveh_question_mark,
				   a_str, 1,
				   NULL, NULL, &some_size);

  printf ("result = %p\n", result);

  return EXIT_SUCCESS;
}

  parent reply	other threads:[~2011-04-17  2:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24  1:05 build errors: 9172 Broken pipe and 9173 Segmentation fault Douglas Mencken
2011-03-24  1:45 ` Neil Jerram
     [not found]   ` <AANLkTindvcPaJ4qYr7OCvWbitFCzb2oALNO1ya6x0_Y4@mail.gmail.com>
2011-03-29 17:07     ` Douglas Mencken
2011-04-01  9:08       ` Andy Wingo
2011-04-16 11:19         ` Douglas Mencken
2011-04-16 16:01           ` Andy Wingo
2011-04-17  2:34           ` Mark H Weaver [this message]
2011-04-18 21:16             ` Ludovic Courtès
2011-04-18 23:45               ` Mark H Weaver
2011-04-21 10:28                 ` Andy Wingo
2011-04-17  2:38           ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxjp4ncv.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=bug-guile@gnu.org \
    --cc=dougmencken@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).