Aspose process getting crashed ECDCTS-9614

Hi Team,

In one of our customer environment Aspose processes are getting crashed

We are seeing following dumps

  APPLICATION_VERIFIER_FLAGS:  0
    CONTEXT:  (.ecxr)
    rax=00000155e2fd3000 rbx=00000000000000c9 rcx=fffffeaa1d02d160
    rdx=0000000000000000 rsi=00000155e2fd2ea0 rdi=0000000000000000
    rip=00007ffe2621cd41 rsp=0000003ec33fccd8 rbp=00000155d37e3730
     r8=7efefefefefefeff  r9=c1302f2f372f2f2f r10=000000075d110ac8
    r11=8101010101010100 r12=0000000000000000 r13=000000075d110998
    r14=0000003ec33fcdb8 r15=00000155a66da000
    iopl=0         nv up ei pl zr na po nc
    cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
    harfbuzz_shaping_engine_dll!Java_com_aspose_words_shaping_harfbuzz_HB_hb_1shape+0x11b449:
    00007ffe`2621cd41 488b10          mov     rdx,qword ptr [rax] ds:00000155`e2fd3000=????????????????
    Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ffe2621cd41 (harfbuzz_shaping_engine_dll!Java_com_aspose_words_shaping_harfbuzz_HB_hb_1shape+0x000000000011b449)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 00000155e2fd3000
Attempt to read from address 00000155e2fd3000

PROCESS_NAME:  java.exe

READ_ADDRESS:  00000155e2fd3000 

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  0000000000000000

EXCEPTION_PARAMETER2:  00000155e2fd3000

STACK_TEXT:  
0000003e`c33fccd8 00007ffe`26101520     : 00000155`95d80000 cccccccc`cccccccc 0000003e`c33fcd30 00007ffe`2612361f : harfbuzz_shaping_engine_dll!Java_com_aspose_words_shaping_harfbuzz_HB_hb_1shape+0x11b449
0000003e`c33fcce0 00007ffe`26101669     : 00000155`d37e3730 00000155`e2fd2ea0 0000003e`c33fcd90 00000155`a66da340 : harfbuzz_shaping_engine_dll+0x1520
0000003e`c33fcd20 00000155`91cacbd7     : cccccccc`cccccc01 00000007`5d110ab8 0000003e`c33fcdd0 00000000`000000c9 : harfbuzz_shaping_engine_dll!Java_com_aspose_words_shaping_harfbuzz_HB_hb_1buffer_1add_1utf8+0x45
0000003e`c33fcd50 cccccccc`cccccc01     : 00000007`5d110ab8 0000003e`c33fcdd0 00000000`000000c9 00000000`000000c9 : 0x00000155`91cacbd7
0000003e`c33fcd58 00000007`5d110ab8     : 0000003e`c33fcdd0 00000000`000000c9 00000000`000000c9 00000000`00000000 : 0xcccccccc`cccccc01
0000003e`c33fcd60 0000003e`c33fcdd0     : 00000000`000000c9 00000000`000000c9 00000000`00000000 00000000`000000c9 : 0x00000007`5d110ab8
0000003e`c33fcd68 00000000`000000c9     : 00000000`000000c9 00000000`00000000 00000000`000000c9 00000000`00000001 : 0x0000003e`c33fcdd0
0000003e`c33fcd70 00000000`000000c9     : 00000000`00000000 00000000`000000c9 00000000`00000001 00000007`5d110ab8 : 0xc9
0000003e`c33fcd78 00000000`00000000     : 00000000`000000c9 00000000`00000001 00000007`5d110ab8 00000007`0694a870 : 0xc9


SYMBOL_NAME:  harfbuzz_shaping_engine_dll+11b449

MODULE_NAME: harfbuzz_shaping_engine_dll

IMAGE_NAME:  harfbuzz-shaping-engine-dll.dll

STACK_COMMAND:  ~66s; .ecxr ; kb

FAILURE_BUCKET_ID:  INVALID_POINTER_READ_c0000005_harfbuzz-shaping-engine-dll.dll!Unknown
    OS_VERSION:  10.0.17763.1

BUILDLAB_STR:  rs5_release

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

FAILURE_ID_HASH:  {e199a18d-51db-f7b5-33ab-020c9281ffc5}

Aspose Word version : 21.9.0

Can you please help on this issue.

Thanks,
Arvind

@rnara It looks like there is some problem with Harfbuzz shaping engine. Do you run the application on Linux? For Windows platforms no additional efforts are required for installing HarfBuzz because Aspose.Words.Shaping.Harfbuzz already includes compiled HarfBuzz library.
For other systems, Aspose.Words.Shaping.Harfbuzz relies on already installed HarfBuzz library. For instance, many Linux-based systems have HarfBuzz installed system-wide by default. If not, there is usually a package available for installing via package manager.

Application runs on Windows platform.
Is there a way to fix this issue ?

Thanks,
Arvind

@rnara Could you please create a simple console application that will allow us to reproduce the problem on our side or provide documents and code required to reproduce it? We will check the issue and provide you more information.

Hi,

It is not happening for specific set of documents. The process is getting crashed for all the documents.

Thanks.
Arvind

@rnara, this is the first time a problem like that has been reported. It is hard to analyze it, if we cannot reproduce it.

Could you check whether the issue is reproducible in the customer’s environment with the latest releases of Aspose.Words for Java and HarfBuzz plugin?

Hi,

Customer has shared the more dump details which has stack trace as well. Can you please look into it.
dump_trace.zip (25.3 KB)

Thanks,
Arvind

@rnara According to the provided dump hb_buffer_add_utf8 function is used. Currently this function is not used by Aspose.Words. So it looks like you are using some old version of Aspose.Words. Please try using the latest 23.8 version of Aspose.Words and let us know if the problem still persist.

Hi,

Customer is using old version in the production. We are not able to reproduce the issue with the same Aspose version. So it will not help even we try with latest Aspose version. It is important to understand the root cause and know the version of Aspose the issue is addressed.

Thanks,
Arvind

@rnara Unfortunately, we also cannot preproduce the problem on our side. As I have mentioned the problem occurs in hb_buffer_add_utf8_func method, which was called like this in old version of Aspose.Words:

internal void AddText(string str)
{
    byte[] text = System.Text.Encoding.UTF8.GetBytes(str);
    HB.hb_buffer_add_utf8_func(mReference, text, text.Length, 0, text.Length);
}

in newer versions the method has been updated to the following:

internal void AddText(string str)
{
    HB.hb_buffer_add_utf16_func(mReference, str, str.Length, 0, str.Length);
}

According to the provided stack trace AccessViolation exception is thrown, it looks like for some reason in your customers environment byte array created from the string cannot be read by hb_buffer_add_utf8_func method. Unfortunately, we cannot guess what the root cause of this issue in your customer’s environment and encourage you to update to the newer version of Aspose.Words.

Hi Team,

In which version of Aspose words this is updated?

Thanks,
Arvind

@rnara It has been updated in 22.1 version of Aspose.Words.