Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
¿Cómo puede una función no recursiva aparecer dos veces en un seguimiento de pila?

Tengo una check de función que es más o menos así:

 void check() { // ... // Make some execute-only memory readable for subsequent inspection // using the mprotect system call mprotect(addr, length, PROT_READ | PROT_EXEC); // #1 // Read the memory and do some integrity checks ... if (addr[42] == 13) { // #2 // ... } }

Mi programa a veces falla con una falla de segmentación en la línea marcada con el #2, donde se lee la memoria.

Cuando miro el seguimiento de la pila, hay dos (!) Entradas de mi check de función:

  1. check de función, línea #2 (donde se lee la memoria)
  2. check de funciones, línea n.º 1 (llamada al sistema mprotect )

Entonces, de acuerdo con el seguimiento de la pila, mi función se llama de alguna manera desde dentro de sí misma, y esa llamada ocurre en la línea n. ° 1 donde hago la llamada al sistema mprotect .

¿Cómo es esto posible?

EDITAR: según lo solicitado, aquí está el seguimiento de la pila original:

 Crashed: Thread : SIGSEGV 0x000000752eaba9a8 #00 pc 0xddc08 libnative-49.so (isAnyFunctionBeingHooked(_JNIEnv*, unsigned char const**, unsigned long) [NativeLib.cpp:185]) #01 pc 0xddc00 libnative-49.so (isAnyFunctionBeingHooked(_JNIEnv*, unsigned char const**, unsigned long) [NativeLib.cpp:164]) #02 pc 0xd7b54 libnative-49.so (dFAH(_JNIEnv*) [NativeLib.cpp:267]) // Following entries are outside of my code ...

La línea 164 es la llamada a mprotect . La línea 185 está leyendo la memoria previamente hecha legible por mprotect .

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!