Opened 5 years ago

Closed 5 years ago

#22159 closed enhancement (fixed)

Upgrade to libpng 1.6.29

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.0
Component: packages: standard Keywords: atelierpari2017
Cc: jpflori, frederichan Merged in:
Authors: Jeroen Demeyer, Jean-Pierre Flori Reviewers: Jean-Pierre Flori, Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: aa28f4c (Commits, GitHub, GitLab) Commit: aa28f4cba1d7589b5b3bd970311981c5fb9bf04d
Dependencies: #22163 Stopgaps:

Status badges

Change History (33)

comment:1 Changed 5 years ago by jdemeyer

  • Branch set to u/jdemeyer/upgrade_to_latest_libpng

comment:2 Changed 5 years ago by git

  • Commit set to f8bbf6914962e0f017a39b9b33795dd1802112a5

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f8bbf69Upgrade to libpng-1.6.28

comment:3 Changed 5 years ago by git

  • Commit changed from f8bbf6914962e0f017a39b9b33795dd1802112a5 to 7467913b56d7ac5deefb7bd3abc0b9ed62265b6d

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

7467913Upgrade to libpng-1.6.28

comment:4 Changed 5 years ago by jdemeyer

  • Status changed from new to needs_review

comment:5 Changed 5 years ago by jpflori

  • Reviewers set to Jean-Pierre Flori
  • Status changed from needs_review to positive_review

Looks good to me. Let the patchbots do their job.

comment:6 Changed 5 years ago by jdemeyer

  • Dependencies set to #22163

comment:7 Changed 5 years ago by jdemeyer

  • Status changed from positive_review to needs_work

I have some doubts regarding giac. Setting this back to needs_work for now...

comment:8 Changed 5 years ago by jdemeyer

  • Keywords atelierpari2017 added

comment:9 Changed 5 years ago by jpflori

  • Status changed from needs_work to positive_review

comment:10 Changed 5 years ago by vbraun

  • Status changed from positive_review to needs_work

Fails in giac

[giac-1.2.2.103] /bin/bash ../libtool --tag=CXX   --mode=link g++  -g -O2 -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS  -L/home/buildbot/slave/sage_git/build/local/lib -Wl,-rpath,/home/buildbot/slave/sage_git/build/local/lib  -o aide aide.o libxcas.la -lreadline  -ldl -lpng -lm -lmpfi -lmpfr -lgmp  -lgsl -lgslcblas  -lrt -lpthread -ldl -lpng -lm -lmpfi -lmpfr -lgmp 
25420[giac-1.2.2.103] libtool: link: g++ -g -O2 -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -Wl,-rpath -Wl,/home/buildbot/slave/sage_git/build/local/lib -o .libs/aide aide.o  -L/home/buildbot/slave/sage_git/build/local/lib ./.libs/libxcas.a /home/buildbot/slave/sage_git/build/local/var/tmp/sage/build/giac-1.2.2.103/src/src/.libs/libgiac.so -lntl -lpari -lreadline -lgsl -lgslcblas -lrt -lpthread -ldl -lpng -lm -lmpfi -lmpfr -lgmp -Wl,-rpath -Wl,/home/buildbot/slave/sage_git/build/local/lib
25421[giac-1.2.2.103] /home/buildbot/slave/sage_git/build/local/var/tmp/sage/build/giac-1.2.2.103/src/src/.libs/libgiac.so: undefined reference to `png_set_longjmp_fn'
25422[giac-1.2.2.103] collect2: error: ld returned 1 exit status
25423[giac-1.2.2.103] Makefile:574: recipe for target 'icas' failed
25424[giac-1.2.2.103] make[5]: *** [icas] Error 1
25425[giac-1.2.2.103] /home/buildbot/slave/sage_git/build/local/var/tmp/sage/build/giac-1.2.2.103/src/src/.libs/libgiac.so: undefined reference to `png_set_longjmp_fn'
25426[giac-1.2.2.103] collect2: error: ld returned 1 exit status
25427[giac-1.2.2.103] Makefile:571: recipe for target 'aide' failed

comment:11 Changed 5 years ago by jdemeyer

Is this using ccache? I remember a similar error where it turned out to be a ccache bug. Just to be sure, could you try again with CCACHE_DISABLE=1?

comment:12 Changed 5 years ago by vbraun

Also happens on buildbot without ccache

comment:13 Changed 5 years ago by jdemeyer

OK, thanks for the info.

comment:14 Changed 5 years ago by jdemeyer

  • Cc frederichan added

comment:15 Changed 5 years ago by frederichan

On fedora 25 where my system libpng is 1.6.27 I was able to built giac with your libpng 1.6.28.

On a debian system with libpng12 installed I was able to reproduce the above error.

But cd in src/src/.libs and edit libgiac.la with -lpng16 instead of -lpng and I was able to end the built.

Does it worth a patch (do you have a similar pb elsewhere?) or should I ask parisse if it is possible to add a --disable-png in configure?

comment:17 follow-up: Changed 5 years ago by frederichan

I have configured giac with --disable-png in #22101 so this should not happen anymore with the 1.2.3.25 giac spkg

comment:18 in reply to: ↑ 17 ; follow-up: Changed 5 years ago by tmonteil

Replying to frederichan:

I have configured giac with --disable-png in #22101 so this should not happen anymore with the 1.2.3.25 giac spkg

I would be +1 for the patch as well, since i need to compile giac with png and fltk support for Sage Debian Live, since i provide xcas through Sage. So, if it is possible, it is better to fix the issue than to skip it.

comment:19 in reply to: ↑ 18 ; follow-up: Changed 5 years ago by frederichan

Replying to tmonteil:

Replying to frederichan:

I have configured giac with --disable-png in #22101 so this should not happen anymore with the 1.2.3.25 giac spkg

I would be +1 for the patch as well, since i need to compile giac with png and fltk support for Sage Debian Live, since i provide xcas through Sage. So, if it is possible, it is better to fix the issue than to skip it.

The problem occurs when you have a libpng12 system wide installed and sage libpng1.6. If you built giac with the system wide libpng12 then I guess that you will have the same error as in comment 10. Are you using 2 libpng in sage debian live? Now if you built giac with -lpng16 instead of -lpng I don't know if it will work with your fltk because I guess it is linked to the system libpng12?

comment:20 in reply to: ↑ 19 ; follow-up: Changed 5 years ago by tmonteil

Replying to frederichan:

The problem occurs when you have a libpng12 system wide installed and sage libpng1.6. If you built giac with the system wide libpng12 then I guess that you will have the same error as in comment 10. Are you using 2 libpng in sage debian live? Now if you built giac with -lpng16 instead of -lpng I don't know if it will work with your fltk because I guess it is linked to the system libpng12?

Indeed: apt-rdepends libfltk1.3-dev | grep -E '^[a-zA-Z0-9]' | grep png leads to libpng12-0 Fortunately, the next Debian stable will ship libpng16.

comment:21 in reply to: ↑ 20 ; follow-up: Changed 5 years ago by frederichan

Replying to tmonteil:

Replying to frederichan:

The problem occurs when you have a libpng12 system wide installed and sage libpng1.6. If you built giac with the system wide libpng12 then I guess that you will have the same error as in comment 10. Are you using 2 libpng in sage debian live? Now if you built giac with -lpng16 instead of -lpng I don't know if it will work with your fltk because I guess it is linked to the system libpng12?

Indeed: apt-rdepends libfltk1.3-dev | grep -E '^[a-zA-Z0-9]' | grep png leads to libpng12-0 Fortunately, the next Debian stable will ship libpng16.

NB: giac/xcas has now an official package in debian unstable:

https://packages.debian.org/source/unstable/giac

so in next releases you may not need the spkg for xcas.

comment:22 in reply to: ↑ 21 Changed 5 years ago by tmonteil

Indeed: apt-rdepends libfltk1.3-dev | grep -E '^[a-zA-Z0-9]' | grep png leads to libpng12-0 Fortunately, the next Debian stable will ship libpng16.

Actually, i wonder whether giac from Sage could produce png with libpng16 (shipped with Sage once this ticket gets merged) and the xcas GUI could be displayed with fltk using system's libpng12 without any conflict. I will try such an option anyway (also, libfltk1.3-dev has no dependency on libpng12-dev so that i can remove it during giac compilation, so there should not be any problem there).

Replying to frederichan:

NB: giac/xcas has now an official package in debian unstable:

https://packages.debian.org/source/unstable/giac

so in next releases you may not need the spkg for xcas.

Well, it did not enter stretch, which is now frozen, hence it will not be shipped with the next stable :(

comment:23 follow-ups: Changed 5 years ago by dimpase

I suspect that something is not perfect with libpng in Sage. In particular, on FreeBSD (#22679) with Sage's current libpng (1.2.51) I see

sage: loads(dumps(B)) == B ## line 827 ##
libpng warning: Application was compiled with png.h from libpng-1.6.27+apng
libpng warning: Application  is  running with png.c from libpng-1.2.51
GD Error: gd-png: fatal libpng error: Incompatible libpng version in application and library

**********************************************************************
----------------------------------------------------------------------
sage -t --long src/sage/coding/binary_code.pyx  # Killed due to segmentation fault

so it looks as if somewhere wrong or absent -I/... is used for compilation.

comment:24 in reply to: ↑ 23 Changed 5 years ago by dimpase

Replying to dimpase:

I suspect that something is not perfect with libpng in Sage. In particular, on FreeBSD (#22679) with Sage's current libpng (1.2.51) I see

sage: loads(dumps(B)) == B ## line 827 ##
libpng warning: Application was compiled with png.h from libpng-1.6.27+apng
libpng warning: Application  is  running with png.c from libpng-1.2.51
GD Error: gd-png: fatal libpng error: Incompatible libpng version in application and library

**********************************************************************
----------------------------------------------------------------------
sage -t --long src/sage/coding/binary_code.pyx  # Killed due to segmentation fault

so it looks as if somewhere wrong or absent -I/... is used for compilation.

unsurprisingly, upgrading to the branch in this ticket makes this crash go away.

Last edited 5 years ago by dimpase (previous) (diff)

comment:25 in reply to: ↑ 23 Changed 5 years ago by dimpase

Replying to dimpase:

I suspect that something is not perfect with libpng in Sage. In particular, on FreeBSD (#22679) with Sage's current libpng (1.2.51) I see

sorry for noise, that was FreeBSD-specific leftover from an old port that caused this. No problem, in fact.

comment:26 follow-up: Changed 5 years ago by jpflori

Can we try to merge it in 8.0? The giac issue is solved in a giac ticket isn't it?

comment:27 in reply to: ↑ 26 Changed 5 years ago by tmonteil

Replying to jpflori:

Can we try to merge it in 8.0?

Sure.

The giac issue is solved in a giac ticket isn't it?

Well, the issue is avoided in #22101 (which disables png support), but i think we should not consider this as a permanent solution, and provide a full-featured giac (which can draw pictures).

comment:28 Changed 5 years ago by jpflori

I think we can live with a giac without png support. We already live with a completely borken giac outside x86_64...

comment:29 Changed 5 years ago by jpflori

And note that giac build system should be fixed to use proper -lpng1x rather than -lpng. Not libpng...

comment:30 Changed 5 years ago by jpflori

From my point of view it is enough to rebase this ticket, I'll do it.

comment:31 Changed 5 years ago by jpflori

  • Authors changed from Jeroen Demeyer to Jeroen Demeyer, Jean-Pierre Flori
  • Branch changed from u/jdemeyer/upgrade_to_latest_libpng to public/libpng1629
  • Commit changed from 7467913b56d7ac5deefb7bd3abc0b9ed62265b6d to aa28f4cba1d7589b5b3bd970311981c5fb9bf04d
  • Description modified (diff)
  • Status changed from needs_work to needs_review
  • Summary changed from Upgrade to latest libpng to Upgrade to libpng 1.6.29

New commits:

61ff918Merge remote-tracking branch 'trac/u/jdemeyer/upgrade_to_latest_libpng' into libpng1629
aa28f4cBump to libpng 1.6.29.

comment:32 Changed 5 years ago by tscrim

  • Milestone changed from sage-7.6 to sage-8.0
  • Reviewers changed from Jean-Pierre Flori to Jean-Pierre Flori, Travis Scrimshaw
  • Status changed from needs_review to positive_review

Built for me. Back to the buildbots.

comment:33 Changed 5 years ago by vbraun

  • Branch changed from public/libpng1629 to aa28f4cba1d7589b5b3bd970311981c5fb9bf04d
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.