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

Building on older MacOS: build succeeds now, but app fails at launch with malloc errors #82

Closed
barracuda156 opened this issue Aug 22, 2022 · 4 comments

Comments

@barracuda156
Copy link

I am trying to fix rawstudio for Macports, where it is outdated and broken across the board for ages.

At some point of the build (rawstudio 2.0, 10.6.8 Rosetta, gcc12), there are multiple errors of this sort:

../../librawstudio/rawstudio.h:26:1: note: 'extern "C"' linkage started here
   26 | extern "C" {
      | ^~~~~~~~~~
/opt/local/include/gcc12/c++/type_traits:539:3: error: template with C linkage
  539 |   template<typename _Tp>
      |   ^~~~~~~~
In file included from /opt/local/inclu/opt/local/include/gcc12/c++/type_traits:590:3: error: template with C linkage
  590 |   template<typename _Tp>
      |   ^~~~~~~~
/opt/local/include/gcc12/c++/type_traits:464:3: error: template with C linkage
  464 |   template<typename _Tp>

I tried then moving <sys/types.h> out of conditional block (like it is done in some Apple headers):

#include <sys/types.h>

#ifdef  __cplusplus
extern "C" {
#endif

That changed nothing, I get same error. This still might be header positioning related, like: msgpack/msgpack-c#551
Any suggestions what is going wrong?

@sergiomb2
Copy link
Contributor

can be about glibc fix [1] you may try revert these two commits i.e. move [2] to before #include <sys/types.h>

[1]
https://github.com/rawstudio/rawstudio/commits/master/librawstudio
bb38271
12d0d64

[2]

#ifdef  __cplusplus
extern "C" {
#endif

@barracuda156
Copy link
Author

@sergiomb2 Thank you. Since v. 2.0 had other bugs too, I moved to the latest-commit version, and it does not exhibit this problem.

Unfortunately, while it builds fine (with deprecated symbols warnings, but no errors), it fails to work for me:

10:rawstudio-rawstudio-c140a5e svacchanda$ /opt/local/bin/rawstudio
rawstudio(48527) malloc: *** error for object 0xa0f15754: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(48527) malloc: *** error for object 0xa0f157c4: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Session D-Bus not running. Try running `launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist'.)
dbus[48527]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
dlopen(/opt/local/lib/rawstudio/plugins/dcp.so, 10): Symbol not found: _exposure_ramp
  Referenced from: /opt/local/lib/rawstudio/plugins/dcp.so
  Expected in: dynamic lookup

**
ERROR:rs-plugin-manager.c:56:rs_plugin_manager_load_all_plugins: assertion failed: (g_type_module_use(G_TYPE_MODULE(plugin)))
Bail out! ERROR:rs-plugin-manager.c:56:rs_plugin_manager_load_all_plugins: assertion failed: (g_type_module_use(G_TYPE_MODULE(plugin)))
Abort trap

This may not be a problem of rawstudio though. Older MacOS get these malloc errors time to time, and there is no neat fix for that: iains/darwin-toolchains-start-here#20

@barracuda156 barracuda156 changed the title Errors with rawstudio.h: error: template with C linkage Building on older MacOS: build succeeds now, but app fails at launch with malloc errors Aug 23, 2022
@barracuda156
Copy link
Author

Rebuilt with gcc10-bootstrap, same thing:

10:rawstudio-rawstudio-c140a5e svacchanda$ /opt/local/bin/rawstudio
rawstudio(68118) malloc: *** error for object 0xa0f15754: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0xa0f157c4: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2373600: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2372c68: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2372bd0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2372c1c: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2372b08: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x23729e0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2372900: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2372970: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2372838: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x2373540: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x23736c0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x23736cc: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
rawstudio(68118) malloc: *** error for object 0x23736e8: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Session D-Bus not running. Try running `launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist'.)
dbus[68118]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
dlopen(/opt/local/lib/rawstudio/plugins/dcp.so, 10): Symbol not found: _exposure_ramp
  Referenced from: /opt/local/lib/rawstudio/plugins/dcp.so
  Expected in: dynamic lookup

**
ERROR:rs-plugin-manager.c:56:rs_plugin_manager_load_all_plugins: assertion failed: (g_type_module_use(G_TYPE_MODULE(plugin)))
Bail out! ERROR:rs-plugin-manager.c:56:rs_plugin_manager_load_all_plugins: assertion failed: (g_type_module_use(G_TYPE_MODULE(plugin)))
Abort trap

And gcc-4.2 cannot build Rawspeed module :(

@catap Have you got any ideas how to go about those?

@barracuda156
Copy link
Author

We have fixed this issue in Macports. Closing.

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

2 participants