[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[438] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-23 09:18:37
|
Revision: 438 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=438&view=rev Author: nickols_k Date: 2012-11-23 09:18:26 +0000 (Fri, 23 Nov 2012) Log Message: ----------- Change number of backtraces. Note: i suspect that my development environment has been virused to add illegal patch into MPlayerXP. When i perform transition on to C++ then i found out the strange behaviour of ld: - [424] commit didn't break linkage of the project althrough this patch replaces some short C-names of functions with C++-long names. Therefore, short C-names like rtsp_session_start() were linked by g++ regardless the fact that official source-tree of project lost them. - [437] commit emulates fixing of problem. I had movie which couldn't be played before this commit. But additional MSG_V() cannot fix anything in player. Furthermore, player after this commit doesn't print some symbols which it must print with this patch. - list of suspect calls with -core.malloc-debug=3 option points me that some internal contexts of player were substituted by illegal patch. Additional proof of that is [434] commit. This commit did illegal patch thinner, but not removed it. Furthemore, each replace of #define with inline function or enum decreases size of project regardless on long C++-names of functions and data objects. Well, one of goal transition project on C++ was using of C++ long-names which are dynamically changed together with changing number or types of arguments. But, it seems that there is big aliance against of me and my project. And i suspect some objects from mplayerhq team who revenge me for fork using dirty technology. Considering the fact that they hate C++ i'm suspecting that they coerce somebody to attack my project and modify illegal patch parallel with my improvements. Additional observations: - My local copy of g++ still prints: "warning: 'packed' attribute ignored" that makes win32loader non working at least. That warning became appears right after adding so-called small secury holes into structures of project. - My local copy of /lib32/libgcc_s.so was damaged because demuxer returns -nan in pts field for each packet. Moreover, upgrade of gcc didn't help to solve this problem. Thus, i have no working 32-bit development environment. - My 32-bit development environment (aka: gcc-4.5.4) printed: --- 8< ---- In file included from ../osdep/cpudetect.h:4:0, from win32.c:942: ../mplayerxp.h:130:20: error: invalid storage class for function 'escape_player' ../mplayerxp.h:130:20: warning: no previous prototype for 'escape_player' ../mplayerxp.h:135:23: error: invalid storage class for function 'check_pin' ../mplayerxp.h:135:23: warning: no previous prototype for 'check_pin' --- 8< --- mplayerxp.h:130: static inline void escape_player(const char* why,unsigned num_calls) { mplayerxp.h:135: static inline MPXP_Rc check_pin(const char* module,unsigned pin1,unsigned pin2) { --- 8< --- - Last few days, 32-bit binary of mplayerxp is able to print help only and ignores command-line arguments. But who is that (***insert any colorful phrases here***) analog of virus which attacks my development environment and who is his host(s)? Thus, i need find out the way to restore the quality of my development enviroment! Modified Paths: -------------- mplayerxp/configure mplayerxp/libao2/ao_sdl.cpp mplayerxp/osdep/mp_malloc.cpp Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2012-11-22 18:37:26 UTC (rev 437) +++ mplayerxp/configure 2012-11-23 09:18:26 UTC (rev 438) @@ -795,6 +795,7 @@ bsd && add_ldflags "-rdynamic" enabled dbg23 def_debug='#define MP_DEBUG 1' || def_debug='#undef MP_DEBUG' +enabled dbg23 && check_cflags "-fbounds-check" # Checking for VIDIX enabled vidix && xxrequire2 vidix "vidix/vidix.h vidix/vidixlibxx.h" Vidix -lvidixxx Modified: mplayerxp/libao2/ao_sdl.cpp =================================================================== --- mplayerxp/libao2/ao_sdl.cpp 2012-11-22 18:37:26 UTC (rev 437) +++ mplayerxp/libao2/ao_sdl.cpp 2012-11-23 09:18:26 UTC (rev 438) @@ -9,6 +9,7 @@ * Thanks to Arpi for nice ringbuffer-code! * */ +#include <algorithm> #include <stdio.h> #include <stdlib.h> @@ -56,8 +57,7 @@ int x; while(len>0){ if(priv->full_buffers==NUM_BUFS) break; - x=BUFFSIZE-priv->buf_write_pos; - if(x>len) x=len; + x=std::min(unsigned(len),BUFFSIZE-priv->buf_write_pos); memcpy(priv->buffer[priv->buf_write]+priv->buf_write_pos,data+len2,x); len2+=x; len-=x; priv->buffered_bytes+=x; priv->buf_write_pos+=x; @@ -77,8 +77,7 @@ int x; while(len>0){ if(priv->full_buffers==0) break; // no more data buffered! - x=BUFFSIZE-priv->buf_read_pos; - if(x>len) x=len; + x=std::min(unsigned(len),BUFFSIZE-priv->buf_read_pos); memcpy(data+len2,priv->buffer[priv->buf_read]+priv->buf_read_pos,x); SDL_MixAudio(data+len2, data+len2, x, priv->volume); len2+=x; len-=x; Modified: mplayerxp/osdep/mp_malloc.cpp =================================================================== --- mplayerxp/osdep/mp_malloc.cpp 2012-11-22 18:37:26 UTC (rev 437) +++ mplayerxp/osdep/mp_malloc.cpp 2012-11-23 09:18:26 UTC (rev 438) @@ -17,11 +17,13 @@ namespace mpxp { +enum { Max_BackTraces=13 }; + typedef struct mp_slot_s { any_t* page_ptr; size_t size; size_t ncalls; - any_t* calls[10]; + any_t* calls[Max_BackTraces]; }mp_slot_t; typedef struct mp_slot_container_s { @@ -218,7 +220,7 @@ if(!slot) { printf("[__prot_free_append] suspect call found! Can't find slot for address: %p [aligned: %p]\n",ptr,page_ptr); __prot_print_slots(&priv->mallocs); - __print_backtrace(10); + __print_backtrace(Max_BackTraces); kill(getpid(), SIGILL); } size_t fullsize=app_fullsize(slot->size); @@ -234,7 +236,7 @@ if(!slot) { printf("[__prot_realloc_append] suspect call found! Can't find slot for address: %p [aligned: %p]\n",ptr,prot_page_align(ptr)); __prot_print_slots(&priv->mallocs); - __print_backtrace(10); + __print_backtrace(Max_BackTraces); kill(getpid(), SIGILL); } memcpy(rp,ptr,std::min(slot->size,size)); @@ -268,7 +270,7 @@ if(!slot) { printf("[__prot_free_prepend] suspect call found! Can't find slot for address: %p [aligned: %p]\n",ptr,page_ptr); __prot_print_slots(&priv->mallocs); - __print_backtrace(10); + __print_backtrace(Max_BackTraces); kill(getpid(), SIGILL); } mprotect(page_ptr,__VM_PAGE_SIZE__,MP_PROT_READ|MP_PROT_WRITE); @@ -283,7 +285,7 @@ if(!slot) { printf("[__prot_realloc_prepend] suspect call found! Can't find slot for address: %p [aligned: %p]\n",ptr,pre_page_align(ptr)); __prot_print_slots(&priv->mallocs); - __print_backtrace(10); + __print_backtrace(Max_BackTraces); kill(getpid(), SIGILL); } memcpy(rp,ptr,std::min(slot->size,size)); @@ -324,7 +326,7 @@ rp=malloc(size); if(rp) { slot=prot_append_slot(&priv->mallocs,rp,size); - slot->ncalls=backtrace(slot->calls,10); + slot->ncalls=backtrace(slot->calls,Max_BackTraces); } return rp; } @@ -335,7 +337,7 @@ if(rp) { mp_slot_t* slot; slot=prot_append_slot(&priv->mallocs,rp,size); - slot->ncalls=backtrace(slot->calls,10); + slot->ncalls=backtrace(slot->calls,Max_BackTraces); } return rp; } @@ -351,7 +353,7 @@ MSG_WARN("[bt_realloc] suspect call found! Can't find slot for address: %p\n",ptr); mp_slot_t* _slot; _slot=prot_append_slot(&priv->reallocs,ptr,size); - _slot->ncalls=backtrace(_slot->calls,10); + _slot->ncalls=backtrace(_slot->calls,Max_BackTraces); } else { slot->page_ptr=rp; // update address after realloc slot->size=size; @@ -366,7 +368,7 @@ MSG_WARN("[bt_free] suspect call found! Can't find slot for address: %p\n",ptr); mp_slot_t* _slot; _slot=prot_append_slot(&priv->frees,ptr,0); - _slot->ncalls=backtrace(_slot->calls,10); + _slot->ncalls=backtrace(_slot->calls,Max_BackTraces); return; } prot_free_slot(&priv->mallocs,ptr); @@ -389,7 +391,7 @@ } } if(printable) MSG_INFO("%20s",s); - else for(j=0;j<std::min(c->slots[i].size,size_t(10));j++) { + else for(j=0;j<std::min(c->slots[i].size,size_t(Max_BackTraces));j++) { MSG_INFO("%02X ",(unsigned char)s[j]); } MSG_INFO("\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |