Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function selection via index broken on v0.2.24 to v0.2.28 #244

Closed
zeroflaw opened this issue Jan 23, 2024 · 6 comments · Fixed by #245
Closed

Function selection via index broken on v0.2.24 to v0.2.28 #244

zeroflaw opened this issue Jan 23, 2024 · 6 comments · Fixed by #245

Comments

@zeroflaw
Copy link

zeroflaw commented Jan 23, 2024

I updated to v0.2.28 and had an issue selecting a function. So I had this list :

cargo asm -p exchange_reactor --lib 
 0 "<exchange_reactor::BootstrapReactor as exchange_reactor::Reactor>::poll" [19]
 1 "<exchange_reactor::BootstrapReactor as exchange_reactor::Reactor>::state" [8]
 2 "<exchange_reactor::BootstrapReactor as exchange_reactor::ReactorCold<exchange_reactor::TradingReactor>>::next" [29]
 3 "<exchange_reactor::CompleteReactor as exchange_reactor::Reactor>::poll" [7]
 4 "<exchange_reactor::CompleteReactor as exchange_reactor::Reactor>::state" [7]
 5 "<exchange_reactor::CompleteReactor as exchange_reactor::ReactorCold<exchange_reactor::TradingReactor>>::next" [14]
 6 "<exchange_reactor::ShutdownReactor as exchange_reactor::Reactor>::poll" [19]
 7 "<exchange_reactor::ShutdownReactor as exchange_reactor::Reactor>::state" [8]
 8 "<exchange_reactor::ShutdownReactor as exchange_reactor::ReactorCold<exchange_reactor::TradingReactor>>::next" [83]
 9 "<exchange_reactor::TradingReactor as exchange_reactor::ReactorHot>::next" [49]
10 "<exchange_reactor::TradingRuntime as core::default::Default>::default" [48]
11 "core::ptr::drop_in_place<exchange_reactor::BootstrapReactor>" [6]
12 "core::ptr::drop_in_place<exchange_reactor::CompleteReactor>" [7]
13 "core::ptr::drop_in_place<exchange_reactor::ShutdownReactor>" [6]
14 "exchange_reactor::TradingRuntime::cold_handle" [113]
15 "exchange_reactor::TradingRuntime::new" [50]
16 "exchange_reactor::TradingRuntime::next" [92]
17 "exchange_reactor::TradingRuntime::poll" [87]
18 "exchange_reactor::TradingRuntime::poll::cold" [48]
19 "exchange_reactor::cold_log_error" [66]

I then went to select poll of TradingRuntime using

cargo asm -p exchange_reactor --lib 17

I ended up getting the wrong function being exported:

.section ".text.<exchange_reactor::BootstrapReactor as exchange_reactor::Reactor>::poll","ax",@progbits
        .p2align        4, 0x90
        .type   <exchange_reactor::BootstrapReactor as exchange_reactor::Reactor>::poll,@function
<exchange_reactor::BootstrapReactor as exchange_reactor::Reactor>::poll:
---snip---

rolled back through v0.2.28, v0.2.27, v0.2.26, v0.2.25, v0.2.24, which all suffer from the same issue, with v0.2.23 working as expected. My library is not open-source. The poll function is a trait that is implemented on multiple types. Maybe because they have the same name they are getting confused?

If you struggle to reproduce, I am happy to try to create a minimum example.

@zeroflaw
Copy link
Author

fyi it broke on commit 74d69ad
I am able to get the correct output if I specify the name e.g.

cargo asm -p exchange_reactor --lib exchange_reactor::TradingRuntime::poll 0

@pacak
Copy link
Owner

pacak commented Jan 23, 2024

Looking. FWIW one of the easier ways to find exactly which commit breaks the code is using git bisect

@pacak pacak mentioned this issue Jan 23, 2024
@pacak
Copy link
Owner

pacak commented Jan 23, 2024

I pushed rc-0.2.29 branch, with the fix. You can you confirm the bug is gone for you?

@zeroflaw
Copy link
Author

Can confirm branch works as expected. Thanks for the quick fix.

@pacak
Copy link
Owner

pacak commented Jan 23, 2024

Released 0.2.29

@pacak
Copy link
Owner

pacak commented Jan 23, 2024

Thank you for the bugreport ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants