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

Foundation.log hangs the app on the simulator with very long strings #798

Open
2 of 3 tasks
phvega opened this issue Nov 12, 2024 · 3 comments
Open
2 of 3 tasks

Foundation.log hangs the app on the simulator with very long strings #798

phvega opened this issue Nov 12, 2024 · 3 comments

Comments

@phvega
Copy link

phvega commented Nov 12, 2024

Issue details

Calling Foundation.log() with a very long string will cause the app to freeze but only on the simulator, I could not reproduce it on a real device. Furthermore, if the app is closed and reopened, it remains hung on the launch screen and requires a reinstall to make it usable.

I could not replicate the issue on a native Obj-C app with NSLog, so maybe could it be related to robovm?

Reproduction steps/code

I have uploaded a test app on https://github.com/phvega/robovm-nslog-test. Run the app on the simulator with ./gradlew launchIPhoneSimulator.

The app has a button and a label with the click count, when the count reaches 5 it tries to NSLog a very long string, leading to the app freeze.

Configuration

Build Tools:

  • IDEA plugin
  • Eclipse plugin
  • Gradle plugin

Versions:

  • Robovm: 2.3.22
  • XCode: 15.2 (15C500b)
  • JDK: OpenJDK 11.0.19

Build Targets:

Any model iOS 17.2 Simulator.


Stacktrace

// No stacktrace
@guillerodriguez
Copy link

Is someone able to reproduce this?

@dkimitsa
Copy link
Contributor

dkimitsa commented Feb 1, 2025

@guillerodriguez
hi,

it is related to Pipe limit on MacOS which is 16K and will hang around on 8148 char length being put to NSLog().
that's it we start simulator as process and listen for stdout/* pipes.
application from Xcode being run using xcrun simctl launch --console will hang as well.
so there is nothing involved in RoboVM.
also if you start app from simulator spring board it will not hang.

playing with it have discovered an option to start app with redirection to console using PTY

xcrun simctl launch --console-pty

and it seems doesn't hang in this case.
will play a bit and if all ok will try to update RoboVM code to use this parameter.,

@guillerodriguez
Copy link

@dkimitsa Great news, I was worried there could be something wrong inside RoboVM that could also eventually impact apps running on real hardware (not only in the simulator). Thanks for the update!

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

No branches or pull requests

3 participants