Opened 18 months ago

Closed 17 months ago

Last modified 16 months ago

#66159 closed defect (fixed)

gdk-pixbuf2 dependents malloc issue (PPC and Intel)

Reported by: barracuda156 Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: leopard, snowleopard Cc: mascguy (Christopher Nielsen)
Port: gdk-pixbuf2

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I get this when installing some gdk-pixbuf dependents:

gdk-pixbuf-query-loaders(9010) malloc: *** error for object 0xa0931034: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(9010) malloc: *** error for object 0xa09310a4: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug

This happens after install, before cleaning build directory. So install succeeds.

gdk-pixbuf is built with gcc-4.2, as we as its dependents are (say, librsvg). So we should not get a double libstdc++ issue as in other malloc errors cases.

What may cause this, any ideas?

UPD. Same error on Intel: comment:ticket:65407:7

Attachments (1)

main.log (912.1 KB) - added by barracuda156 18 months ago.
Build log from Leopard just for the record

Download all attachments as: .zip

Change History (21)

comment:1 Changed 18 months ago by barracuda156

Description: modified (diff)
Summary: gdk-pixbuf dependents malloc issuegdk-pixbuf dependents malloc issue (PPC and Intel)

comment:2 Changed 18 months ago by barracuda156

Keywords: leopard snowleopard added; powerpc removed

comment:3 Changed 18 months ago by kencu (Ken)

Exactly what system? How to reproduce exactly?

I am not getting any errors as yet:

$ uname -a
Darwin LeopardIntelServerVM.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

$ /opt/local/bin/gdk-pixbuf-query-loaders
# GdkPixbuf Image Loader Modules file
# Automatically generated file, do not edit
# Created by gdk-pixbuf-query-loaders from gdk-pixbuf-2.42.9
#
# LoaderDir = /opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders
#
"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.so"
"ani" 4 "gdk-pixbuf" "Windows animated cursor" "LGPL"
"application/x-navi-animation" ""
"ani" ""
"RIFF    ACON" "    xxxx    " 100

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-bmp.so"
"bmp" 5 "gdk-pixbuf" "BMP" "LGPL"
"image/bmp" "image/x-bmp" "image/x-MS-bmp" ""
"bmp" ""
"BM" "" 100

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-gif.so"
"gif" 4 "gdk-pixbuf" "GIF" "LGPL"
"image/gif" ""
"gif" ""
"GIF8" "" 100

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-icns.so"
"icns" 4 "gdk-pixbuf" "MacOS X icon" "GPL"
"image/x-icns" ""
"icns" ""
"icns" "" 100

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ico.so"
"ico" 5 "gdk-pixbuf" "Windows icon" "LGPL"
"image/x-icon" "image/x-ico" "image/x-win-bitmap" "image/vnd.microsoft.icon" "application/ico" "image/ico" "image/icon" "text/ico" ""
"ico" "cur" ""
"  \001   " "zz znz" 100
"  \002   " "zz znz" 100

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-pnm.so"
"pnm" 4 "gdk-pixbuf" "PNM/PBM/PGM/PPM" "LGPL"
"image/x-portable-anymap" "image/x-portable-bitmap" "image/x-portable-graymap" "image/x-portable-pixmap" ""
"pnm" "pbm" "pgm" "ppm" ""
"P1" "" 100
"P2" "" 100
"P3" "" 100
"P4" "" 100
"P5" "" 100
"P6" "" 100

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-qtif.so"
"qtif" 4 "gdk-pixbuf" "QuickTime" "LGPL"
"image/x-quicktime" "image/qtif" ""
"qtif" "qif" ""
"abcdidsc" "xxxx    " 100
"abcdidat" "xxxx    " 100

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tga.so"
"tga" 4 "gdk-pixbuf" "Targa" "LGPL"
"image/x-tga" ""
"tga" "targa" ""
" \001\001" "x  " 100
" \001\t" "x  " 100
"  \002" "xz " 99
"  \003" "xz " 100
"  \n" "xz " 100
"  \v" "xz " 100

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tiff.so"
"tiff" 5 "gdk-pixbuf" "TIFF" "LGPL"
"image/tiff" ""
"tiff" "tif" ""
"MM *" "  z " 100
"II* " "   z" 100
"II* \020   CR\002 " "   z zzz   z" 0

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xbm.so"
"xbm" 4 "gdk-pixbuf" "XBM" "LGPL"
"image/x-xbitmap" ""
"xbm" ""
"#define " "" 100
"/*" "" 50

"/opt/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so"
"xpm" 4 "gdk-pixbuf" "XPM" "LGPL"
"image/x-xpixmap" ""
"xpm" ""
"/* XPM */" "" 100


comment:4 Changed 18 months ago by jmroot (Joshua Root)

Cc: mascguy added
Port: gdk-pixbuf2 added; gdk-pixbuf removed
Summary: gdk-pixbuf dependents malloc issue (PPC and Intel)gdk-pixbuf2 dependents malloc issue (PPC and Intel)

There's no gdk-pixbuf port, assuming you mean gdk-pixbuf2?

comment:5 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

comment:6 in reply to:  4 Changed 18 months ago by barracuda156

Replying to jmroot:

There's no gdk-pixbuf port, assuming you mean gdk-pixbuf2?

I am sorry, yes.

comment:7 in reply to:  3 Changed 18 months ago by barracuda156

Replying to kencu:

Exactly what system? How to reproduce exactly?

I am not getting any errors as yet:

Here someone got it on 10.5 Intel: https://trac.macports.org/ticket/65407#comment:7

As I recall, I am having this issue on literally every PPC system, consistently (that is, 10.5.8, 10A190 and 10.6.8 Rosetta; not sure about Tiger, can check later). I will reboot into Leopard once GTK3 builds and post a log.

comment:8 in reply to:  3 ; Changed 18 months ago by barracuda156

Replying to kencu:

On a side note, we have once discussed meson crossfiles: here is why it is desirable, perhaps, to have strip specified. Since meson is broken for FAT builds: https://github.com/mesonbuild/meson/issues/11034 – I add muniversal PG to gdk-pixbuf2. Then during configure I get this:

WARNING: Cross file does not specify strip binary, result will not be stripped.

comment:9 in reply to:  3 Changed 18 months ago by barracuda156

Replying to kencu:

Exactly what system? How to reproduce exactly?

So I have built it on Leopard now. Build itself looks okay, destroot too. Only when I actually install it, this happens:

x ./opt/local/share/man/man1/gdk-pixbuf-query-loaders.1.gz
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x7fff702e3e88: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x7fff702e3da8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e22c8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e1698: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e15b8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e1628: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e1428: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e12d8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e1198: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e1238: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e1008: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e2148: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e2448: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e2458: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
gdk-pixbuf-query-loaders(3014) malloc: *** error for object 0x1017e2490: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
--->  Cleaning gdk-pixbuf2
--->  Removing work directory for gdk-pixbuf2
--->  Updating database of binaries

(While on 10A190 this error also happens, this is from 10.5.8.)

Changed 18 months ago by barracuda156

Attachment: main.log added

Build log from Leopard just for the record

comment:10 in reply to:  8 ; Changed 18 months ago by kencu (Ken)

Replying to barracuda156:

Replying to kencu:

On a side note, we have once discussed meson crossfiles: here is why it is desirable, perhaps, to have strip specified. Since meson is broken for FAT builds: https://github.com/mesonbuild/meson/issues/11034 – I add muniversal PG to gdk-pixbuf2. Then during configure I get this:

WARNING: Cross file does not specify strip binary, result will not be stripped.

it gives that message, but that does not cause any build errors.

Last edited 18 months ago by kencu (Ken) (previous) (diff)

comment:11 in reply to:  10 Changed 18 months ago by barracuda156

Replying to kencu:

Replying to barracuda156:

Replying to kencu:

On a side note, we have once discussed meson crossfiles: here is why it is desirable, perhaps, to have strip specified. Since meson is broken for FAT builds: https://github.com/mesonbuild/meson/issues/11034 – I add muniversal PG to gdk-pixbuf2. Then during configure I get this:

WARNING: Cross file does not specify strip binary, result will not be stripped.

it gives that message, but that does not cause any build errors.

Fair enough.

What about those malloc ones? Any ideas how to fix those?

comment:12 Changed 18 months ago by kencu (Ken)

your build log from leopard appears to show a successful install with no errors.

I get no errors on Leopard Intel, installing or running.

At the moment, I don’t know how/what/when you see this error. I can’t understand from your posting so far when you see it, and I can’t reproduce it.

comment:13 Changed 18 months ago by kencu (Ken)

perhaps post up one, clean, full, log that shows the error?

comment:14 in reply to:  12 Changed 18 months ago by barracuda156

Replying to kencu:

your build log from leopard appears to show a successful install with no errors.

I get no errors on Leopard Intel, installing or running.

At the moment, I don’t know how/what/when you see this error. I can’t understand from your posting so far when you see it, and I can’t reproduce it.

How do I prevent Macports from deleting logs upon install? The error happens after install, right prior to cleanup.

comment:15 Changed 18 months ago by kencu (Ken)

there is a setting in macports.conf for that, I recall

comment:16 in reply to:  15 Changed 18 months ago by barracuda156

Replying to kencu:

there is a setting in macports.conf for that, I recall

Ok, will try. (There probably won’t be much more though besides of what I quoted above.)

comment:17 Changed 17 months ago by kencu (Ken)

OK, I bumped into this finally on a Leopard Intel system and may have sorted it out.

gdk-pixbuf2 builds on that system with gcc-4.2, but still throws the malloc error that you see when using the new libstdc++ in gcc7.5+.

This is a bit of a weird situation, because as far as I can see (looking quickly), there is no c++ code anywhere in gdk-pixbuf2. But somewhere, one of the libraries it links to must invoke some, because crash it does.

So we need to do the legacysupport binwrapping trick on the gdk-pixbuf2 binaries. But legacysupport never anticipated this case, so it tries to block you, thinking you're out of your mind perhaps, by making sure you're only binwrapping if the stdlib=macports-libstdc++.

So to allow the binwrapping to work, we have to tell MacPorts that is what we are doing, and then it can work, the bins are wrapped, and all works well.

Adding this to the gdk-pixbuf2 portfile fixes the bins, in the end:

PortGroup           legacysupport 1.1

legacysupport.newest_darwin_requires_legacy 10
legacysupport.redirect_bins gdk-pixbuf-csource gdk-pixbuf-pixdata gdk-pixbuf-query-loaders gdk-pixbuf-thumbnailer
compiler.cxx_standard 2011

And then this works again without crashing:

$ sudo gdk-pixbuf-query-loaders --update-cache

Now, everyone is going to find it completely stupid to set compiler.cxx_standard 2011 on a port that only uses "C", so we probably have to come up with some new plan on how to enable that.

Or just copy-paste the post-destroot into the portfile and tweak it so it works. But here I defer to the maintainer, as no point wasting time on something that won't get committed.

And now, a whole new chapter in the malloc: *** error for object 0x1017e2458: Non-aligned pointer being freed saga opens.

comment:18 Changed 17 months ago by kencu (Ken)

for those who wish to try this more easily:

https://github.com/macports/macports-ports/pull/16901

comment:19 Changed 17 months ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 15b554df23131d2b73c8d1eeaa5d5c4eac630400/macports-ports (master):

gdk-pixbuf2: binwrap bins when needed

prevents malloc errors with newer versions of libstdc++

closes: #66159

comment:20 in reply to:  19 Changed 16 months ago by barracuda156

Replying to kencu:

Thank you!

(Sorry that I dropped out of most discussions recently: travelling and therefore away from most of development work, and also busy with sorting out that huge PR for R.)

Note: See TracTickets for help on using tickets.