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

Handle some IllegalArgument cases in readBytes #175

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hiddenalpha
Copy link

The 2nd error covered here potentially could explain cases like #122 or related. Example: Passed-in 'byteCount' is either far too large or even a negative value which could trigger undesired behavior when used to allocate an array.

The 2nd error covered here potentially could explain cases like

java-native#122

or related. Example: Passed-in 'byteCount' is either far too large or
even a negative value which could trigger undesired behavior when used
to allocate an array.
@hiddenalpha
Copy link
Author

hiddenalpha commented Nov 22, 2024

Where can I find an anyhow useful error message about why so many automated builds are failing? No matter where I click, It only literally says: "Error:". I have no idea what I should fix.

@tresf
Copy link

tresf commented Nov 22, 2024

Where can I find an anyhow useful error message about why so many automated builds are failing? No matter where I click, It only literally says: "Error:". I have no idea what I should fix.

I think GitHub actions' log area uses JavaScript to expand the relevant section and navigate to the error. Depending on your browser, if this isn't firing it might be hiding everything.

Anyhow.... Here's what my browser shows:

cmake-build:
     [exec] [ 50%] Building CXX object CMakeFiles/jssc.dir/src/main/cpp/_nix_based/jssc.cpp.o
     [exec] /home/runner/work/jssc/jssc/src/main/cpp/_nix_based/jssc.cpp: In function ‘_jbyteArray* Java_jssc_SerialNativeInterface_readBytes(JNIEnv*, jobject, jlong, jint)’:
     [exec] /home/runner/work/jssc/jssc/src/main/cpp/_nix_based/jssc.cpp:674:33: error: expected unqualified-id before ‘&’ token
     [exec]   674 |     }catch( const std::bad_alloc& ex ){
     [exec]       |                                 ^
     [exec] /home/runner/work/jssc/jssc/src/main/cpp/_nix_based/jssc.cpp:674:33: error: expected ‘)’ before ‘&’ token
     [exec]   674 |     }catch( const std::bad_alloc& ex ){
     [exec]       |           ~                     ^
     [exec]       |                                 )
     [exec] /home/runner/work/jssc/jssc/src/main/cpp/_nix_based/jssc.cpp:674:33: error: expected ‘{’ before ‘&’ token
     [exec] /home/runner/work/jssc/jssc/src/main/cpp/_nix_based/jssc.cpp:674:35: error: ‘ex’ was not declared in this scope
     [exec]   674 |     }catch( const std::bad_alloc& ex ){
     [exec]       |                                   ^~
     [exec] gmake[2]: *** [CMakeFiles/jssc.dir/build.make:79: CMakeFiles/jssc.dir/src/main/cpp/_nix_based/jssc.cpp.o] Error 1
     [exec] gmake[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/jssc.dir/all] Error 2
     [exec] gmake: *** [Makefile:91: all] Error 2

@hiddenalpha
Copy link
Author

I think GitHub actions' log area uses JavaScript to expand the relevant section and navigate to the error. Depending on your browser, if this isn't firing it might be hiding everything.

Thx. It really was that simple :) Didn't notice that actions require yet another domain to run JavaScript from.

@hiddenalpha hiddenalpha force-pushed the HandleSomeIllegalArgumentCasesInReadBytes-20241122 branch from f5f701c to 4c387d9 Compare November 23, 2024 18:37
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 this pull request may close these issues.

2 participants