Bug 4460 - The runtime library of ocaml-sdl raises an error when used
Summary: The runtime library of ocaml-sdl raises an error when used
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Florent Monnier
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 20:27 CET by Malo Deniélou
Modified: 2012-04-02 18:25 CEST (History)
2 users (show)

See Also:
Source RPM: ocaml-sdl
CVE:
Status comment:


Attachments

Description Malo Deniélou 2012-02-09 20:27:36 CET
Description of problem:
When compiling a program with module sdlgfx, I get the following error:
Error on dynamically loaded library: /usr/lib64/ocaml/stublibs/dllsdlgfxstub.so: /usr/lib64/ocaml/stublibs/dllsdlgfxstub.so: undefined symbol: Val_SDLSurface


Version-Release number of selected component (if applicable):
ocaml-sdl-0.8.0-1

How reproducible:
Everytime

Steps to Reproduce:
1. Install ocaml-sdl
2. create a simple test file containing «print_string "hello"»
3. compile it with 
ocamlfind ocamlc -o test -thread -package sdl.sdlgfx -linkpkg -g test.ml
4. It gives the error.
Malo Deniélou 2012-02-09 20:27:58 CET

Summary: The runtime library raises an error when used => The runtime library of ocaml-sdl raises an error when used

Comment 1 Marja Van Waes 2012-03-25 22:18:33 CEST
@ Malo

Sorry, we missed this bug. Is it stil valid in current cauldron?

cc'ing maintainer

CC: (none) => blue_prawn, marja11

Comment 2 Malo Deniélou 2012-03-25 22:24:15 CEST
I think it's still there. I don't know the reason why it fails though. Florent?
Comment 3 Florent Monnier 2012-03-26 21:46:39 CEST
This was not a bug of the mageia package but an upstream bug.

Nevertheless I have fixed it (and sent the patch upstream and to debian).

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 4 Malo Deniélou 2012-03-27 11:15:46 CEST
Thanks a lot Florent!
Comment 5 Malo Deniélou 2012-04-02 15:35:59 CEST
Actually I now get the error:

Error: Error on dynamically loaded library: /usr/lib/ocaml/stublibs/dllsdlgfxstub.so: /usr/lib/ocaml/stublibs/dllsdlgfxstub.so: undefined symbol: caml_ba_alloc

Thanks.

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 6 Marja Van Waes 2012-04-02 15:50:27 CEST
(In reply to comment #5)
> Actually I now get the error:
> 
> Error: Error on dynamically loaded library:
> /usr/lib/ocaml/stublibs/dllsdlgfxstub.so:
> /usr/lib/ocaml/stublibs/dllsdlgfxstub.so: undefined symbol: caml_ba_alloc
> 
> Thanks.

assigning to maintainer

Assignee: bugsquad => blue_prawn

Comment 7 Florent Monnier 2012-04-02 17:56:08 CEST
This is not the same bug at all, you should maybe not reopen the previous one which is fixed, but another bug report.

This message error is the usual one when one compiles something and forgot to add bigarray.cma or .cmxa on the compilation command line. And indeed when I do so I don't get this error message.

Now using findlib, findlib should add this dependency.
If I replace the previous command line by this one:
ocamlfind ocamlc -o test -thread -package sdl,sdl.sdlgfx -linkpkg -g test.ml
I don't have any error anymore.

So it is maybe an error that should be fixed in the META file, though I don't see any error there because the section package "sdlgfx" contains requires="sdl" and the main sdl section contains requires="bigarray". I have even tried to add it explicitly to the sdlgfx section like this:
-  require = "sdl"
+  require = "sdl bigarray"
But I still get the same error message.


If I add the parameter -verbose to the ocamlfind command, we can check that indeed bigarray.cma is provided as it should with sdl, but not with only sdlgfx (and I really don't know why):


$ ocamlfind ocamlc -verbose -o test -thread -package sdl,sdl.sdlgfx -linkpkg -g test.ml
Effective set of compiler predicates: pkg_unix,pkg_threads.posix,pkg_threads,pkg_bigarray,pkg_sdl,pkg_sdl.sdlgfx,autolink,mt,mt_posix,byte
+ ocamlc.opt -verbose -o test -g -thread -I /usr/lib/ocaml/sdl /usr/lib/ocaml/unix.cma /usr/lib/ocaml/threads/threads.cma /usr/lib/ocaml/bigarray.cma /usr/lib/ocaml/sdl/sdl.cma /usr/lib/ocaml/sdl/sdlgfx.cma test.ml


$ ocamlfind ocamlc -verbose -o test -thread -package sdl.sdlgfx -linkpkg -g test.ml
Effective set of compiler predicates: pkg_unix,pkg_threads.posix,pkg_threads,pkg_sdl.sdlgfx,autolink,mt,mt_posix,byte
+ ocamlc.opt -verbose -o test -g -thread -I /usr/lib/ocaml/sdl /usr/lib/ocaml/unix.cma /usr/lib/ocaml/threads/threads.cma /usr/lib/ocaml/sdl/sdlgfx.cma test.ml
File "test.ml", line 1, characters 0-1:
Error: Error on dynamically loaded library: /usr/lib/ocaml/stublibs/dllsdlgfxstub.so: /usr/lib/ocaml/stublibs/dllsdlgfxstub.so: undefined symbol: caml_ba_alloc
ocamlc.opt returned with exit code 2



So with my knowledge of the META files there is nothing more I can do.
Anyway who will use sdlgfx without the main sdl package? probably noone, so even if we don't fix this dependency problem I think we can close this second report too.

Moreover, just like the first bug report, this bug is an upstream bug too, because the META file was not added by us.
Comment 8 Florent Monnier 2012-04-02 18:11:53 CEST
It was just a typo in the META file (so indeed an upstream bug):

-  require = "sdl"
+  requires = "sdl"

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 9 Malo Deniélou 2012-04-02 18:25:44 CEST
great :-). Thanks.

Note You need to log in before you can comment on or make changes to this bug.