[MacPorts] #34520: dia crashes on start
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: segfault | Port: dia ----------------------------------+----------------------------------------- With a freshly installed MacPorts on MacOS 10.7.4 with Xcode 4.3.2, do
sudo port install dia then launch dia A window appears for a short while before the program crashes with Segmentation fault: 11
Running it with gdb gives Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x000000007a950f48 0x00007fff94df91ec in flockfile () (gdb) bt #0 0x00007fff94df91ec in flockfile () #1 0x00007fff94daeb23 in fread () #2 0x00000001034901d5 in shape_typeinfo_load () #3 0x0000000103494031 in load_shapes_from_tree () #4 0x0000000103493f95 in load_shapes_from_tree () #5 0x0000000103493f32 in dia_plugin_init () #6 0x00000001000c8a34 in dia_plugin_load () #7 0x00000001000c8dfa in dia_register_plugin () #8 0x00000001000c8f29 in for_each_in_dir () #9 0x00000001000c9112 in dia_register_plugins () #10 0x00000001000105d5 in app_init () #11 0x000000010003a539 in main () -- Ticket URL: <https://trac.macports.org/ticket/34520> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: segfault | Port: dia ----------------------------------+----------------------------------------- Description changed by ryandesign@…: Old description:
With a freshly installed MacPorts on MacOS 10.7.4 with Xcode 4.3.2, do
sudo port install dia then launch dia A window appears for a short while before the program crashes with Segmentation fault: 11
Running it with gdb gives
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000007a950f48
0x00007fff94df91ec in flockfile ()
(gdb) bt
#0 0x00007fff94df91ec in flockfile ()
#1 0x00007fff94daeb23 in fread ()
#2 0x00000001034901d5 in shape_typeinfo_load ()
#3 0x0000000103494031 in load_shapes_from_tree ()
#4 0x0000000103493f95 in load_shapes_from_tree ()
#5 0x0000000103493f32 in dia_plugin_init ()
#6 0x00000001000c8a34 in dia_plugin_load ()
#7 0x00000001000c8dfa in dia_register_plugin ()
#8 0x00000001000c8f29 in for_each_in_dir ()
#9 0x00000001000c9112 in dia_register_plugins ()
#10 0x00000001000105d5 in app_init ()
#11 0x000000010003a539 in main ()
New description: With a freshly installed MacPorts on MacOS 10.7.4 with Xcode 4.3.2, do {{{
sudo port install dia }}} then launch {{{ dia }}} A window appears for a short while before the program crashes with {{{ Segmentation fault: 11 }}}
Running it with gdb gives {{{ Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x000000007a950f48 0x00007fff94df91ec in flockfile () (gdb) bt #0 0x00007fff94df91ec in flockfile () #1 0x00007fff94daeb23 in fread () #2 0x00000001034901d5 in shape_typeinfo_load () #3 0x0000000103494031 in load_shapes_from_tree () #4 0x0000000103493f95 in load_shapes_from_tree () #5 0x0000000103493f32 in dia_plugin_init () #6 0x00000001000c8a34 in dia_plugin_load () #7 0x00000001000c8dfa in dia_register_plugin () #8 0x00000001000c8f29 in for_each_in_dir () #9 0x00000001000c9112 in dia_register_plugins () #10 0x00000001000105d5 in app_init () #11 0x000000010003a539 in main () }}} -- -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: segfault | Port: dia ----------------------------------+----------------------------------------- Comment(by luc_j_bourhis@…): Forgot port version: dia @0.97.2, Revision 1 (gnome, graphics) -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: segfault | Port: dia ----------------------------------+----------------------------------------- Comment(by cumhur.erkut@…): Same problem with @0.97.2, Revision 1 on an older system OSX 10.6.8 and XCode 4.2 -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Changes (by macsforever2000@…): * keywords: segfault => -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by detlevd@…): Same here (10.7.4, XCode 4.2). Compiled with -g, ran gdb: crash occurs on first call of shape_typeinfo_load() which tries to open /opt/local/share/dia/shapes/Assorted/arrow-chevron.shape which exists and is world readable. g_fopen() seems successful, but first call of fread() causes the crash. -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by macports@…): 0.97.2_1 also crashes on startup for me (creating a 350MB core file, if I let it; my backtrace looks identical to the one on the ticket), on OS X 10.6.8. If I reactivate 0.97.2_0, and fudge a backwards compatibility symlink for a library that got upgraded since I built 0.97.2_0: {{{ ewen@bethel:~$ dia FILE.dia dyld: Library not loaded: /opt/local/lib/libffi.5.dylib Referenced from: /opt/local/bin/dia Reason: image not found Trace/BPT trap ewen@bethel:~$ }}} with {{{ ewen@bethel:~$ cd /opt/local/lib ewen@bethel:/opt/local/lib$ sudo ln -s libffi.6.dylib libffi.5.dylib }}} then dia will start up and load my file. The difference between 0.97.2_0 and 0.97.2_1 is one changeset r90852, in response to ticket #33616, which adds in a forced use of a SVG library. Given the way it crashes (after a long time reading in lots of data) I wonder if the issue is that it's then trying to use the SVG library to load a non-SVG thing? The other possibility is that it has to do with environment at the built time (eg, compiler, etc). But it looks like something is wrong with the argument to fread() and/or flockfile(), particularly since in trying to grab a stack trace I'm seeing the segmentation fault happen _before_ it appears to stat/open the first shape file (based on trying to use dtruss, but after it's read in the directory). I guess the idea would be to try to rebuild _1 with that library disabled again, and see if it makes it work again. -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by suv-sf@…): Crash reproduced with dia 0.97.2_1 on OS X 10.7.4 (Xcode 4.3.2). After rebuilding dia using the latest patches from the [http://git.gnome.org/browse/dia/log/?h=dia-0-97 0.97 git branch] it no longer crashes on launch and seems to work ok (I only did some quick tests). Attaching unified Portfile diff and the three patch files. -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by macports@…): On OS X 10.6.8, I can confirm that a simple rebuild from source of dia 0.97.2_1 from source wasn't sufficient to make it work again (viz "sudo port clean dia; sudo port upgrade -s -n --force dia" -- it still crashed on startup), but a rebuild with the four patches attached by suv-sf (two weeks ago), with: {{{ cd /opt/local/var/macports/sources/rsync.macports.org/release/ports/gnome/dia/files sudo cp -p ~ewen/Desktop/*.patch . cd .. sudo patch -p0 <~ewen/Desktop/Portfile-dia.diff sudo port upgrade -s -n --force dia }}} resulted in an 0.97.2_2 (the _2 is in the Portfile-dia.diff), which would start successfully and load an existing dia diagram. So it appears actual code had to change, not just a binary structure change to match other things being recompiled. The first attached patch (0001-...) appears to be [https://mail.gnome.org/archives/commits-list/2012-April/msg03771.html this patch for font issue 668587], which is presumably the fix (although the [https://bugzilla.gnome.org/show_bug.cgi?id=668587 gnome bug report] seems to be [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657158 originally triggered in a different way in Debian]). The other two seem to be compile-time issues relating to headers not always being included. So a local (MacPorts) inclusion of at least the first patch seems likely to resolve this bug. It'd be helpful if it had a local revision bump higher than _2. Ewen -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by suv-sf@…): Replying to [comment:14 macports@…]:
So a local (MacPorts) inclusion of at least the first patch seems likely to resolve this bug.
1) Building with patch 0001 only fails (to be expected - the changes for the glib headers is required for MacPorts version of glib2). 2) Building with patch 0002 only succeeds, and dia opens without crash. 3) Building with patch 0002 and 0003 succeeds, and dia opens without crash. --> the minimum changes appear to be in the upstream version of the patch to make dia compatible with glib2 >= 2.31 (see also upstream bug [https://bugzilla.gnome.org/show_bug.cgi?id=665335 665335]). The other two (0001, 0003) appear to be bonus fixes not yet available in a stable bug- fix release of Dia 0.97.
It'd be helpful if it had a local revision bump higher than _2.
Why? Incrementing the revision by 1 is according to the guide. -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by macports@…): Thanks for testing the combinations. I am surprised that a change in include files only is sufficient fix, given that I could rebuild the _1 version without that change, but with the same versions of other packages installed. Perhaps the compiler was making assumptions about other things not included. FWIW, my suggestion to bump the local revision higher than _2 was simply because there is now an "unofficial" 0.97.2_2 that multiple people have installed, and it'd be less confusing if the next official version didn't have that same number (as well as meaning that people with that installed could get back to the official build by just doing an upgrade). Ewen -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:16> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by dcecchin@…): Same thing happens on a fresh install of Mac OSX 10.8 -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:23> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by asnedden@…): Is there a way to utilize these patch file while building from Mac Ports? Or are these patch files solely for developer purposes or folks installing from source? Thanks! -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:27> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Comment(by macports@…): Replying to [comment:27 asnedden@…]:
Is there a way to utilize these patch file while building from Mac Ports? Or are these patch files solely for developer purposes or folks installing from source? Thanks!
If you build the dia port from source, then you can use the patches by downloading them all and then copying them into the port directory, eg, [https://trac.macports.org/ticket/34520#comment:14 as I described a few weeks back on this ticket]. (That description includes the command to force dia to be rebuilt from the patched source.) Beware that the "port selfupdate" rsync process will remove the patch changes from that directory, so you'll need to reapply the patches if you do "port selfupdate" and then want to build dia again. The easiest thing is to do the "port selfupdate" first, then do the patch/build process for dia, then stick with that working dia. (Presumably any later update to dia will be a version including the fix anyway.) Ewen -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:29> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start ----------------------------------+----------------------------------------- Reporter: luc_j_bourhis@… | Owner: dports@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Keywords: | Port: dia ----------------------------------+----------------------------------------- Changes (by dports@…): * owner: macports-tickets@… => dports@… * status: new => assigned -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:30> MacPorts <http://www.macports.org/> Ports system for Mac OS
#34520: dia crashes on start -----------------------------------+---------------------------------------- Reporter: luc_j_bourhis@… | Owner: dports@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.1 Resolution: fixed | Keywords: Port: dia | -----------------------------------+---------------------------------------- Changes (by dports@…): * status: assigned => closed * resolution: => fixed Comment: Committed in r96990. I was expecting patch 0001 to be enough, in combination with the existing patch for glib, but that didn't work, so I committed all three. -- Ticket URL: <https://trac.macports.org/ticket/34520#comment:31> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts