Question about glibmm/Glib::ustring::format


I believe this is the correct list for glibmm related questions.

I am having an issue with a program crashing, which uses libglibmm. I
believe I've narrowed the problem down to Glib::ustring::format, and made
a simple test program. When the test program runs it crashes.

glibmm on this machine is glibmm-2.4

The compiler is clang, however I seem to get the same results using gcc 4.8.

Here's my sample test and results:

#include <iostream>
#include <iomanip>
#include <glibmm.h>

int main() {

        double value = 22.0 / 7.0;
        std::cout << value << std::endl;
        Glib::ustring test =
        std::cout << test << std::endl;


$ clang++ -o testglib `pkg-config --cflags --libs glibmm-2.4` testglib.cpp
$ ./testglib
Abort trap (core dumped)

$ /usr/local/bin/gdb testglib
GNU gdb (GDB) 7.6.2 [GDB v7.6.2 for FreeBSD]
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd11.0".
For bug reporting instructions, please see:
Reading symbols from /usr/home/waitman/testglib...done.
(gdb) run
Starting program: /usr/home/waitman/testglib
[New LWP 100327]
[New Thread 803006400 (LWP 100327)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 803006400 (LWP 100327)]
0x0000000801e313ba in kill () from /lib/
(gdb) bt
#0  0x0000000801e313ba in kill () from /lib/
#1  0x0000000801e30069 in abort () from /lib/
#2  0x00000008016ce7da in ?? () from /lib/
#3  0x000000080085de68 in Glib::ConvertError::throw_func(_GError*) ()
   from /usr/local/lib/
#4  0x000000080086ed2f in Glib::Error::throw_exception(_GError*) ()
   from /usr/local/lib/
#5  0x000000080087bcc2 in Glib::ustring::FormatStream::to_string() const ()
   from /usr/local/lib/
#6  0x0000000000401de0 in Glib::ustring::format<std::__1::ios_base&
(std::__1::ios_base&), std::__1::__iom_t5, double>(std::__1::ios_base& (
const&)(std::__1::ios_base&), std::__1::__iom_t5 const&, double const&) (
    a1= 0x401e50: {std::__1::ios_base &(std::__1::ios_base &)} 0x401e50
<std::__1::fixed(std::__1::ios_base&)>, a2=..., a3= 0x7fffffffd860:
    at /usr/local/include/glibmm-2.4/glibmm/ustring.h:1158
#7  0x0000000000401696 in main () at testglib.cpp:9

maybe relevant information?

$ uname -a
FreeBSD 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r261643:
Sat Feb  8 22:11:05 PST 2014    
root akira waitman net:/usr/obj/usr/src/sys/AKIRA  amd64

$ ldd testglib
testglib: => /usr/local/lib/ (0x80081e000) => /usr/local/lib/ (0x800a9d000) => /usr/local/lib/ (0x800cea000) => /usr/local/lib/ (0x800ff2000) => /usr/local/lib/ (0x8011fb000) => /usr/lib/ (0x801400000) => /lib/ (0x8016be000) => /lib/ (0x8018d8000) => /lib/ (0x801b00000) => /lib/ (0x801d0d000) => /usr/local/lib/ (0x80208a000) => /usr/local/lib/ (0x802291000) => /usr/local/lib/ (0x802494000) => /lib/ (0x8026fb000)

I've tried various tests from examples which use ::format, they all seem
to crash. Does anyone have any idea/suggestions for troubleshooting?

Thank you,

Waitman Gobble
San Jose California USA

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