-
Notifications
You must be signed in to change notification settings - Fork 784
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
crash at class instance value access #5201
Comments
I tested mruby-simplehttp by host binary FreeBSD/i386. This is no problem. Realtek soc is Big Endian. Is this relation problem ? |
I have FreeBSD 12.1 running on @yamori813, Can you show me the specific build settings and the Ruby code you tried? For FreeBSD/mips on qemu, I referred to https://wiki.freebsd.org/MipsEmulation. |
I use this build_config. https://github.com/yamori813/rtlbm-mruby/blob/master/build/mruby/build_config.rb |
I try simple code. This is crash a = {} This is no crash. a = {} |
This is mrbc message by crash script on FreeBSD 12.2R i386. https://gist.github.com/yamori813/cb6cd857d85d5f59b1e588feaf7b956c Is this relation the problem? |
This issue has already been reported and fixed. I got caught a little, so I saw the code of mruby-yabm. The receiving types corresponding to the Is it possible to fix these first and check again? |
I update mruby code to 00d1fd0. I understand half value cause of mrb_value in mruby-yabm. I found fix that is hash access not in class. But I still have crash(hangup) by hash access at request method in mruby-simplehttp. |
Did you fix all the bugs (mis-uses) of |
I did fix all. yamori813/mruby-yabm@30e2fd6 But still hang up at @uri[:path] = path in mruby-simplehttp. |
I thought after seeing #5214, what about adding |
@yamori813, I say extra meddling. |
I'm sorry, I made a mistake. |
I think MRB_USE_METHOD_T_STRUCT is default at 32bit cpu in mrbconf.h. Now addtion hang up SimpleHttpResponse.new(response_text). This is my work aound.
This is work. |
@yamori813 Could you tell us a few things?
|
I do clean some time but I have problem. |
I seem hang up is case of CPU exception. If this is true UART have message. I don't to access to UART now. I can't check it. |
I get UART access now. Exception is TLBMissRd(2). I seem memory access problem. |
Recently merged #5223 may improve the situation. Could you try it? |
I asked @yamori813 san on Twitter before to check the behavior with the same fix as #5223, but the situation seems to be the same. |
Sigh. |
@yamori813, Could you try Since mruby3, And how about disabling optimization? |
I try MRB_NO_BOXING and -O0. But Still have exception. |
Thank you very much. |
only hash code back to 2.1.2. Then CPU exception is not occur.
But I still have port number is half problem. |
port number problem fixed by delete build directory. |
I find fix.
|
I seem this is gcc4-mips-realtek bug. Work code is this.
Crash code is this.
|
Thank you for the report.
However, this fix looks inadequate. The original code casts
If it is a compiler bug for 64-bit operation, mruby uses 64-bit operation elsewhere, so I think it is difficult for mruby to handle it. |
In 32-bit CPU mode, I don't think the computational range of
If the result of the calculation exceeds How about replacing |
Sorry I use Japanese. リアルテックのSDKに含まれるgccはLexraアーキテクチャに修正されたもので、gccの 私としてはマクロよるifdefのような解決策でも良いかと思っています。 |
OK. I understand the situation. I try to remove (or at least reduce) |
Certainly! It doesn't exceed 32-bit range if However, even on 32-bit CPU, It exceeds 32-bit range in the following parts. Lines 625 to 627 in 1fbabe2
@yamori813 When you insert more than 17 entries into I think there is a way to calculate within 32-bit range, but I can't think of it. |
その方針でうまく解決できる方法が分かっているのでしたら、とりあえずパッチを書いていただけないでしょうか。 |
…hash.c Avoid 64-bit operations in `src/hash.c`; close #5201
I find fix this issue by 7c9d9b1. Thanks for all. |
I use mruby on realtek mips soc by bare metal.
I found problem at 2e30c68.
That is crash on modified mruby-simplehttp class at line of @uri[:path] = path in request method.
https://github.com/yamori813/mruby-simplehttp
I do workaround for this problem by not use @uri[:path].
I don't have crash but @uri[:port] is half value. I send double value in script then work is fine.
The text was updated successfully, but these errors were encountered: