Project

General

Profile

Actions

Bug #7338

closed
JI JI

rust: different int types turn garbage on FFI boundary

Bug #7338: rust: different int types turn garbage on FFI boundary

Added by Jason Ish over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

For example, in output-json-anomaly.c we have:

        int r;
            r = AppLayerGetEventInfoById(event_code, &event_name, &event_type);

Ultimately, at least for bittorrent-dht this results in a Rust function being called where the return type is i8. Even though Rust appears to return 0, the value seen by C is garbage.

- Likely due to the update to LLVM 19 in Rust 1.82.0.
- Doesn't appear to affect release builds, only debug builds.
- Only seems to affect return values, not return by argument style pointers.


Subtasks 1 (0 open1 closed)

Bug #7339: rust: different int types turn garbage on FFI boundary (7.0.x backport)ClosedJason IshActions

JI Updated by Jason Ish over 1 year ago Actions #1

  • Description updated (diff)

JI Updated by Jason Ish over 1 year ago Actions #2

  • Description updated (diff)

JI Updated by Jason Ish over 1 year ago Actions #3

  • Description updated (diff)

VJ Updated by Victor Julien over 1 year ago Actions #4

  • Label Needs backport to 7.0 added

OT Updated by OISF Ticketbot over 1 year ago Actions #5

  • Subtask #7339 added

OT Updated by OISF Ticketbot over 1 year ago Actions #6

  • Label deleted (Needs backport to 7.0)

JI Updated by Jason Ish over 1 year ago Actions #7

  • Status changed from Assigned to Resolved

JF Updated by Juliana Fajardini Reichow over 1 year ago Actions #8

  • Subject changed from rust: Rust 1.82.0 introduces an FFI issue where the C and Rust integer sizes differ in app-layer API to rust: different int types turn garbage on FFI boundary
  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom