Category Archives: Error

(Keil MDK) UCOS floating point support abnormal solution

Recently, we encountered a problem, that is, the printf display of floating-point calls in uCOSII is abnormal, but the support for floating-point calls on bare metal machines is normal. Here are the details.

When calling printf to debug floating-point numbers in UCOS, it is correct in memory, but print data is 0, and other shaping data are normal.

The running result on bare metal is completely normal, that is to say, the problem lies in UCOS.

According to the information, this is because the user task stack is not aligned with octets. When running bare metal programs, the system’s default stack octets are aligned, but UCOS’s user task stack is not.

Align the user stack octets.

 

Solution:

1. Solutions under IAR: (untested)

Through # pragma data_ Alignment specifies the number of bytes to align

For example:


#pragma data_alignment=8

OS_STK Task1_LED1_Stk[Task1_LED1_Stk_Size];

#pragma data_alignment=8

OS_STK T

2. Solutions under keil MDK: (available for personal testing)

Add the force octet alignment command before the task stack declaration, as follows:

__align(8) static OS_STK  TaskEquipmentStk[TASK_EQUIPMENT_STK_SIZE];
__align(8) static OS_STK  TaskUartRcvStk[TASK_UARTRCV_STK_SIZE];
__align(8) static OS_STK  TaskFileRcvStk[TASK_FILERCV_STK_SIZE];
__align(8) static OS_STK  TaskFtpStk[ TASK_FTP_STK_SIZE ];
__align(8) static OS_STK  TaskErrorRateRS485Stk[ TASK_ERROR_RATE_RS485_STK_SIZE ];

 

Detailed explanation of the reasons

The history of this is that arm itself does not support non aligned data access; Therefore, with a 64bit data operation instruction, the instruction requires 8-byte alignment.

Furthermore, after a certain version of the compiler (rvct3?) AAPCs requires stack 8-byte alignment.

AAPCs with 8-byte alignment first, then cm3. Pay attention to the sequence. Before cm3 r2p0, automatic stack pressing does not require 8 alignment, and r2p0 seems to be forced alignment.

Printf’s 8-alignment is required by the C runtime and has nothing to do with hardware. The C RTL manual is written and can be read. Its root lies in the requirements of AAPCs; AAPCs is rooted in instructions like LDRD.

In other words, in the future, if 128bit data operation is available and arm does not support non alignment, AAPCs may be upgraded to 16 byte alignment.

[Solved] Illegal access: this web application instance has been stopped already

The environment at that time:

When testing the UAT project, I suddenly found that the project could not be accessed normally. In fact, there are many times when the project is still in good condition in the last second and explodes in the next second. It’s very uncomfortable, especially when testing the joint debugging

So he opened the log with curiosity and found that the original report was wrong

java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already.
 
Could not load [java.beans.PropertyChangeEvent]. The following stack trace is thrown for debugging 

purposes as well as to attempt to terminate the thread which caused the illegal access.

His general meaning is that the web application has stopped and can’t load something called XXXXXXXX.

Then kill the Tomcat process, and then get up
to solve the problem….

be careful:

if you restart tomcat, you cannot solve the problem.
to modify the server.xml , add a child element to the tag, find the tag, and set the attribute value of reloadable to reloadable = false.

It means hot deployment, which is convenient for developers

[Solved] javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat

There was a problem when the test server restarted Tomcat

javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat

the main reason for the error: 

there are multiple Tomcat on the server, and they all use Druid  to do so

solution: 

modify the catalina.sh :
add this sentence Code: Java_ OPTS=”- Ddruid.registerToSysProperty=true ”

 

SSM custom 404 and 500 error reporting interface

SSM custom 404 and 500 error reporting interface

1. In web.xml Configuration 2, test 404 error

1. In web.xml Medium configuration

 <!--Replace the 400 and 500 error message screens-->
  <error-page>
    <error-code>404</error-code>
    <location>/WEB-INF/error/404.jsp</location>
  </error-page>
  <error-page>
    <error-code>500</error-code>
    <location>/WEB-INF/error/500.jsp</location>
  </error-page>

2. Test 404 error

As shown in the figure below, is the effect much more comfortable than a pile of newspapers.

How to Solve Kafka Error: no leader

When sending messages to Kafka as producer , an error is reported

There is no leader for this topic-partition as we are in the middle of a leadership election

The specific reason is not very clear, but the solution issue has been found. According to the answer below issue , the following modifications have been made:

The original Kafka is deleted_ BROKER_ ID: 1 when starting docker compose , add -- no recreate at the end of the command. The official explanation is to ensure that the container is not recreated, so as to retain its name and ID

If you still can’t solve the problem after modifying the above configuration, delete the Kafka container, re run docker compose up -- no recreate , and check the #516

R: Data frame index error “unexpected token”

Objective: to practice PCA analysis with prcomp function
data set: R comes with iris data set
error reporting content: when removing the “species” column in Iris data set with data frame index, errors are always reported, as follows:

> iris_data <- [,-5] 
Error: Unexpected'[' in "iris_data <- ["

Oh, it’s really a very low-level error. The reason for the error is that the data set is not indicated. After modification, the code is as follows:

iris_data <- iris[,-5]

the second similar problem:
original code:

fviz_pca_ind(iris.pca,
             geom.ind = ("point", "text"), # show points only (nbut not "text")
             col.ind = iris$Species, # color by groups
             palette = c("#00AFBB", "#E7B800", "#FC4E07"),
             addEllipses = TRUE, # Concentration ellipses
             legend.title = "Groups"
             )

report errors:

Error: Unexpected',' in:
"fviz_pca_ind(iris.pca,
             geom.ind = ("point","

Modified code: added “C” in front

fviz_pca_ind(iris.pca,
             geom.ind = c("point", "text"), # show points only (nbut not "text")
             col.ind = iris$Species, # color by groups
             palette = c("#00AFBB", "#E7B800", "#FC4E07"),
             addEllipses = TRUE, # Concentration ellipses
             legend.title = "Groups"
             )

Klee Error: Assertion `userMainFn && “unable to get user main“‘ failed

Problem
klee reports an error.

klee: /tmp/klee_src/tools/klee/main.cpp:1068: void createLibCWrapper(std::vector<std::unique_ptrllvm::Module >&, llvm::StringRef, llvm::StringRef): Assertion `userMainFn && “unable to get user main”’ failed.

Cause
The test code added ifdef INCLUDEMAIN, which caused the main function to be skipped and triggered klee’s assertion.

#ifdef INCLUDEMAIN
int main 
.....
.....
#endif

solve

Just comment out those two lines.

The loop of life and death occurs when the El table component of element UI is bidirectional bound

Regarding the data binding of el-table, an error occurred, and the main error message is as follows.

TypeError: Cannot read property ‘offsetHeight’ of null

Cannot read property ‘offsetHeight’ of null

this.$el.querySelectorAll is not a function

1 recursive calls

TypeError: data.reduce is not a function

Cannot read property ‘instance’ of undefined

Error in callback for immediate watcher “data”: “TypeError: data.indexOf is not a function”

Reason:
:data = param The result is that this param is an object. Example.
vue

 <el-table :data="image.users" ref="usersRef" border>
 </el-table>

js

image:{
    users: {
      cryptionType: 'sha256',
      token: '',
      userList: [
        {
          username: '',
          password: '',
          groups: '',
          remark: ''
        }
      ]
    }
 }

Users is an object, and: data is bound to an array.
My situation is that the interface here has been changed. Users used to be an array, but now it has become an object. The real user array has been changed to the userlist of the users object, but the front-end code has not been changed, resulting in such an error.

So the front-end code is changed to : data= image.users.userList is normal.

[Solved] ValueError: the indices for endog and exog are not aligned

When running the following code

x = data1        
y = data2
X = sm.add_constant(x)
result = (sm.OLS(y, X)).fit()
print(result.summary)

Error: valueerror: the indexes for endog and exog are not aligned

Solutions:

1. Check the data type: it has nothing to do with the service or dataframe type, and it has nothing to do with whether the data types of Y and X are consistent

2. Check data length: len (y) and Len (x) have the same length

3. It is found that although the length of len is the same, the index value of data is different. That’s the problem.

Because my x data is vertically combined by two dataframe data through concat, the index values of the data are different.

As shown in the figure below:

The complete data are as follows:

       date 
0    20180101
1    20180102
2    20180103
3    20180104
4    20180105
5    20180106

But the consolidated data is presented in this way, but:

       date 
0    20180101
1    20180102
2    20180103
3    20180104
0    20180105
1    20180106

Because the index values on the left side of the two groups of service data used for calculation are different, an error is reported. Solution:

Whether the original data is of dataframe or service type, it is converted to list type first. Take dataframe data as an example

datalist = data['close'].tolist()                    # change dataframe to list
datalist = data + templist                           # list MERGER
dataf = pd.DataFrame(datalist, columns=['close'])    # list TO dataframe

After a series of data processing in the early stage, the program is executed again, and the error disappears.

Normal display:

                            OLS Regression Results
==============================================================================
Dep. Variable:                  close   R-squared:                       0.326
Model:                            OLS   Adj. R-squared:                  0.326
Method:                 Least Squares   F-statistic:                     1932.
Date:                Tue, 22 Jan 2019   Prob (F-statistic):               0.00
Time:                        14:34:33   Log-Likelihood:                -11706.
No. Observations:                4000   AIC:                         2.342e+04
Df Residuals:                    3998   BIC:                         2.343e+04
Df Model:                           1
Covariance Type:            nonrobust
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
const          6.8217      0.092     74.332      0.000       6.642       7.002
close          0.3305      0.008     43.951      0.000       0.316       0.345
==============================================================================
Omnibus:                      786.494   Durbin-Watson:                   0.009
Prob(Omnibus):                  0.000   Jarque-Bera (JB):             1384.316
Skew:                           1.260   Prob(JB):                    2.51e-301
Kurtosis:                       4.399   Cond. No.                         15.7
==============================================================================

How to Solve Error: java.io.IOException: Resource [classpath:shiro.ini] could not be found.

scene

When Tomcat starts, it always reports an error. It can’t find the configuration file in the classpath, but the configuration file has been placed in the resource directory

 

 

Solution

The reason for this exception is that the new conf folder cannot be recognized, because it is not set as a resource folder. Just right click the conf folder – >build path – > use as source folder