Changeset 5834:22e75d31bfd8 in roaraudio


Ignore:
Timestamp:
01/06/13 19:56:21 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Fix #296 by using a workaround (disabling RTLD_DEEPBIND). Needs to be fully fixed next release. (See #296)

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5814 r5834  
    66        * Made build system tests return correct error codes. 
    77        * Improved CSI: Make it easier to register and access services. 
     8        * Allow seperation of plugin's stdvios (See: #296) 
    89 
    910v. 1.0beta8 - Mon Dec 10 2012 12:42 CET 
  • libroar/roardl.c

    r5823 r5834  
    5959  void *  global_data_state; 
    6060  struct roar_notify_core * notifycore; 
     61  struct roar_vio_calls * stdvios[3]; 
    6162 } context; 
    6263 unsigned int runtime_flags; 
     
    357358 struct roar_dl_lhandle * ret = NULL; 
    358359#if defined(ROAR_HAVE_H_DLFCN) 
    359 #ifdef RTLD_DEEPBIND 
     360#if defined(RTLD_DEEPBIND) && 0 
     361 // FIXME: this is current disabled. See #296. 
    360362 int libdl_flags = RTLD_DEEPBIND; 
    361363#else 
     
    421423 
    422424 ret->para = para; 
     425 
     426 if ( roar_vio_ref(roar_stdin) == 0 ) 
     427  ret->context.stdvios[0] = roar_stdin; 
     428 if ( roar_vio_ref(roar_stdout) == 0 ) 
     429  ret->context.stdvios[1] = roar_stdout; 
     430 if ( roar_vio_ref(roar_stderr) == 0 ) 
     431  ret->context.stdvios[2] = roar_stderr;  
    423432 
    424433 if ( ra_init ) { 
     
    433442    FreeLibrary(ret->handle); 
    434443#endif 
     444   roar_vio_unref(ret->context.stdvios[0]); 
     445   roar_vio_unref(ret->context.stdvios[1]); 
     446   roar_vio_unref(ret->context.stdvios[2]); 
    435447   roar_mm_free(ret); 
    436448   roar_error = err; 
     
    501513 ret = -1; 
    502514#endif 
     515 
     516 roar_vio_unref(lhandle->context.stdvios[0]); 
     517 roar_vio_unref(lhandle->context.stdvios[1]); 
     518 roar_vio_unref(lhandle->context.stdvios[2]); 
    503519 
    504520 if ( lhandle->context.global_data != NULL ) 
     
    726742} 
    727743 
     744static inline void __swap_stdvios(struct roar_dl_lhandle * lhandle) { 
     745 struct roar_vio_calls * vio; 
     746 
     747 vio = roar_stdin; 
     748 roar_stdin = lhandle->context.stdvios[0]; 
     749 lhandle->context.stdvios[0] = vio; 
     750 vio = roar_stdout; 
     751 roar_stdout = lhandle->context.stdvios[1]; 
     752 lhandle->context.stdvios[1] = vio; 
     753 vio = roar_stderr; 
     754 roar_stderr = lhandle->context.stdvios[2]; 
     755 lhandle->context.stdvios[2] = vio; 
     756} 
     757 
    728758int                      roar_dl_context_restore(struct roar_dl_lhandle * lhandle) { 
    729759 struct roar_error_state error_state; 
     
    740770 roar_err_restore(&(lhandle->context.error_state)); 
    741771 lhandle->context.error_state = error_state; 
     772 
     773 __swap_stdvios(lhandle); 
    742774 
    743775 if ( lhandle->lib->global_data_pointer != NULL ) { 
     
    777809  *(lhandle->lib->global_data_pointer) = lhandle->context.global_data_state; 
    778810 } 
     811 
     812 __swap_stdvios(lhandle); 
    779813 
    780814 roar_err_store(&error_state); 
  • libroar/vio.c

    r5823 r5834  
    218218int     roar_vio_unref    (struct roar_vio_calls * vio) { 
    219219 int ret; 
     220 int err; 
    220221 
    221222 ROAR_DBG("roar_vio_unref(vio=%p) = ?", vio); 
     
    240241 roar_err_update(); 
    241242 
    242  if ( vio->flags & ROAR_VIO_FLAGS_FREESELF ) 
     243 err = roar_error; 
     244 
     245 if ( vio->flags & ROAR_VIO_FLAGS_FREESELF ) { 
     246  roar_vio_clear_calls(vio); 
    243247  roar_mm_free(vio); 
    244  
     248 } else { 
     249  roar_vio_clear_calls(vio); 
     250 } 
     251 
     252 roar_error = err; 
    245253 return ret; 
    246254} 
  • libroar/vio_stdvios.c

    r5823 r5834  
    3939 { .inst     = (void*)(ROAR_INSTINT)(ROAR_STDIN  + 1), 
    4040   .flags    = 0x00000000, 
    41    .refc     = 0, 
     41   .refc     = 1, 
    4242   .read     = roar_vio_basic_read, 
    4343   .write    = roar_vio_basic_write, 
     
    4949 { .inst     = (void*)(ROAR_INSTINT)(ROAR_STDOUT + 1), 
    5050   .flags    = 0x00000000, 
    51    .refc     = 0, 
     51   .refc     = 1, 
    5252   .read     = roar_vio_basic_read, 
    5353   .write    = roar_vio_basic_write, 
     
    5959 { .inst     = (void*)(ROAR_INSTINT)(ROAR_STDERR + 1), 
    6060   .flags    = 0x00000000, 
    61    .refc     = 0, 
     61   .refc     = 1, 
    6262   .read     = roar_vio_basic_read, 
    6363   .write    = roar_vio_basic_write, 
Note: See TracChangeset for help on using the changeset viewer.