bugGnash - The GNU Flash player - Bugs: bug #25204, trunk fails to build on OpenBSD.

 
 

bug #25204: trunk fails to build on OpenBSD.

Submitted by:  Brad Smith <brad0>
Submitted on:  Mon 29 Dec 2008 01:14:14 AM UTC  
 
Category: buildSeverity: 3 - Normal
Release: trunkStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 16 Jan 2009 01:04:18 PM UTC, comment #19:

Ok, now gnash from trunk builds and works on OpenBSD (4.4-current). I've tested it on YouTube with agg and cairo renderers.
Thank you very much, bwy

David Coppa <dcoppa>
Thu 15 Jan 2009 12:04:06 PM UTC, comment #18:

I've committed a different fix, as to_int() gives the wrong result. Still can't really explain my crash, especially as it didn't crash when compiled with g++4.4, but it doesn't matter now.

Benjamin Wolsey <bwy>
Project Member
Thu 15 Jan 2009 11:15:52 AM UTC, comment #17:

Yes, what you wrote is what I was suggesting.

Float to int conversion is bad if the integral part of the float isn't representable in the target type. to_int() should check automatically, but it also truncates large values (0xffffffff becomes -1). Since we don't know what gets passed as an argument to blendMode, that could be the wrong behaviour (i.e is -0xffffffff rejected, or does it count as 1?).

At the moment I have a problem anyway with using to_int() there, namely that if -1 is passed it crashes, as the test "if (mode < 0)" apparently returns false even when mode is -1. There's something dodgy going on.

Benjamin Wolsey <bwy>
Project Member
Thu 15 Jan 2009 11:02:08 AM UTC, comment #16:

You mean

double mode = bm.to_number(); -> int mode = bm.to_int();

???

And infact it fixes the build error.

Can you explain the range checking part please?

TIA

David Coppa <dcoppa>
Thu 15 Jan 2009 10:17:34 AM UTC, comment #15:

It isn't hard to fix by using to_int() instead of to_number(), but that has the possibly unwanted effect of truncating very large numbers. If so, it would need an additional static_cast to int (with range checking) before the cast to blendmode.

Benjamin Wolsey <bwy>
Project Member
Thu 15 Jan 2009 10:07:01 AM UTC, comment #14:

Another build error on OpenBSD:
character.cpp:601: error: invalid static_cast from type `double' to type `

Please help me...

g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../libamf -I../libnet -I../backend -I../libcore/swf -I../libcore/asobj -I../libcore/parser -I../libltdl -I../libcore/vm -I../libbase -I../libmedia -I../libsound -I../libamf -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/X11R6/include/freetype2 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/local/include/gstreamer-0.10 -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/libxml2 -I/usr/local/include -I../libmedia/gst -I/usr/local/include -g -O2 -pthread -pthread -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -Wnon-virtual-dtor -Wunused -MT character.lo -MD -MP -MF .deps/character.Tpo -c character.cpp -fPIC -DPIC -o .libs/character.o
In file included from render.h:26,
from character.cpp:32:
../backend/render_handler.h: In member function `virtual
gnash::geometry::Range2d<int> gnash::render_handler::world_to_pixel(const
gnash::geometry::Range2d<float>&)':
../backend/render_handler.h:291: warning: passing `float' for converting 1 of `
gnash::rect::rect(int, int, int, int)'
../backend/render_handler.h:291: warning: passing `float' for converting 2 of `
gnash::rect::rect(int, int, int, int)'
../backend/render_handler.h:291: warning: passing `float' for converting 3 of `
gnash::rect::rect(int, int, int, int)'
../backend/render_handler.h:291: warning: passing `float' for converting 4 of `
gnash::rect::rect(int, int, int, int)'
character.cpp: In static member function `static gnash::as_value
gnash::character::blendMode(const gnash::fn_call&)':
character.cpp:601: error: invalid static_cast from type `double' to type `
gnash::character::BlendMode'

David Coppa <dcoppa>
Wed 14 Jan 2009 02:34:11 PM UTC, comment #13:

I was writing to report the missing #include <boost/lexical_cast.hpp> in libcore/asobj/Global.cpp

You were faster :)

Still going on with compilation...

David Coppa <dcoppa>
Wed 14 Jan 2009 02:23:46 PM UTC, comment #12:

Please test current trunk.

Benjamin Wolsey <bwy>
Project Member
Wed 14 Jan 2009 02:03:21 PM UTC, comment #11:

Confirmed.

Bastiaan Jacques <bjacques>
Project Member
Wed 14 Jan 2009 01:41:41 PM UTC, comment #10:

for (ContainerByOrder::const_reverse_iterator it=_props.template get<1>().rbegin(),
ie=_props.template get<1>().rend(); it != ie; ++it)

