Hmm. My naive guess is that either the Rust server is interpreting the 
list/string length incorrectly and just allocating memory for an absurd number 
of elements. We’d have to see if the client is generating properly encoded data 
or if the Rust server has incorrect decoding.

Either way the Rust server/client implementations should have some max memory 
bound. I should have included that.
________________________________
From: Erik (Jira) <j...@apache.org>
Sent: Friday, October 28, 2022 3:36:00 PM
To: dev@thrift.apache.org <dev@thrift.apache.org>
Subject: [jira] [Commented] (THRIFT-5664) fairly simple .thrift service call in 
rust , attempts to allocate too much memory and crashes


    [ 
https://issues.apache.org/jira/browse/THRIFT-5664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17625714#comment-17625714
 ]

Erik commented on THRIFT-5664:
------------------------------

full files are attached

> fairly simple .thrift service call in rust , attempts to allocate too much 
> memory and crashes
> ---------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-5664
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5664
>             Project: Thrift
>          Issue Type: Bug
>          Components: Rust - Compiler
>    Affects Versions: 0.16.0
>            Reporter: Erik
>            Priority: Major
>         Attachments: Cargo.toml, main.rs, test.rs, test.thrift
>
>
> A fairly small simple .thrift file of mine... when used with RUST on the 
> server side.. seems to crash spectacularly if called via Python client...
> thread - 
> [https://users.rust-lang.org/t/first-rust-thrift-server-crashing-on-returning-i32/83271/2]
> .thrift file
> {code:java}
> namespace java com.jrgemcp.twsapithrift
> namespace cpp twsapithrift
> exception IBSAPIException {
>   1: i32 error_code,
>   2: string message
> }
> service ibrokers {
>     i32 ping() throws (1:IBSAPIException error),
>     list<string> ib_status() throws (1:IBSAPIException error)
> }
> {code}
> The Server Handler Call
> {code:java}
>     fn handle_ping(&self) -> thrift::Result<i32> {
>         let ping_val: thrift::Result<i32> = Ok(0);
>         ping_val
>     }
> {code}
> Error coming from Rust built server
> {code:java}
> binding to 127.0.0.1:9090
> memory allocation of 18446744071562133505 bytes failed
> Aborted (core dumped)
> {code}
> Any ideas here?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to