function names not displayed in gdb backtrace kgdb setup - debugging

I have set up a debugging environment of KGDB between two VMWare virtual machines using the following link:
https://embeddedguruji.blogspot.com/2018/12/debugging-linux-kernel-using-kgdb-part-1.html
When I run backtrace, I am not getting the function name. What I am missing here?
Program received signal SIGTRAP, Trace/breakpoint trap.
0xffffffff9f141990 in ?? ()
(gdb) bt
#0 0xffffffff9f141990 in ?? ()
#1 0xffffffff9f55d962 in ?? ()
#2 0x0000000000000002 in irq_stack_union ()
#3 0xffffba8801a87f10 in ?? ()
#4 0x00000000017c4408 in ?? ()
#5 0xffffba8801a87f10 in ?? ()
#6 0xffffffff9f55ddb4 in ?? ()
#7 0xffff949d8a62f740 in ?? ()
#8 0xffffffff9f2cf5cc in ?? ()
#9 0x0000000001917000 in ?? ()
#10 0xffff949daf914400 in ?? ()
#11 0xffffffff9f25a066 in ?? ()
#12 0xffff949db7109ea0 in ?? ()
#13 0xffff949daf914400 in ?? ()
#14 0x0000000000000002 in irq_stack_union ()
#15 0xffffba8801a87f10 in ?? ()
#16 0x0000000000000000 in ?? ()

Related

how to generate it() tests after waiting on an asynchronous response

I want to generate it() tests in a loop, but the data required to drive the loop needs to be retrieved asynchronously first. I've tried solving the problem using before() but it won't work.
The code below retrieves and displays the parameters in the loop correctly but... the it() tests don't get executed.
It's as if mocha ignores it() that appear AFTER waiting on a promise.
describe('Generated tests', async () => {
const testParams = await <asynchronous call here>
testParams.forEach(testParam=> {
console.log(testParam)
it(`Generated test for ${testParam}, () => myTestFunc(testParam))
})
})
Solved this by placing await before describe:
describe('All Tests', async () => {
it('Level1 Test', () => <test code here> )
const testParams = await <async call here>
describe('Generated tests', () => {
testParams.forEach(testParam=> it(`Test ${testParam}`, ()=>testFunc(testParam))
})
})

Cypress: Why finicky in handling spec's after hook?

Blocked by a Cypress custom command not executing properly within a spec's after hook when a test failed. Experimented with the following minimal spec examples.
Context
Testing two Cypress custom commands:
cy.cmdLogin(): Standard username password authentication
cy.cmdLogout(): cy.get('logout_button').click()
Spec #1, cy.cmdLogout() in after hook does work
Very simple Cypress tests spec, test cy.cmdLogin() with after hook with cy.cmdLogout(), works perfectly:
context('SPEC Login', () => {
after('AFTER Logout', () => {
if (this.successLogin) {
cy.cmdLogout().then(() => {
cy.log('Logout Success');
});
}
});
it('TEST Login', () => {
cy.cmdLogin().then(() => {
cy.log('Login Success');
this.successLogin = true;
});
});
});
Spec #2, cy.cmdLogout() in after hook does not work
Modified Cypress tests spec, test cy.cmdLogin() with after hook with cy.cmdLogout(), now added a test that forced failure expect(false).to.be.a('boolean').to.be.true;. The after hook cy.cmdLogout() is called and fails:
Verified that Cypress could handle cy.get('logout_button') without failure.
Yet, extending with .click(), cy.get('logout_button').click(), Cypress would throw an error: Can not perform click() on undefined.
context('SPEC Login', () => {
after('AFTER Logout', () => {
if (this.successLogin) {
cy.cmdLogout().then(() => {
cy.log('Logout Success');
});
}
});
it('TEST Login', () => {
cy.cmdLogin().then(() => {
cy.log('Login Success');
this.successLogin = true;
});
});
it('TEST Fail', () => {
expect(false).to.be.a('boolean').to.be.true;
});
});
Spec #3, removed after hook, cy.cmdLogout() moved to another test does work
Modified Cypress tests spec again and removed after hook, test cy.cmdLogin(), test forced failure, and now test cy.cmdLogout(). This works perfectly:
context('SPEC Login', () => {
it('TEST Login', () => {
cy.cmdLogin().then(() => {
cy.log('Login Success');
this.successLogin = true;
});
});
it('TEST Fail', () => {
expect(false).to.be.a('boolean').to.be.true;
});
it('TEST Logout', () => {
if (this.successLogin) {
cy.cmdLogout().then(()=> {
cy.task('log', 'Logout Success');
});
}
});
});
Insight as to why Cypress is finicky with spec's after hook would be very much appreciated
The short answer (for the general situation) is change after() hook to before() hook, but in your case that wouldn't work because this.successLogin will always be undefined inside a before.
You would need to create a cy.isLoggedIn() command or call cy.cmdLogout() unconditionally.
To get after() the logic working on a fail, use
after('AFTER Logout', () => {
cy.cmdLogout()
});
Cypress.on('fail', (error, runnable) => {
cy.cmdLogout()
throw error
})
which is equivalent to this in plain javascript
try {
some-code-that-might-error()
cy.cmdLogout() // does not run if error occurs
} catch (error) {
cy.cmdLogout() // do the logout in error situation
}

Oracle (Amazon RDS) session hangs

I have a primary process and a mirror process. They both connect to same schema. Primary process execute dml queries while mirror do the fetching. Randomly primary process is hanged in an update query with following stack trace
#0 0x00007fceaffe170d in read () from /lib64/libpthread.so.0
#1 0x00007fceb64c9150 in snttread () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#2 0x00007fceb48e7c75 in nttrd () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#3 0x00007fceb47c887a in nsprecv () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#4 0x00007fceb47d1bd5 in nsrdr () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#5 0x00007fceb5855282 in nsfull_pkt_rcv () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#6 0x00007fceb585b7af in nsfull_brc () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#7 0x00007fceb64bdaae in nsbrecv () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#8 0x00007fceb64b3b3e in nioqrc () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#9 0x00007fceb64c971d in ttcdrv () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#10 0x00007fceb64b8649 in nioqwa () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#11 0x00007fceb649a74c in upirtrc () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#12 0x00007fceb64a4f66 in kpurcsc () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#13 0x00007fceb649c042 in kpuexec () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
#14 0x00007fceb649b0f9 in OCIStmtExecute () from /app/oracle/product/12.1.0.2/client_1/lib/libclntsh.so.12.1
When examined in session level (v$sqltext, v$lock), mirror is in a blocking (block=1) call with a select statement, while primary is in waiting (block=0) state with an update statement to the same table. Can a select statement be in a blocking call ? What are the directions that i can investigate this further ?

Executing a function inside puppeteer context

So, basically, I'm writing tests for my app, and I'd like to run a function inside the puppeteer browser's context. This is what I've tried:
Test code:
const printBlah = () => {
console.log('blah');
};
describe('Printing blah', () => {
it('Should print "blah".', async () => {
await page.evaluate(() => printBlah());
});
});
The error I'm getting:
1) Printing blah
Should print "blah".:
Error: Evaluation failed: ReferenceError: printBlah is not defined
at __puppeteer_evaluation_script__:1:16
at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:93:19)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at ExecutionContext.evaluate (node_modules/puppeteer/lib/ExecutionContext.js:32:16)
-- ASYNC --
at ExecutionContext.<anonymous> (node_modules/puppeteer/lib/helper.js:82:19)
at DOMWorld.evaluate (node_modules/puppeteer/lib/DOMWorld.js:111:24)
-- ASYNC --
at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:82:19)
at Page.evaluate (node_modules/puppeteer/lib/Page.js:792:47)
at Page.<anonymous> (node_modules/puppeteer/lib/helper.js:83:27)
at /mnt/repos/r/p/src/p/index.spec.ts:124:16
at step (src/p/index.spec.ts:33:23)
at Object.next (src/p/index.spec.ts:14:53)
at /mnt/repos/r/p/src/p/index.spec.ts:8:71
at new Promise (<anonymous>)
at __awaiter (src/p/index.spec.ts:4:12)
at Context.<anonymous> (src/p/index.spec.ts:123:30)
at processImmediate (internal/timers.js:456:21)

Proteactor- jasmine - How to execute one js file inside another js

Suppose have A.js file with 10 it blocks, now in middle of exuction say in 6th it block need to execute another more js file say B.js
I'm not sure this is what you mean, but you could have several describe blocks with their it blocks inside of them.
describe('Main file', () => {
describe('Describe A', () => {
it('some it block from A', async () => {
// code here
});
});
describe('Describe B', () => {
it('some it block from B', async () => {
// code here
});
});
});

Resources