calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / external / firebird / asan.patch
blob2564c54d46ea93735089b8f1685ac19d1fe44935
1 --- builds/posix/Makefile.in
2 +++ builds/posix/Makefile.in
3 @@ -323,8 +323,8 @@
5 metadata.fdb: $(RUN_ISQL) $(SRC_ROOT)/dbs/metadata.sql
6 -$(RM) $@
7 - $(RUN_ISQL) -q -i $(SRC_ROOT)/dbs/metadata.sql
8 - $(RUN_GFIX) -mode read_only $@
9 + $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_ISQL) -q -i $(SRC_ROOT)/dbs/metadata.sql
10 + $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_GFIX) -mode read_only $@
11 $(CHMOD) 0444 $@
13 $(HELP_FDB): help.fdb
14 @@ -333,7 +333,7 @@
15 $(CHMOD) 0444 $@
17 help.fdb: $(BLD_ROOT)/misc/help.gbak
18 - $(RUN_GBAK) -MODE read_only -R $< $@
19 + $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_GBAK) -MODE read_only -R $< $@
20 $(CHMOD) 0444 $@
22 $(SECURITY_FDB): security.fdb
23 @@ -343,18 +343,18 @@
24 security.fdb: $(SRC_ROOT)/dbs/security.sql
25 -$(RM) $@
26 -$(RM) $(SECURITY_TMP)
27 - echo create database \'$(SECURITY_TMP)\'\; | $(RUN_ISQL)
28 - $(RUN_GFIX) -write async $(SECURITY_TMP)
29 - $(RUN_ISQL) -i $^ $(SECURITY_TMP)
30 + echo create database \'$(SECURITY_TMP)\'\; | $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_ISQL)
31 + $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_GFIX) -write async $(SECURITY_TMP)
32 + $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_ISQL) -i $^ $(SECURITY_TMP)
33 $(CHMOD) a=rw $(SECURITY_TMP)
34 $(CP) $(SECURITY_TMP) $@
35 - $(RUN_GFIX) -write sync $@
36 + $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_GFIX) -write sync $@
38 msg.timestamp: $(MSG_FILES)
39 -$(RM) msg.fdb
40 - echo create database \'msg.fdb\'\; | $(RUN_ISQL)
41 - $(RUN_GFIX) -write async msg.fdb
42 - for sql in $(MSG_FILES); do (echo $$sql; $(RUN_ISQL) -i $$sql msg.fdb) || exit; done
43 + echo create database \'msg.fdb\'\; | $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_ISQL)
44 + $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_GFIX) -write async msg.fdb
45 + for sql in $(MSG_FILES); do (echo $$sql; $(LIBO_TUNNEL_LIBRARY_PATH) $(RUN_ISQL) -i $$sql msg.fdb) || exit; done
46 $(TOUCH) $@
49 @@ -560,7 +560,7 @@
50 message_file: $(FIREBIRD_MSG)
52 $(FIREBIRD_MSG): $(BUILD_FILE) msg.timestamp
53 - $(BUILD_FILE) -d msg.fdb -f $@
54 + $(LIBO_TUNNEL_LIBRARY_PATH) $(BUILD_FILE) -d msg.fdb -f $@
55 $(CHMOD_6) $@
57 $(BUILD_FILE): $(BUILD_Objects) $(COMMON_LIB)
58 --- builds/posix/Makefile.in.examples
59 +++ builds/posix/Makefile.in.examples
60 @@ -123,8 +123,8 @@
62 $(EMPLOYEE_DB): $(EXAMPLES_DEST)/empbuild$(EXEC_EXT) $(INPUT_Sources) $(EXAMPLES_DEST)/isql$(EXEC_EXT)
63 -$(RM) $(EMPLOYEE_DB)
64 - ./empbuild $(EMPLOYEE_DB)
65 - $(GFIX) -write sync $(EMPLOYEE_DB)
66 + $(LIBO_TUNNEL_LIBRARY_PATH) ./empbuild $(EMPLOYEE_DB)
67 + $(LIBO_TUNNEL_LIBRARY_PATH) $(GFIX) -write sync $(EMPLOYEE_DB)
68 -$(CHMOD_6) $(EMPLOYEE_DB)
70 # To get past the fact isql is called from the programs, we create a local link in this directory
71 @@ -140,7 +140,7 @@
73 $(EXAMPLES_DEST)/empbuild.fdb : $(EXAMPLES_DEST)/empddl.sql $(EXAMPLES_DEST)/empbld.sql $(EXAMPLES_DEST)/isql$(EXEC_EXT)
74 -$(RM) $(EXAMPLES_DEST)/empbuild.fdb
75 - $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i empbld.sql
76 + $(LIBO_TUNNEL_LIBRARY_PATH) $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i empbld.sql
78 # The chain for intlemp.fdb is the same a script file to create an empty database
79 # to allow a .e program to be compiled, to then create and populate with data
80 @@ -158,7 +158,7 @@
82 $(EXAMPLES_DEST)/intlbuild.fdb : $(EXAMPLES_DEST)/intlddl.sql $(EXAMPLES_DEST)/intlbld.sql $(EXAMPLES_DEST)/isql$(EXEC_EXT)
83 -$(RM) intlbuild.fdb
84 - $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i intlbld.sql
85 + $(LIBO_TUNNEL_LIBRARY_PATH) $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i intlbld.sql
88 $(EXAMPLES_DEST)/%.sql: $(EXAMPLES_SRC)/empbuild/%.sql
89 --- builds/posix/make.rules
90 +++ builds/posix/make.rules
91 @@ -68,17 +68,17 @@
92 .SUFFIXES: .c .e .epp .cpp
94 .e.c:
95 - $(GPRE_CURRENT) $(GPRE_FLAGS) $< $@
96 + $(LIBO_TUNNEL_LIBRARY_PATH) $(GPRE_CURRENT) $(GPRE_FLAGS) $< $@
99 $(OBJ)/jrd/%.cpp: $(SRC_ROOT)/jrd/%.epp
100 - $(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $(firstword $<) $@
101 + $(LIBO_TUNNEL_LIBRARY_PATH) $(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $(firstword $<) $@
103 $(OBJ)/isql/%.cpp: $(SRC_ROOT)/isql/%.epp
104 - $(GPRE_CURRENT) $(ISQL_GPRE_FLAGS) $< $@
105 + $(LIBO_TUNNEL_LIBRARY_PATH) $(GPRE_CURRENT) $(ISQL_GPRE_FLAGS) $< $@
107 $(OBJ)/%.cpp: $(SRC_ROOT)/%.epp
108 - $(GPRE_CURRENT) $(GPRE_FLAGS) $(firstword $<) $@
109 + $(LIBO_TUNNEL_LIBRARY_PATH) $(GPRE_CURRENT) $(GPRE_FLAGS) $(firstword $<) $@
112 .SUFFIXES: .lo .o .cpp .c
113 --- src/common/classes/alloc.cpp
114 +++ src/common/classes/alloc.cpp
115 @@ -2187,7 +2187,7 @@
117 void* MemPool::allocRaw(size_t size)
119 -#ifndef USE_VALGRIND
120 +#if !(defined USE_VALGRIND || defined USE_ASAN)
121 if (size == DEFAULT_ALLOCATION)
123 MutexLockGuard guard(*cache_mutex, "MemPool::allocRaw");
124 @@ -2267,7 +2267,7 @@
126 void MemPool::releaseRaw(bool destroying, void* block, size_t size, bool use_cache) throw ()
128 -#ifndef USE_VALGRIND
129 +#if !(defined USE_VALGRIND || defined USE_ASAN)
130 if (use_cache && (size == DEFAULT_ALLOCATION))
132 MutexLockGuard guard(*cache_mutex, "MemPool::releaseRaw");
133 @@ -2277,7 +2277,7 @@
134 return;
137 -#else
138 +#elif defined USE_VALGRIND
139 // Set access protection for block to prevent memory from deleted pool being accessed
140 int handle = /* //VALGRIND_MAKE_NOACCESS */ VALGRIND_MAKE_MEM_DEFINED(block, size);
142 --- src/common/classes/alloc.h
143 +++ src/common/classes/alloc.h
144 @@ -295,40 +295,60 @@
146 // operators new and delete
148 +#if !defined USE_ASAN
149 inline void* operator new(size_t s ALLOC_PARAMS)
151 return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
153 inline void* operator new[](size_t s ALLOC_PARAMS)
155 return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
157 +#endif
159 inline void* operator new(size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS)
161 +#if defined USE_ASAN
162 + return operator new(s);
163 +#else
164 return pool.allocate(s ALLOC_PASS_ARGS);
165 +#endif
167 inline void* operator new[](size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS)
169 +#if defined USE_ASAN
170 + return operator new[](s);
171 +#else
172 return pool.allocate(s ALLOC_PASS_ARGS);
173 +#endif
176 +#if !defined USE_ASAN
177 inline void operator delete(void* mem ALLOC_PARAMS) throw()
179 MemoryPool::globalFree(mem);
181 inline void operator delete[](void* mem ALLOC_PARAMS) throw()
183 MemoryPool::globalFree(mem);
185 +#endif
187 inline void operator delete(void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) throw()
189 +#if defined USE_ASAN
190 + return operator delete(mem);
191 +#else
192 MemoryPool::globalFree(mem);
193 +#endif
195 inline void operator delete[](void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) throw()
197 +#if defined USE_ASAN
198 + return operator delete[](mem);
199 +#else
200 MemoryPool::globalFree(mem);
201 +#endif
204 #ifdef DEBUG_GDS_ALLOC
205 --- src/include/firebird.h
206 +++ src/include/firebird.h
207 @@ -38,8 +38,17 @@
208 #include "gen/autoconfig.h"
209 #endif
211 +#if defined __clang__
212 +//#if __has_feature(address_sanitizer)
213 +#define USE_ASAN
214 +//#endif
215 +#endif
216 +#if defined __SANITIZE_ADDRESS__
217 +#define USE_ASAN
218 +#endif
220 // Using our debugging code is pointless when we may use Valgrind features
221 -#if defined(DEV_BUILD) && !defined(USE_VALGRIND)
222 +#if defined(DEV_BUILD) && !(defined(USE_VALGRIND) || defined(USE_ASAN))
223 #define DEBUG_GDS_ALLOC
224 #endif
226 --- src/jrd/SimilarToMatcher.h
227 +++ src/jrd/SimilarToMatcher.h
228 @@ -338,7 +338,7 @@
229 private:
230 static const unsigned INCREASE_FACTOR = 50;
231 unsigned size;
232 - AutoPtr<UCHAR> data;
233 + AutoPtr<UCHAR, ArrayDelete> data;
234 T* end;
236 #endif // RECURSIVE_SIMILAR
237 --- configure.orig 2018-06-03 17:44:50.152951348 +0200
238 +++ configure 2018-06-03 17:45:11.708907807 +0200
239 @@ -18479,11 +18479,11 @@
240 #ifdef __cplusplus
241 extern "C"
242 #endif
243 -char dlopen ();
244 +char dlsym ();
246 main ()
248 -return dlopen ();
249 +return dlsym ();
251 return 0;