Code Monkey home page Code Monkey logo

Comments (9)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024
I do not have this problem on Linux (Fedora, Ubuntu) or Windows XP. 
Unfortunately, I don't have a convenient Mac to test this.

One difference I see is the version of the HPDF library. Can you try using the 
latest library from https://github.com/tony2001/libharu.git ?

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print(package.cpath)
./?.so;/usr/lib/lua/5.1/?.so
> require 'hpdf'
> print(hpdf.VERSION_TEXT)
2.3.0-dev
>

-- Kurt

Original comment by kurt.w.jung on 17 Nov 2010 at 11:45

from luahpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024
I'll try, in the meanwihle I'm attaching the backtrace:

$ gdb lua
GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared 
libraries ... done

(gdb) b malloc_error_break
Breakpoint 1 at 0x20c49ba5d4f76d
(gdb) r
Starting program: /opt/local/bin/lua 
Reading symbols for shared libraries ++.. done
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require "hpdf"
Reading symbols for shared libraries .... done
> print(hpdf.VERSION_TEXT)
2.2.0
> 
lua(92782) malloc: *** error for object 0x100232520: pointer being freed was 
not allocated
*** set a breakpoint in malloc_error_break to debug

Breakpoint 1, 0x00007fff8737c76d in malloc_error_break ()
(gdb) bt
#0  0x00007fff8737c76d in malloc_error_break ()
#1  0x00007fff872a66e3 in free ()
#2  0x000000010001306a in l_alloc ()
#3  0x000000010000b320 in luaM_realloc_ ()
#4  0x000000010000f17a in luaH_free ()
#5  0x0000000100009535 in sweeplist ()
#6  0x00000001000095b7 in luaC_freeall ()
#7  0x000000010000e86f in close_state ()
#8  0x0000000100001624 in main ()
(gdb) 

Original comment by [email protected] on 18 Nov 2010 at 6:45

from luahpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024
Based on this message, I think that hpdf.so is using a separate Lua instance:

  http://lua-users.org/lists/lua-l/2009-10/msg00145.html

Check where Lua is being pulled in for both hpdf.so and lua:

$ ldd ./hpdf.so
        linux-gate.so.1 =>  (0x00423000)
        liblua-5.1.so => /usr/lib/liblua-5.1.so (0x0057d000)
        libhpdf-2.3.0-dev.so => /usr/lib/libhpdf-2.3.0-dev.so (0x00d6e000)
        libc.so.6 => /lib/libc.so.6 (0x00110000)
        libm.so.6 => /lib/libm.so.6 (0x00782000)
        libdl.so.2 => /lib/libdl.so.2 (0x00606000)
        libz.so.1 => /lib/libz.so.1 (0x00426000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00ea0000)
        /lib/ld-linux.so.2 (0x00ab7000)
$ ldd `which lua`
        linux-gate.so.1 =>  (0x00c81000)
        liblua-5.1.so => /usr/lib/liblua-5.1.so (0x002f3000)
        libreadline.so.6 => /lib/libreadline.so.6 (0x00cf8000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x04ef6000)
        libm.so.6 => /lib/libm.so.6 (0x00c8b000)
        libdl.so.2 => /lib/libdl.so.2 (0x00c84000)
        libc.so.6 => /lib/libc.so.6 (0x00ad9000)
        libtinfo.so.5 => /lib/libtinfo.so.5 (0x04ed3000)
        /lib/ld-linux.so.2 (0x00ab7000)

Original comment by kurt.w.jung on 18 Nov 2010 at 11:49

from luahpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024
[deleted comment]

from luahpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024
I get:

$ otool -L `which lua` hpdf.so
/opt/local/bin/lua:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1)
    /opt/local/lib/libreadline.6.1.dylib (compatibility version 6.0.0, current version 6.1.0)
hpdf.so:
    hpdf.so (compatibility version 0.0.0, current version 0.0.0)
    /opt/local/lib/libhpdf-2.2.0.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
bimac:luahpdf-1.0 $ 

I have only one version of Lua on my system, tho' I see I just get a liblua.a 
archive rather than a dylib Mach-O, I'll try to rebuild it later and report 
results.

Original comment by [email protected] on 18 Nov 2010 at 1:06

from luahpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024
Trouble: it looks like lua is statically linked in hpdf.so. 

Original comment by kurt.w.jung on 18 Nov 2010 at 1:26

from luahpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024

Original comment by kurt.w.jung on 18 Nov 2010 at 1:46

  • Changed state: Started

from luahpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024
Fixed, it wasn't due to luahpdf.

 cf. http://trac.macports.org/ticket/27378

Original comment by [email protected] on 19 Nov 2010 at 7:22

from luahpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 15, 2024
Thanks, Andrea

Original comment by kurt.w.jung on 19 Nov 2010 at 10:54

  • Changed state: Done

from luahpdf.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.