amoeba opened a new issue, #287:
URL: https://github.com/apache/arrow-nanoarrow/issues/287

   While testing nanoarrow's behavior with respect to error codes, a crasher 
was found. It can be reproduced with a short Python script that does the 
mangling and then runs the mangled stream through the dump_stream IPC helper.
   
   Steps to reproduce:
   
   1. Put 
https://raw.githubusercontent.com/snowflakedb/snowflake-connector-python/SNOW-870230-m-1-add-tests-of-bad-code-path-for-proper-error-handling/test/unit/test_arrow_data
 in your working directory
   2. Build nanoarrow_ipc with `NANOARROW_IPC_BUILD_APPS=ON` to get 
`dump_stream` and put it in your working directory
   3. Run the attached script repeatedly until you get something like
       > dump_stream(53000,0x1f671a080) malloc: *** error for object 
0x6000027b8050: pointer being freed was not allocated
       > dump_stream(53000,0x1f671a080) malloc: *** set a breakpoint in 
malloc_error_break to debug
   
   <details>
   <summary><code>test.py</code></summary>
   
   ```python
   import os
   import base64
   import subprocess
   
   with open(os.path.join(os.path.dirname(__file__), "test_arrow_data")) as f:
       b64data = f.read()
   
   decode_bytes = base64.b64decode(b64data)
   
   for i in range(8):
       try:
           print(subprocess.check_output(["./dump_stream", "-"], 
input=decode_bytes[:i] + decode_bytes[i + 1 :]))
       except Exception as e:
           print(e)
   
   ```
   </details>
   
   <details>
   <summary>Example output of running <code>test.py</code>
   
   ```
   ❯ python test.py
   stream.get_schema() returned 22 with error 'Expected 0xFFFFFFFF at start of 
message but found 0xE0FFFFFF'
   Command '['./dump_stream', '-']' returned non-zero exit status 1.
   stream.get_schema() returned 22 with error 'Expected 0xFFFFFFFF at start of 
message but found 0xE0FFFFFF'
   dump_stream(53000,0x1f671a080) malloc: *** error for object 0x6000027b8050: 
pointer being freed was not allocated
   dump_stream(53000,0x1f671a080) malloc: *** set a breakpoint in 
malloc_error_break to debug
   Command '['./dump_stream', '-']' died with <Signals.SIGABRT: 6>.
   stream.get_schema() returned 22 with error 'Expected 0xFFFFFFFF at start of 
message but found 0xE0FFFFFF'
   Command '['./dump_stream', '-']' returned non-zero exit status 1.
   stream.get_schema() returned 22 with error 'Expected 0xFFFFFFFF at start of 
message but found 0xE0FFFFFF'
   Command '['./dump_stream', '-']' returned non-zero exit status 1.
   stream.get_schema() returned 29 with error 'Expected 0 <= message body size 
<= 32943 bytes but found message body size of 268435500 bytes'
   Command '['./dump_stream', '-']' returned non-zero exit status 1.
   stream.get_schema() returned 29 with error 'Expected 0 <= message body size 
<= 32943 bytes but found message body size of 268435680 bytes'
   Command '['./dump_stream', '-']' returned non-zero exit status 1.
   stream.get_schema() returned 29 with error 'Expected 0 <= message body size 
<= 32943 bytes but found message body size of 268446944 bytes'
   Command '['./dump_stream', '-']' returned non-zero exit status 1.
   stream.get_schema() returned 29 with error 'Expected 0 <= message body size 
<= 32943 bytes but found message body size of 268446944 bytes'
   Command '['./dump_stream', '-']' returned non-zero exit status 1.
   ```
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to