brave-experiments / ad-block

Ad block engine used in the Brave browser for ABP filter syntax based lists like EasyList.
https://www.brave.com
Mozilla Public License 2.0
240 stars 95 forks source link

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) #199

Closed ymh8416 closed 5 years ago

ymh8416 commented 5 years ago

I used your latest version of adblock But he always crash, the following is the contents of the crash,can you solve this issue? thank you very very much

1、backtrace:

00 pc 000000000002a0dc /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (ZNK13ContextDomaineqERKS+7)

01 pc 0000000000029e17 /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (_ZN7HashSetI13ContextDomainE3AddERKS0_b+46)

02 pc 0000000000029329 /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (_ZN6Filter12parseDomainsEPKc+180)

03 pc 000000000002991f /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (_ZN6Filter26contextDomainMatchesFilterEPKc+26)

04 pc 0000000000029a5b /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (ZN6Filter14matchesOptionsEPKc12FilterOptionS1+102)

05 pc 0000000000029bd9 /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (_ZN6Filter7matchesEPKci12FilterOptionS1_P11BloomFilterS1_i+32)

06 pc 0000000000026453 /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (_ZN13AdBlockClient18hasMatchingFiltersEP6FilteriPKci12FilterOptionS3_P11BloomFilterS3iPS1+54)

07 pc 0000000000026a15 /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (_ZN13AdBlockClient7matchesEPKc12FilterOptionS1PP6FilterS5+500)

08 pc 0000000000024d75 /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/lib/arm/libadblock.so (Java_com_pure_browser_adblock_AdblockEngine_matches+72)

09 pc 00000000000858f3 /data/app/com.litepure.browser.gp-hcvKbh90uIQ6EGqMf4W0Xg==/oat/arm/base.odex

2、 backtrace:

00 pc 000000000002a0dc /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (ContextDomain::operator==(ContextDomain const&) const+7)

01 pc 0000000000029e17 /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (HashSet::Add(ContextDomain const&, bool)+46)

02 pc 0000000000029329 /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (Filter::parseDomains(char const*)+180)

03 pc 000000000002991f /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (Filter::contextDomainMatchesFilter(char const*)+26)

04 pc 0000000000029a5b /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (Filter::matchesOptions(char const, FilterOption, char const)+102)

05 pc 0000000000029bd9 /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (Filter::matches(char const, int, FilterOption, char const, BloomFilter, char const, int)+32)

06 pc 0000000000026453 /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (AdBlockClient::hasMatchingFilters(Filter, int, char const, int, FilterOption, char const, BloomFilter, char const*, int, Filter**)+54)

07 pc 0000000000026b41 /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (AdBlockClient::matches(char const, FilterOption, char const, Filter, Filter)+800)

08 pc 0000000000024d75 /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/lib/arm/libadblock.so (Java_com_pure_browser_adblock_AdblockEngine_matches+72)

09 pc 000000000001a09b /data/app/com.litepure.browser.gp-AQbNzpilFXENVlz8LU5_Ig==/oat/arm/base.odex

bbondy commented 5 years ago

I will need the source code that you're using please

bbondy commented 5 years ago

If you use 4.1.4 you should be ok. It was probably that you were using an old version and it pointed to an adblock list which no longer exists.

ymh8416 commented 5 years ago

If you use 4.1.4 you should be ok. It was probably that you were using an old version and it pointed to an adblock list which no longer exists.

Thank you very much for your answer. I used the latest code from the 0.63.x branch。 What is 4.1.4?

ymh8416 commented 5 years ago

thanks i known, i will try it on 4.1.4

ymh8416 commented 5 years ago

If you use 4.1.4 you should be ok. It was probably that you were using an old version and it pointed to an adblock list which no longer exists.

I have used the latest 4.1.7 source code. but I still get this singal 11 error some times Here is how to use it,Attachment is my serialized ad blocker rule files:

char g_serialize_buffer = readFile("adblockrules.txt"); AdBlockClient g_adblock_client = new AdBlockClient(); g_adblock_client->deserialize(g_serialize_buffer); g_adblock_client->matches( "https://s4.cnzz.com/z_stat.php?id=1261861916&web_id=1261861916", FONoFilterOption, "http://storebt.net/home");

I don't know if this is the right way to use adblock, thank you very very much for helping me answer

adblockrules.txt

bbondy commented 5 years ago

No deserialize is only for serialized buffers, you want parse

ymh8416 commented 5 years ago

No deserialize is only for serialized buffers, you want parse

Thank you very much for responding to me. The adblockrules.txt in my attachment is already buffered after the serialized, so i can use the deserialize function directly.