Seems to fix the error... Can confirm?

David Coppa <dcoppa>
Wed 14 Jan 2009 01:24:48 PM UTC, comment #9:

Does not help :(

David Coppa <dcoppa>
Wed 14 Jan 2009 01:17:32 PM UTC, comment #8:

And if you substitute line 39 with:

typedef container::template nth_index<1>::type ContainerByOrder;

or even

typedef typename container::template nth_index<1>::type ContainerByOrder;

does it help?

Benjamin Wolsey <bwy>
Project Member
Wed 14 Jan 2009 01:13:43 PM UTC, comment #7:

boost is boost-1.34.1p2

David Coppa <dcoppa>
Wed 14 Jan 2009 01:11:39 PM UTC, comment #6:

The "<1>" in

it=_props.get<1>().rbegin(), ie=_props.get<1>().rend();

is causing this error on OpenBSD.

OpenBSD 4.4-current (GENERIC) #1650: Sat Jan 10 12:32:20 MST 2009

# g++ -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd4.4/3.3.5/specs
Configured with:
Thread model: single
gcc version 3.3.5 (propolice)

David Coppa <dcoppa>
Wed 14 Jan 2009 01:06:59 PM UTC, comment #5:

Nope.

obsdtest.cpp: In function `void visitValues(V&)':
obsdtest.cpp:41: error: syntax error before `)' token
obsdtest.cpp:42: error: syntax error before `)' token

Brad Smith <brad0>
Wed 14 Jan 2009 01:01:52 PM UTC, comment #4:

I have attached a cpp file with a small testcase for these lines. I'd expect it also not to compile if Gnash doesn't. Please try compiling with g++ obsd.cpp, and let me know if it successfully compiles or not.

(file #17257)

Benjamin Wolsey <bwy>
Project Member
Wed 14 Jan 2009 12:33:00 PM UTC, comment #3:

the lines are:

119,120

for (ContainerByOrder::const_reverse_iterator it=_props.get<1>().rbegin(),
ie=_props.get<1>().rend(); it != ie; ++it)

and:

145,146

for (ContainerByOrder::const_reverse_iterator it=_props.get<1>().rbegin(),
ie=_props.get<1>().rend(); it != ie; ++it)

David Coppa <dcoppa>
Sun 04 Jan 2009 03:31:48 PM UTC, comment #2:

I'm sure we can sort this out quickly with a bit of feedback.

Can you please confirm what lines 119 and 120 are for you, as the lines I highlighted below are 118 and 119 - so that can't be the problem - and your error doesn't seem to tie up with 119-120.

Benjamin Wolsey <bwy>
Project Member
Mon 29 Dec 2008 10:30:20 AM UTC, comment #1:

The lines below seem to cause the error:

template <class V>
void visitValues(V& visitor, const as_object& this_ptr) const
{
typedef container::nth_index<1>::type ContainerByOrder; // this one
for (ContainerByOrder::const_reverse_iterator it=_props.get<1>().rbegin(),
ie=_props.get<1>().rend(); it != ie; ++it) // and this one
{
as_value val = it->getValue(this_ptr);
visitor.accept(it->mName, val);
}
}

In this sort of case I'd suspect a misinterpretation of < or > as the greater than / less than operator, but the template doesn't depend on a template parameter here, so there should be no need for further qualification with 'typename' or 'template'. You could still try changing the first line with an error to:

typedef container::template nth_index<1>::type ContainerByOrder;

or

typedef typename container::template nth_index<1>::type ContainerByOrder;

Both are still well-formed, I think, but should not be a requirement. If it builds after this change, it would be a compiler bug (assuming I've understood the standard correctly).

Benjamin Wolsey <bwy>
Project Member
Mon 29 Dec 2008 01:14:14 AM UTC, original submission:

Trying to build trunk here on a -current OpenBSD system... using the Gtk / Cairo / FFmpeg.. attached is a log of the failed build.

Brad Smith <brad0>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #17257:  obsdtest.cpp added by bwy (1KiB - text/x-c)
file #17154:  build.log added by brad0 (37KiB - application/octet-stream - The buid log.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bjacques (Posted a comment)
  • -unavailable- added by dcoppa (Posted a comment)
  • -unavailable- added by bwy (Posted a comment)
  • -unavailable- added by brad0 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 16 Jan 2009 03:26:05 PM UTCbwyStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 14 Jan 2009 01:01:52 PM UTCbwyAttached File-=>Added obsdtest.cpp, #17257
    Tue 13 Jan 2009 04:06:55 PM UTCbwyStatusNone=>Ready For Test
    Mon 29 Dec 2008 01:14:14 AM UTCbrad0Attached File-=>Added build.log, #17154

    Back to the top


    Powered by Savane 3.1-cleanup1