Problem with LUABIND_NO_ERROR_CHECKING

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with LUABIND_NO_ERROR_CHECKING

Tony Kostanjsek
hi,

first of all: thanks for luabind 0.9, automatic smart pointer downcasts alone are brilliant, very much appreciated!

Unfortunately, activating LUABIND_NO_ERROR_CHECKING doesn't work for me anymore and crashes the application. I had this buried in the release build, which I hadn't tried since luabind 0.8, and narrowed it down to the testcase you can find below. The test uses luabind 0.9 release from sourceforge (dated Jan 5th 2010), lua 5.1.4, boost 1.40, all statically linked, compiled using gcc 4.0 on Mac OS 10.5.
The same happened in on 10.6 with gcc 4.2, 32 or 64 bit build didn't matter.

Output of the testcase in XCode console:

run
[Switching to process 9641 local thread 0x2e03]
Running…
found settings
Program received signal:  “EXC_BAD_ACCESS”.
(gdb) bt
#0  0x919eb401 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string ()
#1  0x000029aa in Settings::Settings (this=0xbffff86c) at /Users/tony/Desktop/lbtest/main.cpp:12
#2  0x00002d95 in luabind::detail::value_converter::apply<Settings> (this=0xbffff7f0) at policy.hpp:287
#3  0x00002e20 in luabind::detail::object_cast_aux<Settings, luabind::adl::object, luabind::detail::null_type, luabind::detail::throw_error_policy<Settings>, Settings> (value_wrapper=@0xbffff870) at object.hpp:973
#4  0x00002e9b in luabind::object_cast<Settings, luabind::adl::object> (value_wrapper=@0xbffff870) at object.hpp:1024
#5  0x00001bf8 in main (argc=1, argv=0xbffff8c0) at /Users/tony/Desktop/lbtest/main.cpp:49

The prefix.pch file contains exactly one line:

#define LUABIND_NO_ERROR_CHECKING

Commenting this out makes it run flawlessly.
Hope you can help,
best,
Tony

(testcase attached as main.cpp)

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.
http://mail.yahoo.com
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user

main.cpp (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with LUABIND_NO_ERROR_CHECKING

Daniel Wallin
Tony Kostanjsek wrote:
> hi,
>
> first of all: thanks for luabind 0.9, automatic smart pointer
> downcasts alone are brilliant, very much appreciated!

Thank you.

> Unfortunately, activating LUABIND_NO_ERROR_CHECKING doesn't work for
> me anymore and crashes the application. I had this buried in the release
> build, which I hadn't tried since luabind 0.8, and narrowed it down to
> the testcase you can find below. The test uses luabind 0.9 release from
> sourceforge (dated Jan 5th 2010), lua 5.1.4, boost 1.40, all statically
> linked, compiled using gcc 4.0 on Mac OS 10.5.
> The same happened in on 10.6 with gcc 4.2, 32 or 64 bit build didn't
> matter.

OK, seems like LUABIND_NO_ERROR_CHECKING is broken in 0.9. The problem
is that we have code like:

  # ifndef LUABIND_NO_ERROR_CHECKING
      if (converter.match(...) == -1)
      {
          // ... report failure
      }
  # endif

      ... converter.apply(...); // do actual conversion

This was fine in 0.8, but in 0.9 the conversion process has two stages,
the first being match(), so they have to be called in succession.

I suggest turning off LUABIND_NO_ERROR_CHECKING; it doesn't do very much
 in 0.9 anyway.

--
Daniel Wallin
BoostPro Computing
http://www.boostpro.com

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user