Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I try to build for git but for undefined reference errors #1

Closed
thinksource opened this issue Oct 23, 2013 · 18 comments
Closed

I try to build for git but for undefined reference errors #1

thinksource opened this issue Oct 23, 2013 · 18 comments

Comments

@thinksource
Copy link

I meet error after make:

make[3]: Entering directory `/root/graphviz/cmd/dot'
CC dot-dot.o
CC dot-no_builtins.o
CCLD dot
CC dot_builtins-dot.o
CC dot_builtins-dot_builtins.o
CCLD dot_builtins
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aagerror'
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aaglex'
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aglexeof'
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aagin'
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aglexinit'

@emdenrg
Copy link
Collaborator

emdenrg commented Oct 23, 2013

All of these should be defined in lib/cgraph/.libs/scan.o. Please see if they are there. They
should be since dot linked correctly. Please let us know what system you are building on. Also,
go to cmd/dot and run make V=1 and send us the command trace. Thanks.

@thinksource
Copy link
Author

it runs on my company's server, It's ubuntu 12.04 and I'll fetch more information after my work

@thinksource
Copy link
Author

the command is
make V=1 1>record.txt 2>test.txt

the command trace are in file:
https://drive.google.com/file/d/0B9ncCBd_xIXqWkpxSXhIbjlMakE/edit?usp=sharing
the error file(stderr)
https://drive.google.com/file/d/0B9ncCBd_xIXqWVhfT3d0YU8tSWs/edit?usp=sharing

@emdenrg
Copy link
Collaborator

emdenrg commented Oct 24, 2013

What do you get when you do

nm lib/cgraph/.libs/libcgraph.so | grep aaglex
?

@emdenrg emdenrg closed this as completed Oct 24, 2013
@thinksource
Copy link
Author

@emden this is the output:

~/graphviz# nm lib/cgraph/.libs/libcgraph.so | grep aaglex
U aaglex

@emdenrg
Copy link
Collaborator

emdenrg commented Oct 24, 2013

Well, that is the problem. Now we just have to figure out why it isn't there.

@ellson ellson reopened this Oct 24, 2013
@emden
Copy link
Collaborator

emden commented Oct 24, 2013

On 10/24/13 9:29 AM, John Ellson wrote:

Reopened #1 #1.
Yes, I'm still learning my way around the github interface.

@ellson
Copy link
Owner

ellson commented Oct 24, 2013

Are you building from git sources, or from tar.gz ?

If from git, then I'm wondering if lex and yacc are working properly (packages flex, bison, byacc... I think)

If tar.gz, then I'm wondering if there is some incompatibility between the scan.c that was generated on our packaging system, and your system?

Could you try building directly from git sources?
You will need: git, autoconf, automake, libtool, flex, bison, byacc, swig, ... I may have forgotten some.
Then do:
git clone git@github.com:ellson/graphviz.git
cd graphviz
./autogen.sh
./configure
make
sudo make install

@ellson
Copy link
Owner

ellson commented Oct 24, 2013

If you still have problems, please send: config.log

@emdenrg
Copy link
Collaborator

emdenrg commented Oct 24, 2013

The odd thing is that the build of dot appears to work. Wouldn't the linker make sure there are no missing functions, or is that not done?

It would also be good to verify that scan.o is being built and that it contains aaglex.

@ellson
Copy link
Owner

ellson commented Oct 24, 2013

I think some linkers are less thorough about checking for missing
functions when linking with a .so. It does seem odd though, because
its a .so in both cases here.

On 10/24/2013 09:56 AM, Emden R. Gansner wrote:

The odd thing is that the build of dot appears to work. Wouldn't the
linker make sure there are no missing functions, or is that not done?

It would also be good to verify that scan.o is being built and that it
contains aaglex.


Reply to this email directly or view it on GitHub
#1 (comment).

@thinksource
Copy link
Author

@ellson Sorry for replying late, as I work in Australia. the time is difference.
I build from git source code, but I use "git clone https://github.com/ellson/graphviz.git" to fetch the source code
I rechecked the dependence, found I was omit to install package bison, but even after I install it(apt-get install bison), the error still there.
the after install bison make error:

CC dot-dot.o
CC dot-no_builtins.o
CCLD dot
CC dot_builtins-dot.o
CC dot_builtins-dot_builtins.o
CCLD dot_builtins
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aagerror'
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aaglex'
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aglexeof'
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aagin'
../../lib/cgraph/.libs/libcgraph.so: error: undefined reference to 'aglexinit'
collect2: error: ld returned 1 exit status
make[3]: *** [dot_builtins] Error 1
make[3]: Leaving directory /root/graphviz/cmd/dot' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory/root/graphviz/cmd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/graphviz'
make: *** [all] Error 2

the config.log file is:
https://drive.google.com/file/d/0B9ncCBd_xIXqVDQwd1h0R25vcm8/edit?usp=sharing

@ellson
Copy link
Owner

ellson commented Oct 25, 2013

Thanks for the config.log. I still can't explain the problem, but it seems as though you are building on a fairly old version of Ubuntu ?
(uname -v = #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012
so its pre-12.04, which is the oldest we support with our nightly builds.)

gcc-4.7.2 should be OK (same release as used in our Fedora-17 builds)

I'm inclined to suspect /bin/sed, which is used in the creation of scan.c, but I can't explain why CCLD dot works ok. Could you send us the generated scan.c from your build tree after it errors out?

If it is possible for you to check, does graphviz build ok for you on a later release of Ubuntu ? (preferably 12.04 or later)

@thinksource
Copy link
Author

this is our test server for my company, other developers also use the server I can not change the Ubuntu version as u said.

the scan.c is at ./lib/cgraph/scan.c
but scan.c is empty when I check. I delete the scan.c and rerun
./autogen.sh
./configure
make

the error changed:
CXX libgv_perl_la-gv.lo
CC libgv_perl_la-gv_builtins.lo
CC libgv_perl_la-gv_dummy_init.lo
swig -c++ -perl -o gv_perl.cpp ./gv.i
CXX libgv_perl_la-gv_perl.lo
CXXLD libgv_perl.la
/usr/bin/ld: error: cannot find -lperl
collect2: error: ld returned 1 exit status
make[4]: *** [libgv_perl.la] Error 1
make[4]: Leaving directory /root/graphviz/tclpkg/gv' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory/root/graphviz/tclpkg/gv'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /root/graphviz/tclpkg' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/root/graphviz'
make: *** [all] Error 2

@emdenrg
Copy link
Collaborator

emdenrg commented Oct 25, 2013

The perl plugin can often cause problems. Try running configure with --enable-perl=no

@magneticnorth
Copy link
Collaborator

What is this ellson/graphviz stuff?

@ellson
Copy link
Owner

ellson commented Oct 25, 2013

On 10/25/2013 08:26 AM, magneticnorth wrote:

What is this ellson/graphviz stuff?


Reply to this email directly or view it on GitHub
#1 (comment).

Stephen,

People have started posting to the issues system on the ellson/graphviz
repository on github. Apparently it is automatically sent to all
"collaborators".

Seems quite good, IMO.

John

@thinksource
Copy link
Author

Thanks @emdenrg @ellson
THe graphviz works without perl plugin.

This was referenced Jul 4, 2016
ellson pushed a commit that referenced this issue Jul 10, 2016
Merge from ellison/graphviz
pipcet pushed a commit to pipcet/graphviz that referenced this issue Jan 18, 2021
Address Sanitizer detected a few instances of the following:

  Direct leak of 168 byte(s) in 7 object(s) allocated from:
    #0 0x7f4bc2724330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    ellson#1 0x7f4bc24b1ea3 in vec_new /tmp/tmp.m68Z0dFAYs/graphviz/lib/common/routespl.c:918
    ellson#2 0x7f4bc24b291a in find_all_cycles /tmp/tmp.m68Z0dFAYs/graphviz/lib/common/routespl.c:1073
    ellson#3 0x7f4bc24b2b64 in get_cycle_centroid /tmp/tmp.m68Z0dFAYs/graphviz/lib/common/routespl.c:1121
    ellson#4 0x7f4bc24b3c5c in makeStraightEdges /tmp/tmp.m68Z0dFAYs/graphviz/lib/common/routespl.c:1233
    ellson#5 0x7f4bc24b35f8 in makeStraightEdge /tmp/tmp.m68Z0dFAYs/graphviz/lib/common/routespl.c:1203
    ellson#6 0x7f4bbdf28b52 in _spline_edges /tmp/tmp.m68Z0dFAYs/graphviz/lib/neatogen/neatosplines.c:659
    ellson#7 0x7f4bbdf29240 in splineEdges /tmp/tmp.m68Z0dFAYs/graphviz/lib/neatogen/neatosplines.c:736
    ellson#8 0x7f4bbdf29310 in spline_edges1 /tmp/tmp.m68Z0dFAYs/graphviz/lib/neatogen/neatosplines.c:749
    ellson#9 0x7f4bbdf293be in spline_edges0 /tmp/tmp.m68Z0dFAYs/graphviz/lib/neatogen/neatosplines.c:779
    ellson#10 0x7f4bbdf29bcb in spline_edges /tmp/tmp.m68Z0dFAYs/graphviz/lib/neatogen/neatosplines.c:817
    ellson#11 0x7f4bbdf14ea6 in neato_layout /tmp/tmp.m68Z0dFAYs/graphviz/lib/neatogen/neatoinit.c:1489
    ellson#12 0x7f4bc242b6fc in gvLayoutJobs /tmp/tmp.m68Z0dFAYs/graphviz/lib/gvc/gvlayout.c:85
    ellson#13 0x559fcd474960 in main /tmp/tmp.m68Z0dFAYs/graphviz/cmd/dot/dot.c:132
    ellson#14 0x7f4bc21d709a in __libc_start_main ../csu/libc-start.c:308

find_all_cycles() was calling vec_delete() on the temporary vector it allocated,
but it did not take into account that the nested vectors were not freed by
vec_delete(). This change moves the open coded clean up logic from
get_cycle_centroid() into vec_delete() to fix this and make it less likely that
this is missed in future.

This was initially encountered while investigating #1554.
pipcet pushed a commit to pipcet/graphviz that referenced this issue Jan 25, 2021
make_label() internally strdups its input, so this extra allocation was simply
being lost. This was observable using an ASan-instrumented build and the command
`dot -Tsvg -o /dev/null ./rtest/share/alf.gv`:

  Direct leak of 121 byte(s) in 12 object(s) allocated from:
    #0 0x7fd2541bf810 in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
    ellson#1 0x7fd25404a955 in parse_reclbl /tmp/tmp.bXYbsH93VJ/graphviz/lib/common/shapes.c:3314
    ellson#2 0x7fd25404a5eb in parse_reclbl /tmp/tmp.bXYbsH93VJ/graphviz/lib/common/shapes.c:3292
    ellson#3 0x7fd25404ca5f in record_init /tmp/tmp.bXYbsH93VJ/graphviz/lib/common/shapes.c:3556
    ellson#4 0x7fd25405966a in common_init_node /tmp/tmp.bXYbsH93VJ/graphviz/lib/common/utils.c:658
    ellson#5 0x7fd24fc78a01 in dot_init_node /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:40
    ellson#6 0x7fd24fc79522 in dot_init_node_edge /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:81
    ellson#7 0x7fd24fc7ad61 in dotLayout /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:295
    ellson#8 0x7fd24fc7c4b9 in doDot /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:450
    ellson#9 0x7fd24fc7ca94 in dot_layout /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:496
    ellson#10 0x7fd253f7673d in gvLayoutJobs /tmp/tmp.bXYbsH93VJ/graphviz/lib/gvc/gvlayout.c:85
    ellson#11 0x55a9961b3960 in main /tmp/tmp.bXYbsH93VJ/graphviz/cmd/dot/dot.c:132
    ellson#12 0x7fd253d2309a in __libc_start_main ../csu/libc-start.c:308

  Direct leak of 118 byte(s) in 19 object(s) allocated from:
    #0 0x7fd2541bf810 in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
    ellson#1 0x7fd25404a955 in parse_reclbl /tmp/tmp.bXYbsH93VJ/graphviz/lib/common/shapes.c:3314
    ellson#2 0x7fd25404ca5f in record_init /tmp/tmp.bXYbsH93VJ/graphviz/lib/common/shapes.c:3556
    ellson#3 0x7fd25405966a in common_init_node /tmp/tmp.bXYbsH93VJ/graphviz/lib/common/utils.c:658
    ellson#4 0x7fd24fc78a01 in dot_init_node /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:40
    ellson#5 0x7fd24fc79522 in dot_init_node_edge /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:81
    ellson#6 0x7fd24fc7ad61 in dotLayout /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:295
    ellson#7 0x7fd24fc7c4b9 in doDot /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:450
    ellson#8 0x7fd24fc7ca94 in dot_layout /tmp/tmp.bXYbsH93VJ/graphviz/lib/dotgen/dotinit.c:496
    ellson#9 0x7fd253f7673d in gvLayoutJobs /tmp/tmp.bXYbsH93VJ/graphviz/lib/gvc/gvlayout.c:85
    ellson#10 0x55a9961b3960 in main /tmp/tmp.bXYbsH93VJ/graphviz/cmd/dot/dot.c:132
    ellson#11 0x7fd253d2309a in __libc_start_main ../csu/libc-start.c:308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants